コード例 #1
0
    //when the button gets pressed
    public void ButtonPressed()
    {
        _counter++;
        ButtonLightSwitch lamp = this.transform.GetComponentInChildren <ButtonLightSwitch>();

        lamp.ChangeTexture();
    }
コード例 #2
0
    //to switch the light color
    public void BoxLightSwitch()
    {
        ButtonLightSwitch lamp = this.transform.GetComponentInChildren <ButtonLightSwitch>();

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