//when the button gets pressed
    public void ButtonPressed()
    {
        _counter++;
        ButtonLightSwitch lamp = this.transform.GetComponentInChildren <ButtonLightSwitch>();

        lamp.ChangeTexture();
    }
Esempio n. 2
0
    //to switch the light color
    public void BoxLightSwitch()
    {
        ButtonLightSwitch lamp = this.transform.GetComponentInChildren <ButtonLightSwitch>();

        if (lamp != null)
        {
            lamp.ChangeTexture();
        }
    }