예제 #1
0
        private void BasicInfo()
        {
            EditorGUILayout.BeginVertical(XXToolsEdGui.BoxStyle, GUILayout.Width(240));
            //curr.name = EditorGUILayout.TextField("Prefabs Name", curr.name);
            GUILayout.Label(curr.name, XXToolsEdGui.Head3Style);
            GUILayout.Space(10);
            GUILayout.Label("Actor Comp", XXToolsEdGui.Head4Style);

            XXToolsEdGui.BeginScrollView(scroll[1], GUILayout.MaxHeight(200));
            {
                for (int i = 0; i < curr.components.Count; i++)
                {
                    Actor.ActorComponent ac = curr.components[i];
                    EditorGUILayout.BeginHorizontal(GUILayout.Width(DatabaseEditor.LeftPanelWidth - 20), GUILayout.ExpandWidth(false));
                    {
                        if (XXToolsEdGui.ToggleButton(currAc == ac, ac.name, XXToolsEdGui.ButtonLeftStyle, GUILayout.Width(160), GUILayout.ExpandWidth(false)))
                        {
                            GUI.FocusControl("");
                            currAc = ac;
                        }
                        if (GUILayout.Button("X", XXToolsEdGui.ButtonRightStyle, GUILayout.Width(20)))
                        {
                            delAc = ac;
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
            }
            XXToolsEdGui.EndScrollView();
            EditorGUILayout.EndVertical();
        }
예제 #2
0
 void OnGUI()
 {
     if (!inited)
     {
         Init();
     }
     XXToolsEdGui.UseSkin();
     GUILayout.Space(10);
     scroll = XXToolsEdGui.BeginScrollView(scroll);
     {
         if (showList == null || showList.Length <= 0)
         {
             GUILayout.Label("No found", XXToolsEdGui.WarningLabelStyle);
         }
         else
         {
             foreach (string showItem in showList)
             {
                 GUILayout.Label(showItem, XXToolsEdGui.CenterLabelStyle);
             }
         }
     }
     XXToolsEdGui.EndScrollView();
     GUILayout.Space(10);
 }
예제 #3
0
        private void ComInfo()
        {
            EditorGUILayout.BeginVertical(XXToolsEdGui.BoxStyle, GUILayout.Width(300));
            GUILayout.Label(currAc.name, XXToolsEdGui.Head3Style);
            GUILayout.Space(10);
            EditorGUILayout.BeginHorizontal();
            GUILayout.Label("Can Swap", XXToolsEdGui.Head4Style);
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(new GUIContent("Add", XXToolsEdGui.Icon_Plus), EditorStyles.miniButtonLeft))
            {
                GUI.FocusControl("");
                MutiSelectWiz.Show(currAc);
            }

            EditorGUILayout.EndHorizontal();
            XXToolsEdGui.DrawHorizontalLine(1f, XXToolsEdGui.DividerColor);
            GUILayout.Space(7);
            XXToolsEdGui.BeginScrollView(scroll[1], GUILayout.MaxHeight(200));

            for (int i = 0; i < currAc.canSwapList.Count; i++)
            {
                string name = currAc.canSwapList[i];
                EditorGUILayout.BeginHorizontal(GUILayout.Width(DatabaseEditor.LeftPanelWidth - 20), GUILayout.ExpandWidth(false));
                {
                    if (XXToolsEdGui.ToggleButton(currName.Equals(name), name, XXToolsEdGui.ButtonLeftStyle, GUILayout.Width(160), GUILayout.ExpandWidth(false)))
                    {
                        GUI.FocusControl("");
                        currName = name;
                    }
                    if (GUILayout.Button("X", XXToolsEdGui.ButtonRightStyle, GUILayout.Width(20)))
                    {
                        delName = name;
                    }
                }
                EditorGUILayout.EndHorizontal();
            }


            XXToolsEdGui.EndScrollView();
            EditorGUILayout.EndVertical();

            if (delName != null)
            {
                if (currName.Equals(delName))
                {
                    curr = null;
                }
                currAc.canSwapList.Remove(delName);
                EditorUtility.SetDirty(ed.db);
                AssetDatabase.SaveAssets();
                AssetDatabase.Refresh();
                delName = null;
            }
        }
예제 #4
0
        //private void
        public void OnGUI()
        {
            if (!inited)
            {
                Init();
            }
            XXToolsEdGui.UseSkin();
            EditorGUILayout.BeginVertical();
            GUILayout.Space(10);
            string str = EditorGUILayout.TextField(filterStr);

            if (!str.Equals(filterStr)) //关键字改变,重新编列
            {
                filterStr = str;
                FindShowList();
            }
            GUILayout.Space(3);
            XXToolsEdGui.DrawHorizontalLine(1, XXToolsEdGui.DividerColor, 10, 10);
            scroll = XXToolsEdGui.BeginScrollView(scroll);

            //select = GUILayout.Toolbar(select,showList.ToArray(), XXToolsEdGui.ToolbarStyle);
            selecteds = XXToolsEdGui.MenuMutiSel(selecteds, showList.ToArray(), GUILayout.Width(250));

            XXToolsEdGui.EndScrollView();
            XXToolsEdGui.DrawHorizontalLine(1, XXToolsEdGui.DividerColor, 10, 10);
            GUILayout.Space(3);
            EditorGUILayout.EndVertical();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();


                if (GUILayout.Button("Select", XXToolsEdGui.ButtonStyle))
                {
                    FileInfo[] fileInfos = fileInfoList.ToArray();

                    //CreateActor(fileInfos[select]);
                    Select();
                    this.Close();
                }
                ;
                GUI.enabled = true;

                if (GUILayout.Button("Cancel", XXToolsEdGui.ButtonStyle))
                {
                    this.Close();
                }
                ;
                GUILayout.FlexibleSpace();
            }
            EditorGUILayout.EndHorizontal();
            GUILayout.Space(10);
        }
예제 #5
0
        private void FBXSetting()
        {
            EditorGUILayout.BeginVertical(GUILayout.MaxWidth(600));
            {
                GUILayout.Space(15);
                GUILayout.Label("Basic Setting", XXToolsEdGui.Head2Style);

                EditorGUILayout.Space();

                EditorGUILayout.BeginVertical(XXToolsEdGui.BoxStyle, GUILayout.MaxWidth(300));
                {
                    GUILayout.Label("PostProcess", XXToolsEdGui.Head4Style);
                    ModelImporterAnimationType selectType = (ModelImporterAnimationType)EditorGUILayout.EnumPopup("Animation Type", ed.db.animType);
                    if (selectType == ModelImporterAnimationType.Generic || selectType == ModelImporterAnimationType.Legacy)
                    {
                        ed.db.animType = selectType;
                    }
                    if (ed.db.animType == ModelImporterAnimationType.Generic)
                    {
                        ed.db.optiomaize = GUILayout.Toggle(ed.db.optiomaize, "Optiomaize");
                    }
                }
                EditorGUILayout.EndVertical();
                GUILayout.Space(15);
                GUILayout.Label("Actor Component", XXToolsEdGui.Head2Style);
                EditorGUILayout.BeginVertical(XXToolsEdGui.BoxStyle, GUILayout.MaxWidth(300));
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        GUILayout.Label("AC List", XXToolsEdGui.Head3Style);
                        GUILayout.Space(20);

                        if (XXToolsEdGui.IconButton("Refresh", XXToolsEdGui.Icon_Refresh, GUILayout.Width(100)))
                        {
                            LoadAC();
                        }

                        GUILayout.FlexibleSpace();
                    }
                    EditorGUILayout.EndHorizontal();
                    GUILayout.Space(20);
                    scroll[1] = XXToolsEdGui.BeginScrollView(scroll[1], XXToolsEdGui.ScrollViewNoTLMarginStyle, GUILayout.Height(275));
                    {
                        foreach (GameObject go in ed.db.actorComponesPrefabs)
                        {
                            EditorGUILayout.SelectableLabel(go.name, GUILayout.Height(30));
                        }
                    }
                    XXToolsEdGui.EndScrollView();
                }
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();
        }
