简体   繁体   English

在 Unity 3D 中销毁和生成(重生)对象

[英]Destroy and Spawn(Respawn) Objects in Unity 3D

I have a game project.我有一个游戏项目。 You have a ball that you can control with arrow keys.你有一个可以用箭头键控制的球。 Purpose is, you will collecting an object.目的是,您将收集一个对象。 Object will destroy when i going over it, and respawn in random location of ground.当我越过它时,物体会破坏,并在地面的随机位置重生。 Btw, you need to do that in 30 seconds.顺便说一句,你需要在 30 秒内完成。 I couldnt destroy and respawn part.我无法摧毁和重生部分。 May you help me?你能帮我吗? (C#) (C#)

You can use collisions to destroy object.您可以使用碰撞来破坏对象。 Run over it and yield .碾过它并yield After that you can create couple of spawn points (for more randomness you can move the spawn points).之后,您可以创建几个重生点(为了获得更多随机性,您可以移动重生点)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM