コード例 #1
0
        public void Update()
        {
            Instance = this;

            InternalUiAnimationEditorSelection.Update();

            if (InternalUiAnimationEditorSelection.TargetGameObject == null)
            {
                return;
            }

            if (InternalUiAnimationEditorSelection.TargetAnimation == null)
            {
                return;
            }

            InternalUiAnimationEditorPlayer.Update();
            InternalUiAnimationEditorTimeline.Update();
            InternalUiAnimationEditorCanvas.Update();

            Repaint();
        }
コード例 #2
0
        private void OnGUI()
        {
            if (Application.isPlaying)
            {
                RenderPlayMode();
                return;
            }

            if (InternalUiAnimationEditorSelection.TargetGameObject == null)
            {
                RenderNoGameObject();
                return;
            }

            if (InternalUiAnimationEditorSelection.TargetAnimation == null)
            {
                RenderNoComponent();
                return;
            }

            if (Event.current.type == EventType.Repaint)
            {
                MousePosition.x = Event.current.mousePosition.x;
                MousePosition.y = Event.current.mousePosition.y;
            }

            if (Event.current.type == EventType.MouseDown)
            {
                MousePositionPress.x = Event.current.mousePosition.x;
                MousePositionPress.y = Event.current.mousePosition.y;
            }

            if (Event.current.type == EventType.MouseUp)
            {
                //MousePositionPress = Vector2.zero;
                //GUI.FocusControl(string.Empty);
            }

            if (Event.current.type == EventType.DragUpdated)
            {
                MouseDragFromScene = true;
            }

            if (Event.current.type == EventType.DragExited)
            {
                MouseDragFromScene = false;
            }

            if (MousePosition.x > InternalUiAnimationEditorInspector.Width && MousePosition.y > InternalUiAnimationEditorTimeline.Height)
            {
                DragAndDrop.visualMode = DragAndDropVisualMode.Generic;
            }

            InternalUiAnimationEditorTextures.Setup();

            InternalUiAnimationEditorTimeline.OnEvent();
            InternalUiAnimationEditorInspector.OnEvent();
            InternalUiAnimationEditorCanvas.OnEvent();

            InternalUiAnimationEditorTimeline.Render(InternalUiAnimationEditorInspector.Width, 0, InternalUiAnimationEditorTimeline.Width, InternalUiAnimationEditorTimeline.Height);
            InternalUiAnimationEditorInspector.Render(0, InternalUiAnimationEditorTimeline.Height, InternalUiAnimationEditorInspector.Width, WindowHeight);
            InternalUiAnimationEditorCanvas.Render(InternalUiAnimationEditorInspector.Width, InternalUiAnimationEditorTimeline.Height, InternalUiAnimationEditorCanvas.Width, WindowHeight - InternalUiAnimationEditorTimeline.Height);
        }