RotateTween.cs 718 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class RotateTween : TweenBase
  5. {
  6. public Vector3 StartEuler;
  7. public Vector3 EndEuler;
  8. protected override void Awake()
  9. {
  10. base.Awake();
  11. StartEuler = StartPoint.eulerAngles;
  12. EndEuler = EndPoint.eulerAngles;
  13. }
  14. public override void Init()
  15. {
  16. this.transform.eulerAngles = StartEuler;
  17. base.Init();
  18. }
  19. public override void StartAction()
  20. {
  21. if (!this.enabled)
  22. {
  23. return;
  24. }
  25. // CDebug.Log("rotate StartAction name = " + obj.name);
  26. LeanTween.rotateLocal(obj, EndEuler, duration).setEase(mLeanTweenType);
  27. }
  28. }