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);
        }
예제 #2
0
 public void SaveAndOpen(string path = null)
 {
     if (path == null || path == "")
     {
         path = openPath;
     }
     MeshEngine.Mesh mesh = Meshes.GetSelectedMesh();
     unsavedPanel.SetVisible(false);
     mesh.Save();
     OpenWithoutSave(path);
 }
예제 #3
0
 protected override void BuildPrimitiveController()
 {
     if (primitiveControllerInstance == null)
     {
         BuildPrimitiveController <BoxSelectionController>();
         MeshEngine.Mesh        mesh = Meshes.GetSelectedMesh();
         BoxSelectionController boxSelectionController = primitiveControllerInstance.GetComponent <BoxSelectionController>();
         boxSelectionController.realMesh = mesh;
         boxSelectionController.CreateMesh();
     }
 }
예제 #4
0
 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;
     }
 }
예제 #5
0
 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);
 }
예제 #6
0
 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);
     }
 }
예제 #7
0
 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);
 }
예제 #8
0
 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);
     }
 }
예제 #9
0
 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);
 }