Skip to content

Instantly share code, notes, and snippets.

@SatoshiRobatoFujimoto
Created August 29, 2018 08:40
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 SatoshiRobatoFujimoto/d2d8b6f04807737bfc1ec3abae8123e9 to your computer and use it in GitHub Desktop.
Save SatoshiRobatoFujimoto/d2d8b6f04807737bfc1ec3abae8123e9 to your computer and use it in GitHub Desktop.
ガチラボ vol.9
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ColorManager : MonoBehaviour {
public GameObject cube;
public void SetColorRed()
{
cube.GetComponent<Renderer>().material.color = Color.red;
}
public void SetColorGreen()
{
cube.GetComponent<Renderer>().material.color = Color.green;
}
public void SetColorBlue()
{
cube.GetComponent<Renderer>().material.color = Color.blue;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment