private void OnGUI()
        {
            GUI.DrawTexture(leftSpace, GUIResources.GetMediumTexture_1());
            GUI.DrawTexture(middleSpace, GUIResources.GetGraphSpaceTexture());
            GUI.DrawTexture(rightSpace, GUIResources.GetMediumTexture_1());


            FitRects();
            Resizing(Event.current);

            leftWidthFactor  = leftSpace.width / this.position.width;
            rightWidthFactor = rightSpace.width / this.position.width;

            Event e = Event.current;

            graphSpace.Draw(middleSpace);
            DrawLeftSpace(e);
            DrawRightSpace(e);

            graphSpace.UserInput(e, middleSpace, this);

            if (animator != null)
            {
                EditorUtility.SetDirty(animator);
            }
        }
Beispiel #2
0
 private void DrawTexturesInRects()
 {
     GUI.DrawTexture(creatorPlacing, GUIResources.GetDarkTexture());
     GUI.DrawTexture(creatorTypeSelecting, GUIResources.GetGraphSpaceTexture());
     GUI.DrawTexture(elementsListSection, GUIResources.GetMediumTexture_2());
     GUI.DrawTexture(elementOptionsSection, GUIResources.GetMediumTexture_1());
 }
        private void OnGUI()
        {
            Event e = Event.current;

            GUI.DrawTexture(leftSpace, GUIResources.GetMediumTexture_1());
            GUI.DrawTexture(rightSpace, GUIResources.GetMediumTexture_2());

            FitRects();
            ResizeRects(e);

            resizeFactor = leftSpace.width / this.position.width;

            DoLayoutLeftMenu(e);
            DoLayoutRightMenu(e);

            AnimationPlaying();
            OnCurrentAnimationTimeChange();


            if (editedData != null)
            {
                EditorUtility.SetDirty(editedData);
                Undo.RecordObject(editedData, "MM_Data editor Change");
            }
        }
        public void Draw(Rect rect, ref float resizeFactor, EditorWindow window)
        {
            GUI.DrawTexture(rect, GUIResources.GetMediumTexture_1());
            GUILayout.BeginArea(rect);

            if (animator != null)
            {
                GUILayout.Space(5);
                GUILayout.BeginHorizontal();

                if (GUILayout.Button("<", GUILayout.Width(20)))
                {
                    foldSpace    = true;
                    foldingSpeed = resizeFactor / 2f;
                }

                GUILayout.Space(5);

                toolbarOption = GUILayout.Toolbar(toolbarOption, toolBarStrings);

                if (foldSpace)
                {
                    resizeFactor -= (foldingSpeed * Time.deltaTime);
                    resizeFactor  = Mathf.Clamp(resizeFactor, 0f, float.MaxValue);
                    window.Repaint();
                    if (resizeFactor == 0)
                    {
                        foldSpace = false;
                    }
                }
                GUILayout.EndHorizontal();

                GUILayout.Space(5);

                scroll = EditorGUILayout.BeginScrollView(scroll);
                switch (toolbarOption)
                {
                case 0:
                    DrawLayers(rect, ref window);
                    break;

                case 1:
                    DrawValues();
                    break;
                }

                EditorGUILayout.EndScrollView();
            }

            GUILayout.EndArea();
        }