文档

Unity Engine

Unity Engine

Instantiating prefabs at runtime

Instantiate prefabs from your C# runtime application code.
阅读时间1 分钟最后更新于 2 个月前

You can use prefabs to instantiate complicated GameObjects or collections of GameObjects at runtime.

Topic

Description

Introduction to instantiating prefabsIntroductory context and common scenarios in which instantiating prefabs is useful.
Build a structure with prefabsUse prefabs to instantiate several copies of a block prefab to construct a wall.
Instantiating projectiles and explosionsUse prefabs to instantiate exploding projectiles.

Additional resources