GUIContent GetLayerLabel()
        {
            string label = currentLayer.GetType().Name;

            if (Application.isPlaying)
            {
                Type[]   activeStateTypes = currentLayer.GetActiveStates().GetTypes();
                string[] activeStateNames = new string[activeStateTypes.Length];
                for (int j = 0; j < activeStateNames.Length; j++)
                {
                    activeStateNames[j] = StateMachineUtility.FormatState(activeStateTypes[j], currentLayer);
                }

                label += " (" + activeStateNames.Concat(", ") + ")";
            }

            return(label.ToGUIContent());
        }
示例#2
0
        GUIContent GetLayerLabel(StateLayer layer)
        {
            string label = layer.GetType().Name;

            if (Application.isPlaying && PrefabUtility.GetPrefabType(machine) != PrefabType.Prefab)
            {
                IState[] activeStates     = layer.GetActiveStates();
                string[] activeStateNames = new string[activeStates.Length];

                for (int i = 0; i < activeStateNames.Length; i++)
                {
                    activeStateNames[i] = activeStates[i] is IStateLayer ? activeStates[i].GetType().Name.Split('.').Last() : StateMachineUtility.FormatState(activeStates[i].GetType(), layer);
                }

                label += " (" + activeStateNames.Concat(", ") + ")";
            }

            return(label.ToGUIContent());
        }
        GUIContent GetLayerLabel(StateLayer layer)
        {
            string label = layer.GetType().Name;

            if (Application.isPlaying && PrefabUtility.GetPrefabType(machine) != PrefabType.Prefab)
            {
                IState[] activeStates = layer.GetActiveStates();
                string[] activeStateNames = new string[activeStates.Length];

                for (int i = 0; i < activeStateNames.Length; i++)
                    activeStateNames[i] = activeStates[i] is IStateLayer ? activeStates[i].GetTypeName() : StateMachineUtility.FormatState(activeStates[i].GetType(), layer);

                label += " (" + activeStateNames.Concat(", ") + ")";
            }

            return label.ToGUIContent();
        }