b站傅老师教的做下笔记
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public static class TransformHelpers{
public static Transform DeepFind(this Transform parent,string targetName) {
Transform tempTrans=null;
foreach(Transform child in parent){
if(child.name==targetName)
{
return child;
}
else {
tempTrans=DeepFind(child,targetName);
if(tempTrans!=null)
{
return tempTrans;
}
}
}
return null;
}
}
谁来,将海
发布了5 篇原创文章 · 获赞 0 · 访问量 100
私信
关注