-
通过new GameObject();
-
通过Instantiate();
-
通过GameObject.CreatePrimitive();
总结:
1)new GameObject()可通过字符串名字来创建游戏物体,并且可挂载某一个组件;2)Instantiate()通过预制体创建游戏物体;
3)GameObject.CreatePrimitive()可创建某一种类型的游戏物体,比如Cube,Sphere,Plane,Quad,Cylinder,Capsule,暂时这六种
Unity中创建游戏物体的三种方法:
最新推荐文章于 2023-08-23 14:08:29 发布