Ejemplo n.º 1
0
        public static void BeginInspectorGUI(ref string name, string style = "IN BigTitle", float width = 100f)
        {
            GUILayout.BeginVertical(style);
            EditorGUIUtility.labelWidth = width;

            if (BehaviorTreeEditorUtility.DrawHeader("Default", false))
            {
                GUILayout.BeginHorizontal();
                GUILayout.Space(7f);
                name = EditorGUILayout.TextField("Name", name);
                GUILayout.EndHorizontal();
            }
        }
Ejemplo n.º 2
0
        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 (BehaviorTreeEditorUtility.DrawHeader("Decorators", false))
                {
                    DrawMethods(decos);
                }
            }
            if (servs.Count > 0)
            {
                if (BehaviorTreeEditorUtility.DrawHeader("Services", false))
                {
                    DrawMethods(servs);
                }
            }
            if (tasks.Count > 0)
            {
                if (BehaviorTreeEditorUtility.DrawHeader("Tasks", false))
                {
                    DrawMethods(tasks);
                }
            }
            if (created)
            {
                CreatePrefab(type, "Code Pack");
            }
        }