コード例 #1
0
                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());
                        }
                    }
                }
コード例 #2
0
                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);
                }
コード例 #3
0
                public override void OnDoubleClick()
                {
                    StateMachineEditor editor = (StateMachineEditor)GetEditor();

                    editor.ShowStateDetails(GetStateId());
                }