示例#1
0
    private void OnTriggerEnter(Collider other)
    {
        if (((1 << other.gameObject.layer) & layersToDetect) == 0)
        {
            return;
        }

        if (!wasTriggered)
        {
            if (doorToClose != null)
            {
                var door = doorToClose.GetComponent <IDoor>();
                door.Close();
            }

            if (spawnerToActivate != null)
            {
                spawnerToActivate.activate();
            }

            if (turretsToMakeMortal != null)
            {
                foreach (EnemyTurret turret in turretsToMakeMortal)
                {
                    turret.makeMortal();
                }
            }


            m_GameFlowManager.incRoomNumber();
            wasTriggered = true;
        }
    }