Assets/Live2D/Cubism/Rendering/CubismRenderer.cs
/// <summary>
/// Initializes the mesh if necessary.
/// </summary>
Initializes the mesh if necessary.
Initializes the mesh if necessary .
private void TryInitializeMesh()
        {
            if (Meshes != null && Mesh.vertexCount > 0)
            {
                return;
            }
            var drawable = GetComponent<CubismDrawable>();
            if (Meshes == null)
            {
                Meshes = new Mesh[2];
            }
            for (var i = 0; i < 2; ++i)
            {
                var mesh = new Mesh
                {
                    name = drawable.name,
                    vertices = drawable.VertexPositions,
                    uv = drawable.VertexUvs,
                    triangles = drawable.Indices
                };
                mesh.MarkDynamic();
                mesh.RecalculateBounds();
                Meshes[i] = mesh;
            }
        }
private void TryInitializeMesh ( ) { if ( Meshes != null && Mesh . vertexCount > 0 ) { return ; } var drawable = GetComponent < CubismDrawable > ( ) ; if ( Meshes == null ) { Meshes = new Mesh [ 2 ] ; } for ( var i = 0 ; i < 2 ; ++ i ) { var mesh = new Mesh { name = drawable . name , vertices = drawable . VertexPositions , uv = drawable . VertexUvs , triangles = drawable . Indices } ; mesh . MarkDynamic ( ) ; mesh . RecalculateBounds ( ) ; Meshes [ i ] = mesh ; } }
Initializes the mesh if necessary.
Initializes the mesh if necessary .
// Only create mesh if necessary. // HACK 'Mesh.vertex > 0' makes sure mesh is recreated in case of runtime instantiation. // Create mesh for attached drawable. // Store mesh.