IEnumerator DisableEffect(float duration, Prototype_Enemy.CollisionAction action) { yield return new WaitForSeconds(duration); if (ActiveEffect == action) { Prototype_Stage.BaseSpeed = Level.Speed; ActiveEffect = Prototype_Enemy.CollisionAction.None; } }
public void SetSpeed() { if (ActiveEffect == Prototype_Enemy.CollisionAction.None || ActiveEffect != Prototype_Enemy.CollisionAction.Speed) { Prototype_Stage.BaseSpeed = Level.Speed * 2f; StartCoroutine(DisableEffect(1.5f, Prototype_Enemy.CollisionAction.Speed)); ActiveEffect = Prototype_Enemy.CollisionAction.Speed; Debug.Log("SPEED"); } }
public void SetSpeed() { if (ActiveEffect == Prototype_Enemy.CollisionAction.None || ActiveEffect != Prototype_Enemy.CollisionAction.Speed) { Prototype_Stage.BaseSpeed = Level.Speed * 2f; StartCoroutine(DisableEffect(1.5f, Prototype_Enemy.CollisionAction.Speed)); ActiveEffect = Prototype_Enemy.CollisionAction.Speed; Debug.Log("SPEED"); } }
IEnumerator DisableEffect(float duration, Prototype_Enemy.CollisionAction action) { yield return(new WaitForSeconds(duration)); if (ActiveEffect == action) { Prototype_Stage.BaseSpeed = Level.Speed; ActiveEffect = Prototype_Enemy.CollisionAction.None; } }