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; } }
void OnTriggerEnter(Collider col) { Prototype_Enemy enemy = col.GetComponent <Prototype_Enemy>(); if (enemy != null) { switch (enemy.collisionAction) { case Prototype_Enemy.CollisionAction.Death: Prototype_MainGame.instance.Loose(); break; case Prototype_Enemy.CollisionAction.Slow: Prototype_MainGame.instance.SetSlow(); break; case Prototype_Enemy.CollisionAction.Speed: Prototype_MainGame.instance.SetSpeed(); break; } } }