Unity GetComponentsInChildren<T>(true);
2024-09-27 23:33:10
using System.Collections;
using System.Collections.Generic;
using UnityEngine; public class GetComponent : MonoBehaviour
{
public Transform[] transforms; void Start()
{
transforms = GetComponentsInChildren<Transform>(true);
}
}
GetComponentsInChildren<Transform>(true);//游戏对象下的子物体激活的没激活的都会被拿到,包括游戏对象本身
GetComponentsInChildren<Transform>(false);//游戏对象下的子物体激活的会被拿到,包括游戏对象本身;没激活的不会被拿到
另外,()不写的活默认为false.
最新文章
- SubversionEdge 变更绑定地址
- SQLite Design and Concepts
- Qt5 托盘模仿qq闪烁,弹消息框实现
- http://www.cnblogs.com/0201zcr/p/4987561.html
- [转]GPS纠偏算法,适用于google,高德体系的地图
- nexus 2.6需要jdk7才能跑起来
- RIA+REST架构实现完美WEB开发
- The _imageingft C module is not installed
- 用Eclipse 开发Dynamic Web Project应用程序 【转】
- GIT学习(二)-->;Git分布式的好处
- Windows VS下搭建cocos2d-x环境搭建
- 批处理bat脚本编写(附详细例子)
- jsp解决kindeditor在线编辑器struts图片上传问题
- Sublime Text 快捷键--持续更新
- 使用Java API连接和操作HBase数据库
- postgresql 基础sql
- FFmpeg configure: rename cuda to ffnvcodec 2018-03-06
- 高危Windows系统 SMB/RDP远程命令执行漏洞 手工修复办法
- SSL及其加密通信过程
- 4、xamarin forms 设置安卓的toolbar的高度
热门文章
- 设计模式11: Flyweight 享元模式(结构型模式)
- 编写高质量代码改善C#程序的157个建议——建议19:使用更有效的对象和集合初始化
- Header Only Library
- php复制目录
- 一条命令深度清理你的mac
- Launch VINS example (Euroc dataset) in RTAB-MAP
- jquery图片切换
- Codeforces Round #175 (Div. 2) A~D 题解
- vue 利用 v-model 实现 双向传递数据..
- 数据结构5.4_m元多项式的表示