查找子物體

查找子物體

記錄,備忘,省的以後找

    public Transform GetTransform(Transform check, string name)
    {
        foreach (Transform t in check.GetComponentsInChildren<Transform>())
        {
            if (t.name == name)
            {
                return t;
            }
        }
        return null;
    }

轉自:

http://game.ceeger.com/forum/read.php?tid=10386

點擊打開鏈接

發佈了24 篇原創文章 · 獲贊 9 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章