public override IEnumerator effect() { Players player = GameController.getInstance().getPlayer(); Blink blink = player.gameObject.AddComponent <Blink> (); blink.StartEffect(2f); player.speed = (float)(playerSpeed / 1.5); yield return(new WaitForSeconds(2f)); player.speed = playerSpeed; }
IEnumerator effect(Players player) { SpikeActive = false; Blink blink = player.gameObject.AddComponent <Blink> (); blink.StartEffect(2f); player.speed = playerSpeed / 2; player.takeDamage(damage); yield return(new WaitForSeconds(2f)); player.speed = playerSpeed; SpikeActive = true; }