Beispiel #1
0
    public void Light2Click()
    {
        if (light1.isOn)
        {
            light1.Off();
        }
        else
        {
            light1.On();
        }

        if (light2.isOn)
        {
            light2.Off();
        }
        else
        {
            light2.On();
        }

        if (light3.isOn)
        {
            light3.Off();
        }
        else
        {
            light3.On();
        }
    }
Beispiel #2
0
    void GameStart()
    {
        int randOn = Random.Range(0, 2);

        if (randOn == 0)
        {
            light1.On();
        }
        else
        {
            light1.Off();
        }

        randOn = Random.Range(0, 2);

        if (randOn == 0)
        {
            light2.On();
        }
        else
        {
            light2.Off();
        }

        randOn = Random.Range(0, 2);

        if (randOn == 0)
        {
            light3.On();
        }
        else
        {
            light3.Off();
        }

        randOn = Random.Range(0, 2);

        if (randOn == 0)
        {
            light4.On();
        }
        else
        {
            light4.Off();
        }

        randOn = Random.Range(0, 2);

        if (randOn == 0)
        {
            light5.On();
        }
        else
        {
            light5.Off();
        }
    }