找回密码
 注册帐号

扫一扫,访问微社区

component.getcomponentinchildren 获取子物体组件

2015-1-5 04:37| 发布者: 杨炎| 查看: 3423| 评论: 0|原作者: 蛮牛|来自: unity3d脚本manual

摘要: component.getcomponentinchildren 获取子物体组件functiongetcomponentinchildren(t: type) : componentdescription描述returns the component of type type in thegameobjector any of its children using depth f ...

component.getcomponentinchildren 获取子物体组件

functiongetcomponentinchildren(t: type) : component

description描述

returns the component of type type in thegameobjector any of its children using depth first search.

only active components are returned.

返回type类型组件,在gameobject或它的任何子物体使用深度优先搜索,仅返回激活的组件。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

public scriptname script;

public void awake() {

script = getcomponentinchildren();

script.dosomething();

}

}

var script : scriptname;

script = getcomponentinchildren(scriptname);

script.dosomething ();

相关阅读

文章点评
相关文章