public void Start() { ITool curTool = CC.ActiveContext.ToolManager.ActiveRightTool; if (curTool == null) { return; } Tool = curTool as MeshEditorTool; if (Tool == null) { return; } ActiveParameterSet = Tool.Parameters; deleteTri = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteTriangleButton", () => { clear_selection(); set_selection(deleteTri, MeshEditorTool.EditOperations.DeleteTriangle); }); deleteEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteEdgeButton", () => { clear_selection(); set_selection(deleteEdge, MeshEditorTool.EditOperations.DeleteEdge); }); deleteVtx = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteVertexButton", () => { clear_selection(); set_selection(deleteVtx, MeshEditorTool.EditOperations.DeleteVertex); }); deleteComponent = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteComponentButton", () => { clear_selection(); set_selection(deleteComponent, MeshEditorTool.EditOperations.DeleteComponent); }); deleteRing = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "DeleteRingButton", () => { clear_selection(); set_selection(deleteRing, MeshEditorTool.EditOperations.DeleteBorderRing); }); collapseEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "CollapseButton", () => { clear_selection(); set_selection(collapseEdge, MeshEditorTool.EditOperations.CollapseEdge); }); flipEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "FlipButton", () => { clear_selection(); set_selection(flipEdge, MeshEditorTool.EditOperations.FlipEdge); }); splitEdge = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "SplitButton", () => { clear_selection(); set_selection(splitEdge, MeshEditorTool.EditOperations.SplitEdge); }); pokeFace = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "PokeTriangleButton", () => { clear_selection(); set_selection(pokeFace, MeshEditorTool.EditOperations.PokeTriangle); }); bridgeEdges = UnityUIUtil.FindButtonAndAddClickHandler(this.gameObject, "BridgeButton", () => { clear_selection(); set_selection(bridgeEdges, MeshEditorTool.EditOperations.BridgeEdges); }); allowBackface = UnityUIUtil.FindToggleAndConnectToSource(this.gameObject, "BackfaceToggle", () => { return(ActiveParameterSet.GetValueBool("allow_backface_hits")); }, (boolValue) => { ActiveParameterSet.SetValue("allow_backface_hits", boolValue); }); set_selection(deleteTri, MeshEditorTool.EditOperations.DeleteTriangle); }
public static void OnApply_MeshEditorTool(MeshEditorTool tool, DMeshSO previewSO) { replace_single(tool.Target, previewSO); CC.ActiveScene.RemoveSceneObject(previewSO, true); CC.ActiveScene.History.PushInteractionCheckpoint(); }