Last active
February 7, 2017 06:29
-
-
Save sokuhatiku/1f2fa8027dcf80e8d70ad9e36cb6eed6 to your computer and use it in GitHub Desktop.
description of code of create "Script" field
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
EditorGUI.BeginDisabledGroup(true); // ここからEndDisabledGroup()までの間にあるフィールドの値変更を禁止(trueで有効になる) | |
EditorGUILayout.ObjectField( // Objectを参照出来るフィールドを設置する関数 | |
"Script", // フィールド名 | |
MonoScript.FromMonoBehaviour((MonoBehaviour)target) , // 今回の要、MonoScriptオブジェクトを取得する | |
typeof(MonoScript), // Fieldが利用出来る型を制限する | |
false); // Hierarchyにあるオブジェクトを選択できるかどうか(今回は禁止) | |
EditorGUI.EndDisabledGroup(); // 値変更禁止エリア ここまで |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment