ActionBase.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace CommonUnity3D.UGUIAction
  5. {
  6. public class ActionBase : IAction
  7. {
  8. public delegate void ActionFinishHandler(IActionCompment sender);
  9. public ActionFinishHandler ActionFinishCallBack;
  10. protected bool mIsEnd = false;
  11. protected EaseType mEaseType = EaseType.linear;
  12. public EaseType ActionEaseType
  13. {
  14. get { return mEaseType; }
  15. set { mEaseType = value; }
  16. }
  17. public virtual void onUpdate(IActionCompment unit, float deltaTime)
  18. {
  19. }
  20. public virtual void onStart(IActionCompment unit)
  21. {
  22. }
  23. public virtual void onStop(IActionCompment unit, bool sendCallBack)
  24. {
  25. if (sendCallBack == true && ActionFinishCallBack != null) { ActionFinishCallBack(unit); }
  26. if (ActionFinishCallBack != null) { ActionFinishCallBack = null; }
  27. }
  28. public virtual bool IsEnd()
  29. {
  30. return mIsEnd;
  31. }
  32. public virtual string GetActionType()
  33. {
  34. throw new NotImplementedException();
  35. }
  36. }
  37. }