예제 #6
0
        private void LeftPanel()
        {
            EditorGUILayout.BeginVertical(GUILayout.Width(DatabaseEditor.LeftPanelWidth));
            GUILayout.Space(5);
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.FlexibleSpace();
                if (GUILayout.Button(new GUIContent("Add Actors", XXToolsEdGui.Icon_Plus), EditorStyles.miniButtonLeft))
                {
                    GUI.FocusControl("");
                    //EditorUtility.OpenFilePanel("Select Scene", XXToolsEdUtil.FullProjectAssetsPath, "unity");
                    //TextInputWiz.Show("New Actor", "Enter name for new actor", "", CreateActor);
                    CreateActorWiz.Show();
                }
                GUI.enabled = true;
            }
            EditorGUILayout.EndHorizontal();
            EditorGUILayout.Space();

            scroll[0] = XXToolsEdGui.BeginScrollView(scroll[0], GUILayout.Width(DatabaseEditor.LeftPanelWidth));
            {
                if (ed.db.Actors.Length > 0)
                {
                    foreach (Actor actor in ed.db.Actors)
                    {
                        if (actor == null)
                        {
                            ed.db.actorsPrefabs = XXToolsEdUtil.CleanupList <GameObject>(ed.db.actorsPrefabs);
                            EditorUtility.SetDirty(ed.db);
                            AssetDatabase.SaveAssets();
                            GUIUtility.ExitGUI();
                            return;
                        }

                        EditorGUILayout.BeginHorizontal(GUILayout.Width(DatabaseEditor.LeftPanelWidth - 20), GUILayout.ExpandWidth(false));
                        {
                            if (XXToolsEdGui.ToggleButton(curr == actor, actor.name, XXToolsEdGui.ButtonLeftStyle, GUILayout.Width(160), GUILayout.ExpandWidth(false)))
                            {
                                GUI.FocusControl("");
                                curr   = actor;
                                currAc = null;
                                //GetCurrentEd();
                            }

                            //if (ed.db.Cameras.Length == 1) GUI.enabled = false; // can't allow deleting the camera if there is only one left since runtime depends on at least one being present
                            if (GUILayout.Button("X", XXToolsEdGui.ButtonRightStyle, GUILayout.Width(20)))
                            {
                                del = actor;
                            }
                        }
                        EditorGUILayout.EndHorizontal();
                    }
                }
                else
                {
                    GUILayout.Label("No Actors are defined.", XXToolsEdGui.WarningLabelStyle);
                }
            }
            XXToolsEdGui.EndScrollView();

            GUILayout.Space(3);
            EditorGUILayout.EndVertical();

            if (del != null)
            {
                if (curr == del)
                {
                    curr = null;
                }
                ed.db.actorsPrefabs.Remove(del.gameObject);
                EditorUtility.SetDirty(ed.db);
                AssetDatabase.SaveAssets();

                string path = AssetDatabase.GetAssetPath(del.gameObject);
                AssetDatabase.DeleteAsset(path);
                AssetDatabase.Refresh();
                del = null;
            }
        }