美文网首页
子对象相关

子对象相关

作者: Pomelo的笔记本 | 来源:发表于2017-09-06 11:11 被阅读0次

    设置游戏对象的子对象

    sonObject.transform.parent = fatherObject.transform;
    

    获取子对象的数量

    father.transform.childCount;
    

    遍历子对象

    foreach (Transform child in father.transform){
      Debug.log(child.gameObject.name);
    }
    

    相关文章

      网友评论

          本文标题:子对象相关

          本文链接:https://www.haomeiwen.com/subject/dcvmjxtx.html