static function FindObjectsOfType (type : Type) : Object[]

来源:互联网 发布:删除文件恢复软件 编辑:程序博客网 时间:2024/05/01 03:52

转载自:

static function FindObjectsOfType (type : Type) : Object[]

Description描述

Returns a list of all active loaded objects of Type type.

返回Type类型的所有激活的加载的物体列表

It will return no assets (meshes, textures, prefabs, ...) or inactive objects.

它将返回任何资源(网格,纹理,预设,...)或未激活的物体。

Please note that this function is very slow. It is not recommended to use this function every frame. In most cases you can use the singleton pattern instead.

请注意这个函数是非常慢的。不推荐在每帧使用这个函数,大多数情况下你可以使用单例模式代替。

  • C#
  • JavaScript
// When clicking on the object, it will disable all springs on all hinges in the scene.//当点击物体,它将禁用场景中所有铰链中的弹簧function OnMouseDown () {var hinges : HingeJoint[] = FindObjectsOfType(HingeJoint) as HingeJoint[];for (var hinge : HingeJoint in hinges) {hinge.useSpring = false;}}

0 0
原创粉丝点击