public static void BeginInspectorGUI(ref string name, ref string description, string style = "IN BigTitle", float width = 100f) { GUILayout.BeginVertical(style); EditorGUIUtility.labelWidth = width; if (BehaviorTreesEditorUtility.DrawHeader("Default", false)) { GUILayout.BeginHorizontal(); GUILayout.Space(7f); name = EditorGUILayout.TextField("Name", name); GUILayout.EndHorizontal(); if (string.IsNullOrEmpty(description) == false) { GUILayout.BeginHorizontal(); GUILayout.Space(7f); description = EditorGUILayout.TextArea(description, GUI.skin.textArea, GUILayout.Height(100f)); GUILayout.EndHorizontal(); } } }
private void CreateCodePack(System.Type type) { GUILayout.Label("Selected \"" + type.Name + "\"", "LODLevelNotifyText"); GUILayout.Space(6f); List <MethodInfo> decos = GetMethodInfos(type, typeof(bool)); List <MethodInfo> servs = GetMethodInfos(type, typeof(void)); List <MethodInfo> tasks = GetMethodInfos(type, typeof(System.IDisposable)); tasks.AddRange(GetMethodInfos(type, typeof(IEnumerator))); bool created = DrawCreateButton(!(decos.Count > 0) && !(decos.Count > 0) && !(tasks.Count > 0)); if (decos.Count > 0) { if (BehaviorTreesEditorUtility.DrawHeader("Decorators", false)) { DrawMethods(decos); } } if (servs.Count > 0) { if (BehaviorTreesEditorUtility.DrawHeader("Services", false)) { DrawMethods(servs); } } if (tasks.Count > 0) { if (BehaviorTreesEditorUtility.DrawHeader("Tasks", false)) { DrawMethods(tasks); } } if (created) { CreatePrefab(type, "Code Pack"); } }