public override void OnInspectorGUI()
        {
            DSMTransition transition = target as DSMTransition;

            DrawDefaultInspector();
            serializedObject.Update();
            {
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.PrefixLabel(serializedObject.FindProperty("m_DisplayName").displayName);
                    serializedObject.FindProperty("m_DisplayName").stringValue =
                        EditorGUILayout.DelayedTextField(serializedObject.FindProperty("m_DisplayName").stringValue);
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
                if (GUILayout.Button("Delete This Transition"))
                {
                    transition.states.fromState.RemoveTransition(transition);
                }
            }
            if (transition == null)
            {
                return;
            }

            serializedObject.ApplyModifiedProperties();

            transition.name = transition.displayName;
        }
Beispiel #2
0
        public void AddToTransition(DSMTransition a_Transition)
        {
            if (a_Transition.states.fromState.attribute == StateAttribute.Entry)
            {
                m_Parent.entryPoint = this;
            }

            m_ToTransitions.Add(a_Transition);
        }
Beispiel #3
0
        public void OnTransitionDestroyed(DSMTransition a_DSMTransition)
        {
            if (m_FromTransitions.Contains(a_DSMTransition))
            {
                m_FromTransitions.Remove(a_DSMTransition);
            }

            if (m_ToTransitions.Contains(a_DSMTransition))
            {
                m_ToTransitions.Remove(a_DSMTransition);
            }
        }
        public bool Transition(string a_To)
        {
            if (m_DSMObject == null)
            {
                return(false);
            }

            DSMTransition transition = m_CurrentState.transitions.Find(x => x.states.toState.displayName == a_To) as DSMTransition;

            if (transition == null)
            {
                return(false);
            }

            var newCurrentState = transition.states.toState as DSMState;

            if (newCurrentState == null)
            {
                return(false);
            }

            m_CurrentState = newCurrentState;
            return(true);
        }