Пример #1
0
        public void Init(DSMObject a_Parent, DSMState a_From, DSMState a_To, string a_DisplayName = null)
        {
            m_Parent = a_Parent;

            m_DisplayName = a_DisplayName;

            m_From = a_From;
            m_To   = a_To;

            name = m_From.displayName + " -> " + m_To.displayName;
        }
Пример #2
0
        public void Init(
            DSMObject a_Parent,
            string a_DisplayName,
            Vector2 a_Position,
            StateAttribute a_Attribute,
            AllowedTransitionType a_AllowedTransitions = AllowedTransitionType.All,
            int a_MaxTransitions = -1)
        {
            m_Parent = a_Parent;

            name          = a_DisplayName;
            m_DisplayName = a_DisplayName;

            position = a_Position;

            m_Attribute = a_Attribute;
            m_AllowedTransitionTypes = a_AllowedTransitions;

            m_MaxTransitions = a_MaxTransitions;
        }
        public override void OnInspectorGUI()
        {
            DrawDefaultInspector();
            serializedObject.Update();
            {
                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.PrefixLabel(m_DisplayName.displayName);
                    m_DisplayName.stringValue = EditorGUILayout.DelayedTextField(m_DisplayName.stringValue);
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                {
                    EditorGUILayout.PrefixLabel(m_Tag.displayName);
                    m_Tag.stringValue = EditorGUILayout.DelayedTextField(m_Tag.stringValue);
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
                if (GUILayout.Button("Delete This State"))
                {
                    DSMObject parent = serializedObject.FindProperty("m_Parent").objectReferenceValue as DSMObject;
                    parent.RemoveState(m_State);
                }

                EditorGUILayout.Space();
                m_ReorderableList.DoLayoutList();
                EditorGUILayout.Space();
            }
            if (m_State == null)
            {
                return;
            }

            serializedObject.ApplyModifiedProperties();

            m_State.name = m_DisplayName.stringValue;
        }
Пример #4
0
        void OnEnable()
        {
            DSMEditorWindow.repaintEvent += Repaint;

            m_DSMObject = target as DSMObject;
        }