示例#1
0
        public static StateTimelineEditorWindow OpenWindow(StateTimeline stateTimeline)
        {
            StateTimelineEditorWindow wnd = CreateWindow <StateTimelineEditorWindow>();

            wnd.titleContent  = new GUIContent("AttackTimeline");
            wnd.minSize       = new Vector2(400, 300);
            wnd.stateTimeline = stateTimeline;
            wnd.RefreshAll(true);
            return(wnd);
        }
        public override void OnInspectorGUI()
        {
            StateTimeline st = (StateTimeline)target;

            base.OnInspectorGUI();
            if (GUILayout.Button("Open Editor"))
            {
                currentTimeline = StateTimelineEditorWindow.OpenWindow(st);
                currentTimeline.RefreshAll();
            }

            if (GUI.changed)
            {
                if (currentTimeline)
                {
                    currentTimeline.RefreshFrameBars();
                }
            }
        }