Пример #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;
        }
    }