gpt4 book ai didi

c# - 如何从维护其组件和属性的服务器加载 Unity 中的游戏对象?

转载 作者:行者123 更新时间:2023-11-30 23:18:31 25 4
gpt4 key购买 nike

我正在 Unity 中开发一个 GameObject,我想要的是 GameObject 应该从维护其所有引用和组件的服务器链接下载,以便它应该执行离线执行的方式。这样做的目的是我想减小应用程序的大小,从而让用户可以选择是否下载游戏对象。

最佳答案

您可能正在寻找 Prefabs ,这将允许您使用所有引用来保护游戏对象。

Unity has a Prefab asset type that allows you to store a GameObject object complete with components and properties. The prefab acts as a template from which you can create new object instances in the scene. Any edits made to a prefab asset are immediately reflected in all instances produced from it but you can also override components and settings for each instance individually.

这些预制件可以在AssetBundles中提供从您的服务器轻松重新集成到您的游戏中

AssetBundles have been designed to simplify downloading content to your application. They can contain any kind of Asset type recognized by Unity, as determined by the filename extension. If you want to include files with custom binary data, they should have the extension “.bytes”. Unity will import these files as TextAssets.

关于c# - 如何从维护其组件和属性的服务器加载 Unity 中的游戏对象?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40857711/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com