Ejemplo n.º 1
0
    public void ChangeState()
    {
        currentLight.color = (currentLight.color == Color.red) ? Color.green : Color.red;

        if (currentLight.color == Color.green)
        {
            trafficLightScript.ChangeGo();
        }
        else
        {
            trafficLightScript.ChangeStop();
        }
    }