protected override void HandleTriggerDown(Transform controller, int controllerIndex) { MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); Vector3 position = Settings.SnapEnabled() ? Snap.WorldPosition(mesh.transform, controller.position) : controller.position; mesh.vertices.CreateAndAddVertexInstanceByWorldPosition(position); }
public void SaveAndOpen(string path = null) { if (path == null || path == "") { path = openPath; } MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); unsavedPanel.SetVisible(false); mesh.Save(); OpenWithoutSave(path); }
protected override void BuildPrimitiveController() { if (primitiveControllerInstance == null) { BuildPrimitiveController <BoxSelectionController>(); MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); BoxSelectionController boxSelectionController = primitiveControllerInstance.GetComponent <BoxSelectionController>(); boxSelectionController.realMesh = mesh; boxSelectionController.CreateMesh(); } }
protected void BuildPrimitiveController <T>() where T : PrimitiveBaseController { if (primitiveControllerInstance == null) { primitiveControllerInstance = Instantiate(GetPrimitivePrefab(), controller.position, controller.rotation); MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); primitiveControllerInstance.transform.parent = mesh.gameObject.transform; primitiveControllerInstance.GetComponent <T>().mesh = mesh; hasInitialized = true; } }
public void SaveAs(string path, Transform controller, int controllerIndex) { Debug.Log("FileManager.SaveAs"); MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); mesh.selection.ClearSelectedVertices(); mesh.vertices.DeleteVertexInstances(); mesh.triangles.DeleteTriangleInstances(); mesh.persistence.Save(path); PanelManager.HideAllPanels(null); notificationPanel.DisplayMessage("Saved", controller, controllerIndex); Mode.SetMode(Mode.mode); }
public void Save(string path, Transform controller, int controllerIndex) { MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); if (mesh.persistence.HasSavedOrLoaded()) { mesh.persistence.Save(); notificationPanel.DisplayMessage("Saved", controller, controllerIndex); } else { saveAsPanel.SetVisible(true, controller, controllerIndex); } }
public void OpenWithoutSave(string path = null) { if (path == null || path == "") { path = openPath; } MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); PanelManager.HideAllPanels(null); mesh.selection.ClearSelectedVertices(); mesh.vertices.DeleteVertexInstances(); mesh.triangles.DeleteTriangleInstances(); mesh.persistence.Load(path); Mode.SetMode(Mode.mode); }
public void Open(string path, Transform controller, int controllerIndex) { Debug.Log("FileManager.Open"); MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); if (mesh.persistence.changedSinceLastSave) { openPath = path; unsavedPanel.SetVisible(true, controller, controllerIndex); } else { OpenWithoutSave(path); } }
protected override void ClickHandler(Transform controller, int controllerIndex) { MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); mesh.ResetTransform(); }
public override void OnGrabStart(Transform controller, int controllerIndex) { base.OnGrabStart(controller, controllerIndex); MeshEngine.Mesh mesh = Meshes.GetSelectedMesh(); mesh.GetComponent <MeshInputController>().OnGrabStart(controller, controllerIndex); }