/// <summary> /// Creates a new layer mesh /// </summary> /// <param name="startIndex">Start index.</param> /// <param name="count">Count indices</param> /// <param name="image">Mesh material</param> private void NewMesh(int startIndex, int count, Texture2D image) { Mesh mesh = new Mesh( 0, this.vertices.Length, startIndex * indicesPerTile, count * 2, this.vertexBuffer, this.indexBuffer, PrimitiveType.TriangleList) { DisableBatch = true }; BasicMaterial2D material = new BasicMaterial2D(image, this.LayerType) { SamplerMode = this.samplerMode }; material.Initialize(this.Assets); this.meshes.Add(new Tuple <BasicMaterial2D, Mesh>(material, mesh)); }
/// <summary> /// Creates a new layer mesh /// </summary> /// <param name="startIndex">Start index.</param> /// <param name="count">Count indices</param> /// <param name="image">Mesh material</param> private void NewMesh(int startIndex, int count, Texture2D image) { Mesh mesh = new Mesh( 0, this.vertices.Length, startIndex * indicesPerTile, count * 2, this.vertexBuffer, this.indexBuffer, PrimitiveType.TriangleList) { DisableBatch = true }; BasicMaterial2D material = new BasicMaterial2D(image, this.LayerType) { SamplerMode = this.samplerMode }; material.Initialize(this.Assets); this.meshes.Add(new Tuple<BasicMaterial2D, Mesh>(material, mesh)); }