コード例 #1
0
        /// <summary>
        /// Draws the "Display" window of this window.  Everything is active.
        /// </summary>
        /// <param name="id"></param>
        void DrawNodeWindow(int id)
        {
            Color backroundColor = new Color(1, 1, 1, 0.8f);
            Rect  rect           = new Rect(1, 17, WinRect.width - 2, WinRect.height - 19);

            EditorGUI.DrawRect(rect, backroundColor);
            GUILayout.Space(8);
            GUILayout.Label("Are you sure you want to delete: ", GUI.skin.name, null);
            GUILayout.Space(10);

            GUILayout.BeginHorizontal("");
            GUILayout.Label("      ", "", null);
            GUILayout.Label(m_StateToDeleteName, GUI.skin.textArea, null);
            GUILayout.Space(15);
            GUILayout.Label(" ", "", null);
            GUILayout.EndHorizontal();
            GUILayout.Space(10);

            GUILayout.BeginHorizontal("");
            if (GUILayout.Button("Delete"))
            {
                if (m_CurrentState is editorDeleteState)
                {
                    editorDeleteState deleteState = (editorDeleteState)m_CurrentState;
                    deleteState.ActionConfirmed = true;
                    stateEditorUtils.DeleteAndRemoveState(stateEditorUtils.SelectedNode, stateEditorUtils.SelectedNode.ClassName);
                }

                if (m_CurrentState is editorDeleteConditionState)
                {
                    editorDeleteConditionState deleteConditionState = (editorDeleteConditionState)m_CurrentState;
                    stateEditorUtils.DeleteAndRemoveConditonal(stateEditorUtils.DeleteConditionalClass);
                    deleteConditionState.ActionConfirmed = true;
                }
            }
            GUILayout.Space(35);
            if (GUILayout.Button("Cancel"))
            {
                if (m_CurrentState is editorDeleteState)
                {
                    editorDeleteState deleteState = (editorDeleteState)m_CurrentState;
                    deleteState.ActionCancelled = true;
                }

                if (m_CurrentState is editorDeleteConditionState)
                {
                    editorDeleteConditionState deleteConditionState = (editorDeleteConditionState)m_CurrentState;
                    deleteConditionState.ActionCancelled = true;
                }
            }
            GUILayout.EndHorizontal();

            GUI.DrawTexture(new Rect(m_TexturePosAndSize.x, m_TexturePosAndSize.y, m_TexturePosAndSize.z, m_TexturePosAndSize.w), m_ExclamtionTexture);

            //GUI.DragWindow();
        }
コード例 #2
0
        /// <summary>
        /// Test conditionals are placed here.
        /// </summary>
        /// <param name="state"></param>
        /// <returns>true or false depending if transition conditions are met.</returns>
        public override string UpdateConditionalTest(baseState state)
        {
            string strOut = null;

#if ARTIMECH_THIS_SHOULD_NEVER_BE_TRUE_BUT_IS_AN_EXAMPLE_OF_A_CONDITION_BEING_TRUE
            This is an example of setting a contition to true if the gameobject
            falls below a certain height ingame.
            if (state.m_GameObject.transform.position.y <= 1000)
            {
                strOut = m_ChangeStateName;
            }
#endif
            editorDeleteState theState = (editorDeleteState)state;
            if (theState.ActionCancelled || theState.ActionConfirmed)
            {
                strOut = m_ChangeStateName;
            }

            return(strOut);
        }
コード例 #3
0
        /// <summary>
        /// Draws the "Display" window of this window.  Everything is active.
        /// </summary>
        /// <param name="id"></param>
        void DrawNodeWindow(int id)
        {
            Color backroundColor = new Color(1, 1, 1, 0.8f);
            Rect  rect           = new Rect(1, 17, WinRect.width - 2, WinRect.height - 19);

            EditorGUI.DrawRect(rect, backroundColor);
            GUILayout.Space(8);
            GUILayout.Label("Are you sure you want to delete: ", GUI.skin.name, null);
            GUILayout.Space(10);

            GUILayout.BeginHorizontal("");
            GUILayout.Label("      ", "", null);
            GUILayout.Label(m_StateToDeleteName, GUI.skin.textArea, null);
            GUILayout.Space(15);
            GUILayout.Label(" ", "", null);
            GUILayout.EndHorizontal();
            GUILayout.Space(10);

            GUILayout.BeginHorizontal("");
            if (GUILayout.Button("Delete"))
            {
                /*
                 * editorRenameState renameState = (editorRenameState)m_CurrentState;
                 * stateEditorUtils.SelectedNode.WindowStateAlias = m_ChangeName;
                 * stateEditorUtils.SelectedNode.SaveMetaData();*/
                editorDeleteState deleteState = (editorDeleteState)m_CurrentState;
                deleteState.ActionConfirmed = true;
                stateEditorUtils.DeleteAndRemoveState(stateEditorUtils.SelectedNode, stateEditorUtils.SelectedNode.ClassName);
            }
            GUILayout.Space(35);
            if (GUILayout.Button("Cancel"))
            {
                editorDeleteState deleteState = (editorDeleteState)m_CurrentState;
                deleteState.ActionCancelled = true;
            }
            GUILayout.EndHorizontal();

            GUI.DrawTexture(new Rect(250, 30, 40, 40), m_ExclamtionTexture);

            //GUI.DragWindow();
        }