IAction.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using UnityEngine;
  6. namespace CommonUnity3D.UGUIAction
  7. {
  8. public interface IAction
  9. {
  10. /// <summary>
  11. /// 动作更新.
  12. /// </summary>
  13. /// <param name="unit"></param>
  14. void onUpdate(IActionCompment unit, float deltaTime);
  15. /// <summary>
  16. /// 动作开始.
  17. /// </summary>
  18. /// <param name="unit"></param>
  19. void onStart(IActionCompment unit);
  20. /// <summary>
  21. /// 动作停止.
  22. /// </summary>
  23. /// <param name="unit"></param>
  24. void onStop(IActionCompment unit, bool sendCallBack);
  25. /// <summary>
  26. /// 动作是否结束.
  27. /// </summary>
  28. /// <param name="unit"></param>
  29. bool IsEnd();
  30. string GetActionType();
  31. }
  32. public interface IActionCompment
  33. {
  34. void AddAction(IAction action);
  35. void RemoveAction(IAction action, bool sendCallBack);
  36. bool HasAction(IAction action);
  37. void RemoveAllAction(bool sendCallBack = false);
  38. void UpdateAction(float deltaTime);
  39. float X { set; get; }
  40. float Y { set; get; }
  41. Vector2 Scale { get; set; }
  42. Vector2 Position2D { get; set; }
  43. float Alpha { get; set; }
  44. }
  45. }