void FixedUpdate() { // Unable to attack if AI disabled or paralyzed if (GameManager.Instance.DisableAI || entityBehaviour.Entity.IsParalyzed) { return; } // Unable to attack when playing certain oneshot anims if (mobile && mobile.IsPlayingOneShot() && mobile.OneShotPauseActionsWhilePlaying()) { return; } // Countdown to next melee attack MeleeTimer -= Time.deltaTime; if (MeleeTimer < 0) { MeleeTimer = 0; } // Note: Speed comparison here is reversed from classic. Classic's way makes fewer attack // attempts at higher speeds, so it seems backwards. if (GameManager.ClassicUpdate && MeleeTimer == 0) { if (!MeleeAnimation()) { return; } ResetMeleeTimer(); } }