TweenBasic.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. using System;
  2. using OfficeOpenXml.FormulaParsing.Excel.Functions.Logical;
  3. using UnityEngine;
  4. using Object = UnityEngine.Object;
  5. namespace Core.UI.UTool.UITween
  6. {
  7. [System.Serializable]
  8. public abstract class TweenBasic : IDisposable
  9. {
  10. public bool Foldout;
  11. public float duration;
  12. public float delay;
  13. public float currSchedule;
  14. protected float _addTime;
  15. public void Play(Object RectTransform,float allTime,bool isFallBack)
  16. {
  17. if (allTime < delay)
  18. {
  19. if (isFallBack)
  20. {
  21. Rest(RectTransform);
  22. }
  23. return;
  24. }
  25. ProPlay(RectTransform,allTime - delay);
  26. }
  27. protected virtual void ProPlay(Object RectTransform,float allTime)
  28. {
  29. }
  30. public void Rest(Object RectTransform)
  31. {
  32. ProRest(RectTransform);
  33. }
  34. protected virtual void ProRest(Object RectTransform)
  35. {
  36. }
  37. public void Prepare(float delay,float duration)
  38. {
  39. this.delay = delay;
  40. this.duration = duration;
  41. _addTime = 1.0f / duration;
  42. }
  43. public void Dispose()
  44. {
  45. ProDispose();
  46. }
  47. protected void ProDispose()
  48. {
  49. }
  50. }
  51. }