void Update() { UpdateMovement(); UpdateAnimation(); if (powerBoostCounter > 0f) { powerBoostCounter = Mathf.MoveTowards(powerBoostCounter, 0f, Time.deltaTime); if (powerBoostCounter == 0f) { PowerBoostEnd(); } } if (flashTotal > 0) { UpdateFlash(); } if (stunned == 1) { if (!GetComponent <Animation>().IsPlaying(animArray[2])) { stunned = 0; if (isPlayer) { invulnerable = cc.StartInvulnerability(); } else { ai.SetAction(0); } } } }