unity的prefabs

来源:互联网 发布:java官网教程 编辑:程序博客网 时间:2024/06/15 08:51

Prefabs in Unity are for the time being just an Unity editor feature. Prefabs are predefined assets which can only be created in the editor. Prefabs doesn't even exist in your build. A prefab at runtime is just an off-scene gameobject. It is loaded like any other asset and can be used as clone (Instantiate) source.

Unity has no inbuild functions to save any kind of gamestate. This has to be implemented by yourself. I guess there are third party frameworks out there for Unity which allows some kind of saving and loading.

If you don't have the money to buy such a package you can still do it yourself. It's up to you how you save the data. Very common is using some kind of xml structure to save everything (Mesh data, object parameters, name, position / rotation / scale, components, ...) in a text format. For images it's best to use png files.

原创粉丝点击