new Color(1f, 0.92f, 0.016f, 1f);
ランダムな色 Color randomColor = new Color( Random.value, Random.value, Random.value, 1.0f );
ランダムな色 Color randomColor = new Color( Random.value, Random.value, Random.value, 1.0f );
public class ChangeColorScript : MonoBehaviour { public GameObject myCube; // Use this for initialization void Start () { //gameObject取得 myCube = GameObject.Find("CubeName"); //今の色コンソールに出力 Debug.Log(myCube.renderer.material.color); //青色に変更 myCube.renderer.material.color = Color.blue; //変更後の色コンソールに出力 Debug.Log(myCube.renderer.material.color); } // Update is called once per frame void Update () { } }
コメントをかく