Created
January 21, 2015 15:20
-
-
Save rainbow23/5f400bf38da6fa9aa220 to your computer and use it in GitHub Desktop.
EditorScript : FunctionManagerのメソッドを一つだけ選ぶ仕組み。
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEditor; | |
[CustomEditor(typeof(FunctionManager))] | |
[CanEditMultipleObjects] | |
public class FunctionManagerEditor : Editor { | |
public override void OnInspectorGUI() { | |
//Debug.Log("OnInspectorGUI"); | |
//DrawDefaultInspector(); | |
FunctionManager obj = target as FunctionManager; | |
obj.funcType = (FunctionManager.FuncType)EditorGUILayout.EnumPopup( "FuncType", obj.funcType ); | |
if(obj.funcType == FunctionManager.FuncType.HelpFunc) | |
{ | |
//EditorGUILayout.BeginHorizontal(); // arrange value in the horizontal | |
obj.helpGameObj = (GameObject)EditorGUILayout.ObjectField( "Help Obj", obj.helpGameObj, typeof( GameObject ), true ); | |
obj.showHelp = EditorGUILayout.Toggle("Show/Hide", obj.showHelp); | |
//EditorGUILayout.EndHorizontal(); | |
} | |
EditorUtility.SetDirty(obj); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment