Skip to content

Instantly share code, notes, and snippets.

@kaorun55
Created June 22, 2016 09:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaorun55/c08017e37ad186a415fa2841e93fc25b to your computer and use it in GitHub Desktop.
Save kaorun55/c08017e37ad186a415fa2841e93fc25b to your computer and use it in GitHub Desktop.
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