Exemplo n.º 1
0
        public bool Inspect()
        {
            var changed = false;

            EditableMesh.inspected = editedMesh;

            pegi.nl();

            target.PreviewShaderToggleInspect().changes(ref changed);

            if (!target.NotUsingPreview && "preview".select(45, ref MeshShaderMode.selected, MeshShaderMode.AllModes).nl(ref changed))
            {
                MeshShaderMode.ApplySelected();
            }

            var previousTool = MeshTool;

            if ("tool:".select_Index(35, ref Cfg.meshTool, MeshToolBase.AllTools).changes(ref changed))
            {
                Grid.vertexPointMaterial.SetColor("_Color", MeshTool.VertexColor);
                previousTool.OnDeSelectTool();
                MeshTool.OnSelectTool();
            }


            if (DocsEnabled && pegi.FullWindowService.DocumentationClick("About {0} tool".F(MeshTool.NameForDisplayPEGI())))
            {
                pegi.FullWindowService.DocumentationOpen(MeshTool.Tooltip + (MeshTool.ShowGrid ? GridNavigator.ToolTip : ""));
            }

            if (target.skinnedMeshRenderer)
            {
                pegi.FullWindowService.WarningDocumentationClickOpen
                    ("When using Skinned Mesh Renderer, the mesh will be transformed by it, so mesh points will not be in the correct position, and it is impossible to do any modifications on mesh with the mouse. It is still possible to do automatic processes like " +
                    "changing mesh profile and everything that doesn't require direct input from mouse over the object. It is recommended to edit the object separately from the skinned mesh."
                    , "Skinned mesh detected");
            }

            pegi.nl();



            var mt = MeshTool;

            mt.Inspect().nl(ref changed);

            foreach (var p in CameraModuleBase.MeshToolPlugins)
            {
                p.MeshToolInspection(mt).nl(ref changed);
            }

            pegi.nl();

            Grid.vertexPointMaterial.SetColor("_Color", MeshTool.VertexColor);


            EditableMesh.inspected = null;

            if (changed)
            {
                MeshTool.SetShaderKeywords();
            }

            return(changed);
        }