private void OnGUIFSMState() { if (m_curFsmStateSet == null) { return; } EditorGUILayout.BeginVertical("box", GUILayout.MinWidth(200), GUILayout.MinHeight(200)); { GUILayout.Label("State List", EditorStyles.boldLabel); m_stateScrollPosition = GUILayout.BeginScrollView(m_stateScrollPosition); { var stateElementList = m_curFsmStateSet.stateElementList; for (int i = 0; i < stateElementList.Count; ++i) { string name = stateElementList[i].StateName; bool selected = i == m_selectedStateIndex; EditorGUIUtil.Label(name, selected, 0, 2, EditorGUIUtil.GetSelectedTextColorByEditorSkin(selected)); if (EditorGUIEventUtil.IsLastRectClicked()) { SelectState(i); } } } GUILayout.EndScrollView(); } EditorGUILayout.EndVertical(); }
private void OnGUICharacterViewInfoList() { GUI.enabled = Application.isPlaying; EditorGUILayout.BeginVertical("box"); { GUI.color = Color.cyan; eActorEditorType newState = (eActorEditorType)GUILayout.Toolbar((int)m_actorEditorType, System.Enum.GetNames(typeof(eActorEditorType))); GUI.color = Color.white; if (m_actorEditorType != newState) { m_actorEditorType = newState; RefreshCharacterList(); } m_lookDBInfoScrollPosition = EditorGUILayout.BeginScrollView(m_lookDBInfoScrollPosition, GUILayout.MinHeight(160)); { for (int i = 0; i < m_actorInfoList.Count; ++i) { BaseEntityInfo actorInfo = m_actorInfoList[i]; bool selected = i == GetSelectedLookIndex(m_actorEditorType); EditorGUIUtil.Label(actorInfo.Name, selected, 0, 2, EditorGUIUtil.GetSelectedTextColorByEditorSkin(selected)); if (EditorGUIEventUtil.IsLastRectClicked()) { CreateActorBySelectLookID(i, m_actorEditorType); } } } EditorGUILayout.EndScrollView(); GUI.enabled = true; string play = Application.isPlaying == false ? "Play" : "Stop"; Color color = Application.isPlaying == false ? Color.green : Color.red; GUI.color = color; if (GUILayout.Button(play, GUILayout.Height(25))) { playLookDeveloper = true; } GUI.color = Color.white; } EditorGUILayout.EndVertical(); }
private void OnGUIFSMTransition() { if (m_selectFsmStateElement == null) { return; } GUILayout.BeginVertical("box", GUILayout.MinHeight(200)); { GUILayout.Label("State Transition", EditorStyles.boldLabel); m_actorFsmStateTransitionScrollPosition = GUILayout.BeginScrollView(m_actorFsmStateTransitionScrollPosition); { for (int i = 0; i < m_selectFsmStateElement.LstGlobalTransition.Count; ++i) { string name = m_selectFsmStateElement.LstGlobalTransition[i]; bool selected = i == m_selectedStateTransitionIndex; EditorGUIUtil.Label(name, selected, 0, 2, selected ? Color.green : Color.red); if (EditorGUIEventUtil.IsLastRectClicked()) { SelectStateTransition(i); } } for (int i = 0; i < m_selectFsmStateElement.LstTransition.Count; ++i) { string name = m_selectFsmStateElement.LstTransition[i]; bool selected = i == m_selectedStateTransitionIndex; EditorGUIUtil.Label(name, selected, 0, 2, EditorGUIUtil.GetSelectedTextColorByEditorSkin(selected)); if (EditorGUIEventUtil.IsLastRectClicked()) { SelectStateTransition(i); } } } GUILayout.EndScrollView(); } GUILayout.EndVertical(); }