Пример #1
0
        public override void AssignText(MarkerWithText markers, PainterMesh.MeshPoint point)
        {
            var vrt = MeshMGMT.GetSelectedVertex();

            if (point.vertices.Count > 1 || vrt == point)
            {
                var tex = MeshEditorManager.target.meshRenderer.sharedMaterial.mainTexture;

                if (vrt == point)
                {
                    var   text  = (point.vertices.Count > 1) ? ((point.vertices.IndexOf(MeshMGMT.SelectedUv) + 1) + "/" + point.vertices.Count + (point.smoothNormal ? "s" : "")) : "";
                    float tSize = !tex ? 128 : tex.width;
                    text += ("uv: " + (MeshMGMT.SelectedUv.EditedUv.x * tSize) + "," + (MeshMGMT.SelectedUv.EditedUv.y * tSize));
                    markers.textm.text = text;
                }
                else
                {
                    markers.textm.text = point.vertices.Count +
                                         (point.smoothNormal ? "s" : "");
                }
            }
            else
            {
                markers.textm.text = "";
            }
        }
Пример #2
0
        public override void AssignText(MarkerWithText markers, PainterMesh.MeshPoint point)
        {
            var selected = MeshMGMT.GetSelectedVertex();

            if (point.vertices.Count > 1 || selected == point)
            {
                if (selected == point)
                {
                    markers.textm.text = (point.vertices.Count > 1) ? (
                        Path.Combine((point.vertices.IndexOf(MeshMGMT.SelectedUv) + 1).ToString(), point.vertices.Count +
                                     (point.smoothNormal ? "s" : ""))

                        ) : "";
                }
                else
                {
                    markers.textm.text = point.vertices.Count +
                                         (point.smoothNormal ? "s" : "");
                }
            }
            else
            {
                markers.textm.text = "";
            }
        }
Пример #3
0
        private void InitGridIfNull()
        {
            if (!Grid)
            {
                return;
            }

            if (!Grid.vertPrefab)
            {
                Grid.vertPrefab = Resources.Load(PainterDataAndConfig.PREFABS_RESOURCE_FOLDER + "/vertex") as GameObject;
            }

            if ((Grid.vertices == null) || (Grid.vertices.Length == 0) || (!Grid.vertices[0].go))
            {
                Grid.vertices = new MarkerWithText[verticesShowMax];

                for (int i = 0; i < verticesShowMax; i++)
                {
                    MarkerWithText v = new MarkerWithText();
                    Grid.vertices[i]      = v;
                    v.go                  = GameObject.Instantiate(Grid.vertPrefab);
                    v.go.transform.parent = Grid.transform;
                    v.Init();
                }
            }

            Grid.pointedVertex.Init();
            Grid.selectedVertex.Init();
        }
Пример #4
0
 public virtual void AssignText(MarkerWithText markers, PainterMesh.MeshPoint point) => markers.textm.text = "";