Created
June 22, 2016 08:38
-
-
Save kaorun55/6ef1b1e5fbd40407c8cb9e7683e1a7bb 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; | |
using System.Collections; | |
public class CubeCommand : MonoBehaviour { | |
public Material first; | |
public Material second; | |
public void OnSelect() | |
{ | |
Debug.Log("OnSelect"); | |
var material = GetComponent<Renderer>().material; | |
GetComponent<Renderer>().material = (material.color == first.color) ? second : first; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment