예제 #1
0
    public void turnOn()
    {
        RenderSettings.ambientLight = defaultLight;

        foreach (GameObject light in GameObject.FindGameObjectsWithTag("light"))
        {
            light.GetComponent <Light>().intensity = 1;
        }

        foreach (GameObject door in GameObject.FindGameObjectsWithTag("door"))
        {
            door.GetComponent <AutoDoor>().recover();
        }

        foreach (GameObject MedicalRoom in GameObject.FindGameObjectsWithTag("medical"))
        {
            MedicalRoom.GetComponent <MedicalRoom>().recover();
        }

        foreach (GameObject PersonalLight in GameObject.FindGameObjectsWithTag("personLight"))
        {
            PersonalLight.GetComponent <Light>().intensity = 0;
        }
    }
예제 #2
0
    void breakDown(int count)
    {
        RenderSettings.ambientLight = Color.black;

        foreach (GameObject light in GameObject.FindGameObjectsWithTag("light"))
        {
            light.GetComponent <Light>().intensity = 1 - count * 0.13f;
        }

        foreach (GameObject door in GameObject.FindGameObjectsWithTag("door"))
        {
            door.GetComponent <AutoDoor>().breakDown();
        }

        foreach (GameObject MedicalRoom in GameObject.FindGameObjectsWithTag("medical"))
        {
            MedicalRoom.GetComponent <MedicalRoom>().breakDown();
        }

        foreach (GameObject PersonalLight in GameObject.FindGameObjectsWithTag("personLight"))
        {
            PersonalLight.GetComponent <Light>().intensity = 5;
        }
    }