unity3d GameObject.Find 严格区分大小写的
GameObject.Find 查找
static function Find (name : string) : GameObject
Description描述
Finds a game object by name and returns it.
If no game object with name can be found, null is returned. If name contains a '/' character it will traverse the hierarchy like a path name. This function only returns active gameobjects.
找到并返回一个名字为name的游戏物体。
如果以name为名字的游戏物体没有被找到,则返回空.如果name中包含'/'字符,这个名称将被视作一个hierarchy中的路径名.这个函数只返回活动的游戏物体。
For performance reasons it is recommended to not use this function every frame Instead cache the result in a member variable at startup or use GameObject.FindWithTag.
除非迫不得已,建议不要在每一帧中使用这个函数。可以在开始的时候用一个成员变量来缓存结果或者使用GameObject.FindWithTag函数。
注意:这里的参数name 是严格区分大小写的。
var hand : GameObject;
// This will return the game object named Hand in the scene.
//这将返回名为Hand 的游戏物体
hand = GameObject.Find("Hand"); // This will return the game object named Hand.
// Hand may not have a parent in the hierarchy view!
//这将返回名为Hand 的游戏物体,在层次视图中hand也没有父级物体
hand = GameObject.Find("/Hand"); // This will return the game object named Hand,
// which is a child of Arm -> Monster.
// Monster may not have a parent in the hierarchy view!
//这将返回Monster/Arm 的子级下名为Hand 的游戏物体,在层次视图中Monster也没有父级物体
hand = GameObject.Find("/Monster/Arm/Hand"); // This will return the game object named Hand,
// which is a child of Arm -> Monster.
// Monster may have a parent.
//这将返回Monster/Arm 的子级下名为Hand 的游戏物体,在层次视图中Monster可以有父级物体
hand = GameObject.Find("Monster/Arm/Hand");
unity3d GameObject.Find 严格区分大小写的的更多相关文章
- Unity3d gameObject
using UnityEngine; using System.Collections; public class test : MonoBehaviour { //print只能在MonoBehav ...
- unity3d基础01
Unity3d 五大视图: 1 Scene:存放hierarchy中创建的游戏对象,但实际只能看到一部分 *Scene浏览: ①右键进入“飞行模式”,方便查看整个场景 ②选中摄像机,按ALT进入浏览的 ...
- unity3d android互调
unityPlayer = new AndroidJavaClass("com.xxx.xxx.MainActivity"); curActivity = unityPlayer. ...
- Unity进阶----AssetBundle_01(2018/10/30)
AssetBundle作用和定义 1).AssetBundle是一个压缩包包含模型.贴图.预制体.声音.甚至整个场景,可以在游戏运行的时候被加载: 2).AssetBundle自身保存着互相的依赖关系 ...
- Unity组件
在学习C++的时候,对于面对对象有点了解.然后也使用过一段时间的Unity,用起来还是觉得,怎么这么好用.耦合性极低.当时不知道这是基于组件编程.所以现在来学习下基于组件的知识,并比较下基于组件和基于 ...
- Unity进阶之ET网络游戏开发框架 03-Hotfix层启动
版权申明: 本文原创首发于以下网站: 博客园『优梦创客』的空间:https://www.cnblogs.com/raymondking123 优梦创客的官方博客:https://91make.top ...
- ET框架之SceneChangeComponent
初始化事件 using ETModel; namespace ETHotfix { [Event(EventIdType.InitSceneStart)] public class InitScene ...
- 【Unity3D基础教程】给初学者看的Unity教程(一):GameObject,Compoent,Time,Input,Physics
作者:王选易,出处:http://www.cnblogs.com/neverdie/ 欢迎转载,也请保留这段声明.如果你喜欢这篇文章,请点推荐.谢谢! Unity3D重要模块的类图 最近刚刚完成了一 ...
- 【Unity3D技巧】在Unity中使用事件/委托机制(event/delegate)进行GameObject之间的通信 (二) : 引入中间层NotificationCenter
作者:王选易,出处:http://www.cnblogs.com/neverdie/ 欢迎转载,也请保留这段声明.如果你喜欢这篇文章,请点[推荐].谢谢! 一对多的观察者模式机制有什么缺点? 想要查看 ...
随机推荐
- netstat监控大量ESTABLISHED连接与Time_Wait连接问题(转载)
问题描述: 在不考虑系统负载.CPU.内存等情况下,netstat监控大量ESTABLISHED连接与Time_Wait连接. # netstat -n | awk '/^tcp/ {++y[$NF] ...
- SharedPreferences的基本用法
获取SharedPreferences的两种方式: 1 调用Context对象的getSharedPreferences()方法 2 调用Activity对象的getPreferences()方法 两 ...
- AngularJS(16)-路由
AngularJS 路由 本章节我们将为大家介绍 AngularJS 路由. AngularJS 路由允许我们通过不同的 URL 访问不同的内容. 通过 AngularJS 可以实现多视图的单页Web ...
- PHP实现根据浏览器跳转不同语言页面代码
以下是对使用PHP实现根据浏览器跳转不同语言页面的代码进行了介绍,需要的朋友可以过来参考下 代码: <?php /** * 根据不同浏览器跳转不同页面 * 来源:www.jbxue.com * ...
- django post报403问题
第一个问题是: 我使用jquery的ajax向后台传值, 当使用GET方法时没问题 $.ajax({ type:"GET" url: data: success: }) 但是由于基 ...
- 未能加载文件或程序集“Report.Basic”或它的某一个依赖项。试图加载格式不正确的程序
出现问题如下: 解决办法: 这是由于没有开启32位程序兼容模式 具体操作如下:找到对应的程序池--------高级设置-------修改“启用32位应用程序”状态修改为true
- sqlldr使用
一.写ctl文件 首先,先写一个ctl文件(包含控件信息的文件,这里是oracle数据库的控制文件)文件名:测试.ctl ctl文件例: load datainfile 'd:\xxx.cvs'tru ...
- ARPA
ARPA是英文Advanced Research Projects Agency的缩写,代表美国国防部高级研究计划署.是美国国防部高级研究计划管理局因军事目的而建立的,开始时只连接了4台主机,这便是只 ...
- PHP中::、->、self、$this操作符的区别
在访问PHP类中的成员变量或方法时,如果被引用的变量或者方法被声明成const(定义常量)或者static(声明静态),那么就必须使用操作符::,反之如果被引用的变量或者方法没有被声明成const或者 ...
- Win7下配置nginx和php5
本文链接:http://www.cnblogs.com/cnscoo/archive/2012/09/03/2668577.html 一.准备工作: OS:Windows7 SP1 Nginx: ng ...