public override void DrawLabel(GUIStyle style) { EventGoToState evnt = (EventGoToState)GetEditableObject(); GUIContent labelContent = new GUIContent(kLabelText); Vector2 labelSize = style.CalcSize(labelContent); Rect labelRect = new Rect(0, 1, labelSize.x, labelSize.y); GUI.Label(labelRect, labelContent, style); GUIContent buttonContent = new GUIContent(evnt._state.GetStateName()); Vector2 buttonSize = style.CalcSize(buttonContent) + kButtonPadding; Rect buttonRect = new Rect(labelSize.x, 1, buttonSize.x, buttonSize.y); if (GUI.Button(buttonRect, evnt._state.GetStateName())) { StateMachineEditor stateMachineEditor = GetTimelineEditor().GetParent() as StateMachineEditor; if (stateMachineEditor != null) { stateMachineEditor.ShowStateDetails(evnt._state.GetStateID()); } } }
public override bool RenderObjectProperties(GUIContent label) { bool dataChanged = false; dataChanged |= RenderStateDescriptionField(); dataChanged |= RenderStateColorField(); if (GUILayout.Button("Edit Timeline")) { StateMachineEditor timelineStateMachineEditor = (StateMachineEditor)GetEditor(); timelineStateMachineEditor.ShowStateDetails(GetEditableObject()._stateId); } return(dataChanged); }
public override void OnDoubleClick() { StateMachineEditor editor = (StateMachineEditor)GetEditor(); editor.ShowStateDetails(GetStateId()); }