S1101_FxLogic.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using Common.Combat.FxAILogic;
  4. using UnityEngine;
  5. public class S1101_FxLogic : FxParabolaBulletLogic
  6. {
  7. // public float move101Speed=
  8. private int moveState = 0;
  9. private Vector3 moveStateOneStartPos;
  10. protected float moveStateTime;
  11. protected override void ProInit()
  12. {
  13. moveState = 0;
  14. moveStateTime = 0;
  15. base.ProInit();
  16. CombatHeroEntity combatHeroEntity = TimeLineEventParticleLogicBasic.castEntity as CombatHeroEntity;
  17. moveStateOneStartPos = combatHeroEntity.dotPos;
  18. }
  19. public override void CombatUpdate(float time)
  20. {
  21. if (!_isUpdateBasic)
  22. {
  23. return;
  24. }
  25. if (moveState == 0)
  26. {
  27. moveStateTime += time * 4;
  28. Vector3 newPos = Vector3.Lerp(moveStateOneStartPos, startPos, moveStateTime);
  29. moveTarget.transform.position = newPos;
  30. if (moveStateTime >= 1)
  31. {
  32. moveState = 1;
  33. }
  34. }
  35. else
  36. {
  37. base.CombatUpdate(time);
  38. }
  39. }
  40. }