找回密碼
 注冊帳號

掃一掃,訪問微社區

component.getcomponentinchildren 獲取子物體組件

2015-1-5 04:37| 發布者: 楊炎| 查看: 3383| 評論: 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 ();

相關閱讀

文章點評
相關文章
女校游泳队彩金