Unity如何判断一个对象是不是一件衣服
判断该对象及其子对象上是否有SkinnedMeshRenderer组价即可
public static bool IsCloth(Transform obj) { bool isCloth = false; SkinnedMeshRenderer smrInRoot = obj.GetComponent<SkinnedMeshRenderer>(); if (smrInRoot) isCloth = true; else { SkinnedMeshRenderer[] smrInChild = obj.GetComponentsInChildren<SkinnedMeshRenderer>(true); isCloth = smrInChild.Length > 0; } return isCloth; }