这是一个简易的换装,先准备一个完整的角色模型,还有一些身体部件的模型,它们的骨骼名称都是一致的
然后都做成预制体,放进目录Resources/Prefab
再然后在场景中放一个只有骨骼的角色,蒙皮都删掉
接着就挂代码在它上面
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class TestMesh : MonoBehaviour
{
void Start()
{
string[] partnames = new string[] { "ch_pc_hou_004_tou",
"ch_pc_hou_004_shen",
"ch_pc_hou_004_shou",
"ch_pc_hou_004_jiao"};
GameObject partObject;
SkinnedMeshRenderer[] rendeLis