Object.Instantiate 实例
来源:互联网 发布:单片机ram rom flash 编辑:程序博客网 时间:2024/05/19 20:42
static function Instantiate (original : Object, position : Vector3, rotation : Quaternion) : Object
Description描述
Clones the object original and returns the clone.
克隆原始物体并返回克隆物体。
Clones the object original, places it at position and sets the rotation to rotation, then returns the cloned object. This is essentially the same as using duplicate command (cmd-d) in Unity and then moving the object to the given location. If a game object, component or script instance is passed, Instantiate will clone the entire game object hierarchy, with all children cloned as well. All game objects are activated.
克隆原始物体,位置设置在position,设置旋转在rotation,返回的是克隆后的物体。这实际上在Unity和使用复制(ctrl+D)命令是一样的,并移动到指定的位置。如果一个游戏物体,组件或脚本实例被传入,实例将克隆整个游戏物体层次,以及所有子对象也会被克隆。所有游戏物体被激活。
- C#
- JavaScript
// Instantiates 10 copies of prefab each 2 units apart from each other//实例化10个 prefab拷贝,间隔2个单位var prefab : Transform;for (var i : int = 0;i < 10; i++) {Instantiate (prefab, Vector3(i * 2.0, 0, 0), Quaternion.identity);}
Instantiate is most commonly used to instantiate projectiles, AI Enemies, particle explosions or wrecked object replacements.
- Object.Instantiate 实例
- Object.Instantiate 实例
- Object.Instantiate 实例
- Instantiate 实例
- 【Unity】Object.Instantiate
- Instantiate 实例产生父子关系
- "Cannot instantiate QtProjectEngine object"错误的解决方法
- Beans.instantiate() 创建新 bean 实例
- 如何改变实例(instantiate)的方向
- Prefabs(预设)与 Instantiate(实例化)详解
- Prefabs(预设)与 Instantiate(实例化)
- Prefabs(预设)与 Instantiate(实例化)
- Unity3D Instantiate实例化游戏对象【1】
- Invocation of init method failed could not instantiate test object
- How do I instantiate a Queue object in java?
- “QCoreApplication::applicationDirPath: Please instantiate the QApplication object first”问题
- android+unity3d的Prefabs(预设)与Instantiate(实例化)
- Unable to instantiate Action(Action无法实例化)
- 你的第一个Windows程序——绘制窗口
- C++设计模式二(Proxy代理模式)
- .idata数据的解析
- tiny 6410
- 数据结构-静态链表
- Object.Instantiate 实例
- Paxos算法与Zookeeper分析
- 烦人的广告
- 堆排序
- Python中单/双下划线使用
- Android 的 Mapview & Location 使用教程
- 一次访问Web服务器的详细通信过程
- 错误
- Future 模式详解(并发使用)