RepelledStatusState.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. using UnityEngine.AI;
  3. namespace GameLogic.Combat.Hero.SubStatus
  4. {
  5. public class RepelledStatusState : SubStatusBasic
  6. {
  7. private float repelledDis;
  8. private float speed;
  9. private System.Action callBack;
  10. private float _currMoveDis;
  11. private Vector3 dir;
  12. public RepelledStatusState(Vector3 dir, float repelledDis, float speed, System.Action callBack)
  13. {
  14. this.repelledDis = repelledDis;
  15. this.speed = speed;
  16. this.callBack = callBack;
  17. this.dir = dir.normalized;
  18. _currMoveDis = 0;
  19. }
  20. public override string IsGetStateName()
  21. {
  22. return CombatHeroStateType.NullState;
  23. }
  24. protected override void ProDispose()
  25. {
  26. CombatHeroEntity.CombatAIBasic.stateControl.ChangeState(CombatHeroStateType.idle);
  27. }
  28. protected override void ProUpdate(float t)
  29. {
  30. float addDis = speed * t;
  31. Vector3 pos= CombatHeroEntity.combatHeroGameObject.transform.position + dir * addDis;
  32. }
  33. }
  34. }