Пример #1
0
        public override bool MouseEventPointedVertex()
        {
            if (EditorInputManager.GetMouseButtonDown(0))
            {
                MeshMGMT.AssignSelected(PointedUv); //pointedUV.editedUV = meshMGMT.selectedUV.editedUV;
                _lastCalculatedUv = PointedUv.EditedUv;
                MeshMGMT.Dragging = true;
            }

            /*
             * if (EditorInputManager.GetMouseButtonDown(0))
             * {
             *  if ((meshMGMT.selectedUV != null) && (meshMGMT.pointedUV != null))
             *  {
             *      meshMGMT.pointedUV.editedUV = meshMGMT.selectedUV.editedUV;
             *      mesh.dirty = true;
             *  }
             * }
             *
             * if ((EditorInputManager.GetMouseButtonDown(1)) && (meshMGMT.pointedUV != null) && (UVnavigator.inst() != null))
             *  UVnavigator.inst().CenterOnUV(meshMGMT.pointedUV.editedUV);
             */
            /*
             * if (ProjectionUV && EditorInputManager.GetMouseButton(0)) {
             * Vector3 trgPos = meshMGMT.target.transform.position;
             * float portion = 1f / Mathf.Max(0.01f, MeshUVprojectionSize);
             *
             * Vector2 nuv = PosToUV((vertex.worldPos - trgPos) * portion);
             *
             * for (int i = 0; i < vertex.shared_v2s.Count; i++)
             *  vertex.shared_v2s[i][meshMGMT.editedUV] = nuv;
             * }
             */
            return(false);
        }
Пример #2
0
        public override bool MouseEventPointedLine()
        {
            var a = PointedLine.points[0];
            var b = PointedLine.points[1];

            MeshMGMT.AssignSelected(
                Vector3.Distance(MeshMGMT.collisionPosLocal, a.LocalPos) <
                Vector3.Distance(MeshMGMT.collisionPosLocal, b.LocalPos)
                    ? EditedMesh.GetUvPointAFromLine(a.meshPoint, b.meshPoint)
                    : EditedMesh.GetUvPointAFromLine(b.meshPoint, a.meshPoint));

            return(false);
        }
Пример #3
0
        public override bool MouseEventPointedLine()
        {
            Vertex a = PointedLine.pnts[0];
            Vertex b = PointedLine.pnts[1];

            if (Vector3.Distance(MeshMGMT.collisionPosLocal, a.Pos) < Vector3.Distance(MeshMGMT.collisionPosLocal, b.Pos))
            {
                MeshMGMT.AssignSelected(EditedMesh.GetUVpointAFromLine(a.meshPoint, b.meshPoint));
            }
            else
            {
                MeshMGMT.AssignSelected(EditedMesh.GetUVpointAFromLine(b.meshPoint, a.meshPoint));
            }

            return(false);
        }