Type t = prefab.GetType();
FieldInfo[] fiArray = t.GetFields();
if (fiArray != null)
{
for (int i = 0; i < fiArray.Length; i++)
{
//获取引用
var targetValue= fiArray[i].GetValue(prefab)as MonoBehaviour;
string addressInfo =null;
if (targetValue!=null)
{
addressInfo = GetParentPath(targetValue.gameObject.name, targetValue.transform);
}
}
}
通过反射获取prefab的参数的名字和引用