YIUILoopOnClick.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. namespace ET.Client
  3. {
  4. public interface IYIUILoopOnClick
  5. {
  6. /// <summary>
  7. /// 点击事件
  8. /// 调用SetOnClick方法设置点击事件信息后生效
  9. /// </summary>
  10. void OnClick(Entity self, Entity item, object data, int index, bool select);
  11. }
  12. public interface IYIUILoopOnClick<in T1, in T2, in T3> : ISystemType, IYIUILoopOnClick
  13. {
  14. }
  15. [EntitySystem]
  16. public abstract class YIUILoopOnClickSystem<T1, T2, T3, T4, T5> : SystemObject, IYIUILoopOnClick<T1, T2, T3>
  17. where T1 : Entity, IYIUIBind, IYIUIInitialize
  18. where T2 : Entity, IYIUIBind, IYIUIInitialize
  19. {
  20. Type ISystemType.Type()
  21. {
  22. return typeof(T1);
  23. }
  24. Type ISystemType.SystemType()
  25. {
  26. return typeof(IYIUILoopOnClick<T1, T2, T3>);
  27. }
  28. void IYIUILoopOnClick.OnClick(Entity self, Entity item, object data, int index, bool select)
  29. {
  30. YIUILoopOnClick((T1)self, (T2)item, (T3)data, index, select);
  31. }
  32. protected abstract void YIUILoopOnClick(T1 self, T2 item, T3 data, int index, bool select);
  33. }
  34. }