/// <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(12); m_ChangeName = EditorGUILayout.TextField("Alias Name: ", m_ChangeName); GUILayout.Space(15); GUILayout.BeginHorizontal(""); if (GUILayout.Button("Rename")) { editorRenameState renameState = (editorRenameState)m_CurrentState; stateEditorUtils.SelectedNode.WindowStateAlias = m_ChangeName; stateEditorUtils.SelectedNode.SaveMetaData(); renameState.ActionConfirmed = true; } GUILayout.Space(40); if (GUILayout.Button("Cancel")) { editorRenameState renameState = (editorRenameState)m_CurrentState; renameState.ActionCancelled = true; } GUILayout.EndHorizontal(); //GUI.DragWindow(); }
/// <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 editorRenameState theState = (editorRenameState)state; if (theState.ActionCancelled || theState.ActionConfirmed) { strOut = m_ChangeStateName; } return(strOut); }