初Unity記事。
最近始めました。主にJavascript&Webから離れたかったので。まだまだ好きですよ?
とりあえずUnityはC#で行きます
GUI.Colorについて。
void OnGUI(){ // 中央に置く。 if(GUI.Button(new Rect (Screen.width / 2 - 50, Screen.height /2 -20, 100, 20), "center")) { Debug.Log ("center"); } // デフォルトカラー if (GUI.Button (new Rect (Screen.width / 2 - 105, Screen.height -30, 100, 20), "test")) { Debug.Log ("test"); } // 黄色に GUI.color = Color.yellow; if (GUI.Button (new Rect (Screen.width / 2 + 5, Screen.height -30, 100, 20), "test")) { Debug.Log ("test"); } // 戻す。 // デフォルトカラーは白らしい。ちょっと探して見つからなかったので適当にやったら戻った。なんかあるかもしれない。 GUI.color = Color.white; if (GUI.Button (new Rect (Screen.width / 2 + 110, Screen.height -30, 100, 20), "test")) { Debug.Log ("test"); } } }