public BoneWeight[] boneWeights ;

설명

The bone weights for each vertex in the Mesh, up to a maximum of 4.

The size of this array is either Mesh.vertexCount or zero. The array is sorted by vertex index.

This property uses BoneWeight structs, which represent exactly 4 bone weights per vertex. Within each BoneWeight struct in the array, the bone weights are in descending order and add up to 1. If a vertex is affected by fewer than 4 bones, each of the remaining bone weights must be 0.

To work with more or fewer bone weights per vertex, use the newer Mesh.GetAllBoneWeights and Mesh.SetBoneWeights APIs, which use BoneWeight1 structs.

See Also: Mesh.GetAllBoneWeights, Mesh.SetBoneWeights, Mesh.GetBonesPerVertex, Mesh.GetBoneWeights, ModelImporter.maxBonesPerVertex, QualitySettings.skinWeights, SkinnedMeshRenderer.quality.

using UnityEngine;
using System.Collections;

public class ExampleClass : MonoBehaviour { void Start() { gameObject.AddComponent<Animation>(); gameObject.AddComponent<SkinnedMeshRenderer>(); SkinnedMeshRenderer rend = GetComponent<SkinnedMeshRenderer>(); Animation anim = GetComponent<Animation>();

// Build basic mesh Mesh mesh = new Mesh(); mesh.vertices = new Vector3[] {new Vector3(-1, 0, 0), new Vector3(1, 0, 0), new