コード例 #1
0
ファイル: GameController.cs プロジェクト: Chaosed0/OddOffice
    // Called when eyes are closed, open doors and stuff
    void SetupForPhase(int index)
    {
        if (phases[index].focusTarget != null)
        {
            Camera.main.transform.rotation = Quaternion.LookRotation(phases[index].focusTarget.transform.position - player.transform.position);
        }

        foreach (Door door in monsterDoors)
        {
            door.Open();
        }

        Enemy[] enemies = GameObject.FindObjectsOfType <Enemy>();
        foreach (Enemy enemy in enemies)
        {
            Destroy(enemy.gameObject);
        }

        foreach (GameObject activateMe in phases[index].thingsToActivate)
        {
            activateMe.SetActive(true);
        }

        foreach (GameObject activateMe in phases[index].thingsToDeactivate)
        {
            activateMe.SetActive(false);
        }

        lightsManager.SetTrippyLighting();

        if (index == 2)
        {
            EventBus.PublishEvent(new ActivateTrip());
        }
    }