示例#1
0
        void ShowSubLayer()
        {
            List <string> options = new List <string> {
                " "
            };

            options.AddRange(StateMachineUtility.LayerFormattedTypeDict.Keys);

            EditorGUILayout.BeginHorizontal();
            EditorGUI.indentLevel += 1;

            EditorGUILayout.LabelField("Sublayer Of", GUILayout.Width(100));

            EditorGUI.indentLevel -= 1;

            SubLayer = CustomEditorBase.Popup(SubLayer, options.ToArray(), GUIContent.none, GUILayout.MinWidth(150));

            EditorGUILayout.EndHorizontal();
        }
示例#2
0
        void ShowInherit()
        {
            List <string> options = new List <string> {
                "PStateLayer"
            };

            options.AddRange(StateMachineUtility.LayerFormattedTypeDict.Keys);

            EditorGUI.BeginChangeCheck();
            EditorGUILayout.BeginHorizontal();
            EditorGUI.indentLevel += 1;

            EditorGUILayout.LabelField("Inherits From", GUILayout.Width(100));

            EditorGUI.indentLevel -= 1;

            Inherit = CustomEditorBase.Popup(Inherit, options.ToArray(), GUIContent.none, GUILayout.MinWidth(150));

            EditorGUILayout.EndHorizontal();

            if (!initialized || EditorGUI.EndChangeCheck())
            {
                lockedStates = new List <string>();

                if (StateMachineUtility.LayerFormattedStateFormattedDict.ContainsKey(Inherit))
                {
                    lockedStates = StateMachineUtility.LayerFormattedStateFormattedDict[Inherit];

                    for (int i = lockedStates.Count - 1; i >= 0; i--)
                    {
                        if (!states.Contains(lockedStates[i]))
                        {
                            AddState(lockedStates[i]);
                        }

                        states.Move(states.IndexOf(lockedStates[i]), 0);
                    }
                }
            }
        }