public override void ManageDragging() { if (PointedTris != null && SelectedUV != null) { Vector2 uv = SelectedUV.SharedEditedUV; Vector2 posUV = PointedTris.LocalPosToEditedUV(MeshMGMT.collisionPosLocal); Vector2 newUV = uv * 2 - posUV; bool isChanged = newUV != lastCalculatedUV; lastCalculatedUV = newUV; if (isChanged && !EditorInputManager.GetMouseButtonUp(0)) { var prMesh = FreshPreviewMesh; if (prMesh.selectedUV != null) { prMesh.selectedUV.SharedEditedUV = lastCalculatedUV; MeshMGMT.target.meshFilter.sharedMesh = new MeshConstructor(prMesh, MeshMGMT.target.MeshProfile, MeshMGMT.target.meshFilter.sharedMesh).Construct(); } } } if (EditorInputManager.GetMouseButtonUp(0)) { MeshMGMT.SelectedUV.SharedEditedUV = lastCalculatedUV; EditedMesh.Dirty = true; MeshMGMT.Dragging = false; } if (!EditorInputManager.GetMouseButton(0)) { MeshMGMT.Dragging = false; } }
public override bool MouseEventPointedTriangle() { if (EditorInputManager.GetMouseButton(0)) { EditedMesh.Dirty |= PointedTris.SetSharpCorners(SetTo); } return(false); }
public override void KeysEventPointedTriangle() { if (KeyCode.Backspace.IsDown() || KeyCode.Delete.IsDown()) { MeshMGMT.edMesh.triangles.Remove(PointedTris); foreach (var uv in PointedTris.vertexes) { if (uv.meshPoint.uvpoints.Count == 1 && uv.tris.Count == 1) { EditedMesh.meshPoints.Remove(uv.meshPoint); } } MeshMGMT.edMesh.Dirty = true; return; } if (KeyCode.U.IsDown()) { PointedTris.MakeTriangleVertUnique(PointedUV); } /* if (KeyCode.N.isDown()) * { * * if (!EditorInputManager.getAltKey()) * { * int no = pointedTris.NumberOf(pointedTris.GetClosestTo(meshMGMT.collisionPosLocal)); * pointedTris.SharpCorner[no] = !pointedTris.SharpCorner[no]; * * (pointedTris.SharpCorner[no] ? "Triangle edge's Normal is now dominant" : "Triangle edge Normal is NO longer dominant").TeachingNotification(); * } * else * { * pointedTris.InvertNormal(); * "Inverting Normals".TeachingNotification(); * } * * meshMGMT.edMesh.dirty = true; * * }*/ }
public override bool MouseEventPointedTriangle() { if (EditorInputManager.GetMouseButton(0)) { if (MergeUnmerge) { if (EditorInputManager.getShiftKey()) { EditedMesh.Dirty |= PointedTris.SetAllVerticesShared(); } else { EditedMesh.Dirty |= EditedMesh.GiveTriangleUniqueVerticles(PointedTris); } } else { EditedMesh.Dirty |= PointedTris.SetSmoothVertices(!EditorInputManager.getShiftKey()); } } return(false); }
public override void KeysEventPointedTriangle() { if (KeyCode.N.IsDown()) { if (!EditorInputManager.getAltKey()) { int no = PointedTris.NumberOf(PointedTris.GetClosestTo(MeshMGMT.collisionPosLocal)); PointedTris.DominantCourner[no] = !PointedTris.DominantCourner[no]; #if !NO_PEGI (PointedTris.DominantCourner[no] ? "Triangle edge's Normal is now dominant" : "Triangle edge Normal is NO longer dominant").TeachingNotification(); #endif } else { PointedTris.InvertNormal(); #if !NO_PEGI "Inverting Normals".TeachingNotification(); #endif } MeshMGMT.edMesh.Dirty = true; } }