// Update is called once per frame void Update() { if (attacking) { attTimer.Countdown(); float timeLeft = attTimer.GetCurTimerInSeconds(); if (timeLeft < 0) { attTimer.ResetTimer(); PlayerInfo target = Target.GetTargetUnit(); if (!fromButton) { GetTarget(); } if (fromButton) { fromButton = false; GetTargetFromAttackButton(); } } } }
bool UpdateCountdownStanceTimer() { changeStanceTimer.Countdown(); float tl = changeStanceTimer.GetCurTimerInSeconds(); if (tl < 0) { changeStanceTimer.ResetTimer(); return(true); } return(false); }
void Wait() { waitTimer.Countdown(); float timeLeft = waitTimer.GetCurTimerInSeconds(); if (timeLeft < 0) { couldNotReachGoal = false; waiting = false; waitTimer.ResetTimer(); ClearRoute(); } }
// Update is called once per frame void Update() { timeToDie.Countdown(); float timeLeft = timeToDie.GetCurTimerInSeconds(); if (timeLeft < 0) { Destroy(gameObject); } TurnToPlayer(); MoveTowardsTarget(); }
// Update is called once per frame void FixedUpdate() { MarkFoeManage(); if (attacking == false) { attTimer.Countdown(); float timeLeft = attTimer.GetCurTimerInSeconds(); if (timeLeft < 0) { Vector3 posNoDecimals = new Vector3(trav.pos.x, trav.pos.y, -1); if (transform.position == posNoDecimals) { MeasureDistanceToTarget(); } } } if (attacking == true) { Attack(); } }