Exemplo n.º 1
0
        public static void Show(Actor.ActorComponent ac)
        {
            MutiSelectWiz window = EditorWindow.GetWindow <MutiSelectWiz>(true, "Add AC", true);

            window.inited = false;
            window.ac     = ac;
        }
Exemplo n.º 2
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;
            }
        }