Beispiel #1
0
            private static UnityEngine.Mesh MakeDynamicMesh()
            {
                var result = new UnityEngine.Mesh();

                result.MarkDynamic();
                return(result);
            }
Beispiel #2
0
        public override void ApplyMeshData(bool removeFromMemory)
        {
            if (topologyCache != GetTopology() || numIndicesCache != indexCount || numVerticesCache != vertexCount)
            {
                unityMesh.Clear();

                topologyCache    = GetTopology();
                numIndicesCache  = indexCount;
                numVerticesCache = vertexCount;
            }

            if (IsDynamic())
            {
                unityMesh.MarkDynamic();
            }

            ApplyVertices();
            ApplyNormals();
            ApplyTextureCoordinates();
            ApplyTangents();
            ApplyColors();
            ApplyIndices();

            RecalculateBounds();

            if (removeFromMemory)
            {
                Clear();
            }

            unityMesh.UploadMeshData(removeFromMemory);
        }
Beispiel #3
0
 public PlatformGeometryBuffer(GeometryBuffer mesh)
 {
     this.source = mesh;
     unityMesh   = new UnityEngine.Mesh();
     unityMesh.MarkDynamic();
 }