MoveTween.cs 684 B

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