component.getcomponents 获取组件列表

2015-1-5 04:57| 发布者: 杨炎| 查看: 1796| 评论: 0|原作者: 蛮牛|来自: yzc88亚洲城脚本manual

摘要: component.getcomponents 获取组件列表functiongetcomponents(type: type) : componentdescription描述returns all components of type type in thegameobject.在游戏物体返回全部type类型组件。c#javascriptusing u ...

component.getcomponents 获取组件列表

functiongetcomponents(type: type) : component[]

description描述

returns all components of type type in theobject" target="_blank" class="relatedlink">gameobject.

游戏物体返回全部type类型组件。

c#

javascript

using unityengine;

using system.collections;

public class example :monobehaviour{

publichingejoint[] hingejoints;

public void awake() {

hingejoints = getcomponents();

foreach (hingejoint joint in hingejoints) {

joint.usespring = false;

}

}

}

// disable the spring on all hingejoints in this game object

//在这个游戏物体禁用全部铰链关节上的弹簧

var hingejoints :hingejoint[];

hingejoints = getcomponents (hingejoint);

for (var joint : hingejoint in hingejoints) {

joint.usespring = false;

}

相关阅读

文章点评
相关文章