Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.
 
 
 

74 рядки
1.1 KiB

  1. using System;
  2. using UnityEngine;
  3. namespace Tweening
  4. {
  5. public abstract class TweenerTrackBase : MonoBehaviour
  6. {
  7. public float Delay
  8. {
  9. get
  10. {
  11. return this._delay;
  12. }
  13. }
  14. public float Duration
  15. {
  16. get
  17. {
  18. return this._duration;
  19. }
  20. }
  21. public float EndTime
  22. {
  23. get
  24. {
  25. return this._delay + this._duration;
  26. }
  27. }
  28. public AnimationCurve Curve
  29. {
  30. get
  31. {
  32. return this._curve;
  33. }
  34. }
  35. public abstract void UpdateComponentValue(float evaluatedTime);
  36. public abstract void InitializeComponentValue();
  37. public abstract void ResetComponentValue();
  38. public void ResetTrack()
  39. {
  40. this._initialized = false;
  41. this.ResetComponentValue();
  42. }
  43. public void InitializeTrack()
  44. {
  45. if (this._initialized)
  46. {
  47. return;
  48. }
  49. this.InitializeComponentValue();
  50. this._initialized = true;
  51. }
  52. [SerializeField]
  53. private float _delay;
  54. [SerializeField]
  55. private float _duration;
  56. [SerializeField]
  57. private AnimationCurve _curve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
  58. private bool _initialized;
  59. }
  60. }