コード例 #1
0
 public void RedoAll()
 {
     P3dStateManager.RedoAll();
 }
コード例 #2
0
        protected override void OnInspector()
        {
            var paintables        = FindObjectsOfType <P3dPaintable>();
            var paintableTextures = FindObjectsOfType <P3dPaintableTexture>();

            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);
            EditorGUI.BeginDisabledGroup(P3dStateManager.CanUndo == false);
            if (GUILayout.Button(new GUIContent("◄", "Undo"), EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                P3dStateManager.UndoAll();
            }
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(P3dStateManager.CanRedo == false);
            if (GUILayout.Button(new GUIContent("►", "Redo"), EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                P3dStateManager.RedoAll();
            }
            EditorGUI.EndDisabledGroup();

            if (GUILayout.Toggle(currentPage == PageType.Scene, "Scene", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                currentPage = PageType.Scene; selectingTool = selectingMaterial = selectingShape = false;
            }

            if (GUILayout.Toggle(currentPage == PageType.Camera, "Camera", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                currentPage = PageType.Camera;
            }

            if (GUILayout.Toggle(currentPage == PageType.Paint, "Paint", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                currentPage = PageType.Paint;
            }

            if (GUILayout.Toggle(currentPage == PageType.Config, "Config", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)) == true)
            {
                currentPage = PageType.Config;
            }

            EditorGUILayout.Separator();
            EditorGUILayout.EndHorizontal();

            EditorGUILayout.Separator();

            if (Application.isPlaying == true)
            {
                if (Settings.CurrentTool == null && P3dTool.CachedTools.Count > 0)
                {
                    Settings.CurrentTool = P3dTool.CachedTools[0];
                }

                if (Settings.CurrentMaterial == null && P3dMaterial.CachedMaterials.Count > 0)
                {
                    Settings.CurrentMaterial = P3dMaterial.CachedMaterials[0];
                }

                if (Settings.CurrentShape == null && P3dShape.CachedShapes.Count > 0)
                {
                    Settings.CurrentShape = P3dShape.CachedShapes[0];
                }
            }
            else
            {
                ClearMaterial();
                ClearTool();
            }

            switch (currentPage)
            {
            case PageType.Scene:
            {
                DrawSceneTab(paintables, paintableTextures);
            }
            break;

            case PageType.Camera:
            {
                DrawCameraTab();
            }
            break;

            case PageType.Paint:
            {
                DrawPaintTab();
            }
            break;

            case PageType.Config:
            {
                DrawConfigTab();
            }
            break;
            }
        }