public static void ApplySelected() { if (selected == null) { selected = _allModes[0]; } foreach (MeshShaderMode s in _allModes) { QcUnity.SetShaderKeyword(s.value, selected == s); } }
public override bool Inspect() { var changed = false; EditableMesh.inspected = editedMesh; pegi.newLine(); target.PreviewShaderToggleInspect().changes(ref changed); if (!target.NotUsingPreview && "preview".select(45, ref MeshShaderMode.selected, MeshShaderMode.AllModes).changes(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.DocumentationClick("About {0} tool".F(MeshTool.NameForDisplayPEGI()))) { pegi.FullWindwDocumentationOpen(MeshTool.Tooltip + (MeshTool.ShowGrid ? GridNavigator.ToolTip : "")); } if (target.skinnedMeshRenderer) { ("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." ).fullWindowWarningDocumentationClickOpen("Skinned mesh detected"); } pegi.nl(); var mt = MeshTool; mt.Inspect().nl(ref changed); foreach (var p in PainterSystemManagerModuleBase.MeshToolPlugins) { p.MeshToolInspection(mt).nl(ref changed); } pegi.nl(); Grid.vertexPointMaterial.SetColor("_Color", MeshTool.VertexColor); EditableMesh.inspected = null; if (changed) { MeshTool.SetShaderKeywords(); } return(changed); }