// 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(); } } } }
void Attack() { gi.dmg = pinfo.stats.GetRandomDamage(); gi.SetDmgTextColor(2); Instantiate(spear, transform.position, Quaternion.identity); attTimer.ResetTimer(); attacking = false; }
public override void StartCooldown() { duration.ResetTimer(); duration.SetActivity(true); coolDown.SetActivity(true); //Debug.Log("Duration"+abc.abilityDuration.Length+"cooldown"+abc.abilityCooldown.Length); abc.SetAbilityCooldown(slot, coolDown); abc.SetAbilityDuration(slot, duration); }
public void AnimateSprite(bool state) { animate = state; if (animate == true) { changeStanceTimer.ResetTimer(); Move(); } if (animate == false) { bool allowed = UpdateCountdownStanceTimer(); if (allowed) { StayIdle(); } } }
void Wait() { waitTimer.Countdown(); float timeLeft = waitTimer.GetCurTimerInSeconds(); if (timeLeft < 0) { couldNotReachGoal = false; waiting = false; waitTimer.ResetTimer(); ClearRoute(); } }