This file contains hidden or 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 UnityEditor; | |
public class AssetTypeCheckerWindow : EditorWindow | |
{ | |
Object obj; | |
string msg; | |
[MenuItem("Window/AssetType Checker")] | |
static void Init() |
This file contains hidden or 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(); // 値変更禁止エリア ここまで |
NewerOlder