Created
June 22, 2016 09:01
-
-
Save kaorun55/c08017e37ad186a415fa2841e93fc25b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CubeCommand : MonoBehaviour | |
{ | |
public void OnRed() | |
{ | |
GetComponent<Renderer>().material.color = Color.red; | |
} | |
public void OnBlue() | |
{ | |
GetComponent<Renderer>().material.color = Color.blue; | |
} | |
public void OnGreen() | |
{ | |
GetComponent<Renderer>().material.color = Color.green; | |
} | |
public void OnReset() | |
{ | |
GetComponent<Renderer>().material.color = Color.white; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment