IEnumerator CheckForShot() { while (shootButton != null) { if (!(shootButton.IsCooldown()) && (shootButton.IsClicked() || Input.GetKeyDown(KEY_SHOOT))) { shootButton.StartCooldown(); this.player.CreateDefaultShot(); } yield return(new WaitForSeconds(0.01F)); } yield break; }
IEnumerator checkForSkill() { while (skillButton != null) { if (!(skillButton.IsCooldown()) && (skillButton.IsClicked() || Input.GetKeyDown(KEY_SKILL))) { skillButton.StartCooldown(); this.player.CreateSpecialShot(); } yield return(new WaitForSeconds(0.01F)); } yield break; }
IEnumerator checkForShield() { while (shieldButton != null) { if (!(shieldButton.IsCooldown()) && (shieldButton.IsClicked() || Input.GetKeyDown(KEY_SHIELD))) { shieldButton.StartCooldown(); // Execute shield this.player.ActivateShield(); yield return(new WaitForSeconds(shieldDuration)); this.player.DeactivateShield(); } yield return(new WaitForSeconds(0.01F)); } yield break; }
IEnumerator CheckForBoost() { while (boostButton != null) { if (!(boostButton.IsCooldown()) && (boostButton.IsClicked() || Input.GetKeyDown(KEY_BOOST))) { boostButton.StartCooldown(); // Execute boost this.player.ActivateBoost(boostMultiplier); yield return(new WaitForSeconds(boostDuration)); this.player.DeactivateBoost(boostMultiplier); } yield return(new WaitForSeconds(0.01F)); } yield break; }