我有一个节奏游戏,我几乎完成了工作,但遇到了一些障碍。我们有一个应用程序内商店,用户可以在其中购买其他“歌曲包”以赚钱。这些包装包含歌曲文件(文本资产),歌曲横幅图像(PNG)和歌曲本身(MP3)。这些数据存储在我们的服务器上,并在成功购买后与服务器通信。服务器脚本通过Google Play购买API验证购买(带有购买令牌),然后如果其有效,请下载数据的ZIP文件并将其提取到Unity应用中。这部分效果很好。
但是,我似乎不明白我需要采用哪种格式或确切的内容。此外,我的游戏利用了地址标签来加载场景之间的数据。这有效,但是我不确定如何确切处理可下载内容。我可以在运行时通过API创建新的可寻址标签吗?我希望能够在应用程序中添加其他可下载内容,而无需更新基本游戏可寻址信息。这甚至可能吗?
我的主要问题是:
-
如何交付可下载的内容?我需要在某种类型的资产捆绑包中包装它吗?这会保留我以Unity设置的音频压缩之类的导入设置吗?
-
我应该在Android上提取哪个文件夹?流媒体?
-
我可以在运行时创建可寻址标签吗?这是可能的,这是个好主意吗?
谢谢您的帮助!
I have a rhythm game that I am almost finished working on but have hit a bit of a snag. We have an in-app store where users can purchase additional "song packs" for money. These packs contain song files (text asset), song banner images (png) and the songs themselves (mp3). This data is stored on our server, and the Unity app communicates with the server after a successful purchase is made. The server script validates the purchase via the Google Play Purchasing API (with the purchase token) and then if its valid, downloads the zip file of the data and extracts it into the Unity app. This part is working great.
However, I seem to not understand in what format I need to have the content or where exactly to put it. Furthermore, my game makes use of Addressables tags to load data between scenes. This works, but I am not sure how exactly I would handle this for downloadable content. Can I create new addressable tags via the API at runtime? I want to be able to add additional downloadable content to the app without needing to update the base games Addressable information. Is this even possible?
My main questions are:
-
How do I deliver my downloadable content? Do I need to package it in some type of Asset Bundle? Would this keep the import settings like audio compression that I set in Unity?
-
What folder should I extract the downloaded content on Android? StreamingAssets?
-
Can I create Addressable tags at runtime? Is this possible and is this a good idea?
Thank you for the help!
发布评论
评论(1)
我宁愿只编码一个核心URL,即您的应用程序启动时可以找到并下载“地址”内容目录!这使您无需重建应用程序就可以添加和删除整个地址,组,标签等。您可以例如给出每个根对象一个特定标签(所有所有标签相同),然后基本上可以加载目录并向用户显示所有现有标记的结果而无需立即加载它们。.请参阅LoadContentCatalogAsync
You need to build your promertables 通过然后,只需将整个内容目录(JSON和HASH)和由此产生的单个地址(通常为每组一个)复制到您的服务器上,您的应用程序可以访问并下载它们。
这样,您基本上甚至可以拥有两个完整的独立统一项目,一个用于构建内容,一个用于实际应用程序。
您只需要确保两个项目都具有您的地址库中使用的代码库,并且所有必需的依赖项都在项目中或地址内置中。
请参阅从多个项目中加载
I would rather only code one core URL where your app when it is started can find and download the Addressables content catalogue! This allows you to fully add and remove entire Addressables, groups, tags etc without ever needing to rebuild your app. You could e.g. give each of your root objects a certain label (the same for all) then you can basically load the catalog and show the user all existing tagged results without immediately loading them .. see LoadContentCatalogAsync
You need to build your Addressables via the group window and then simply copy the entire content catalog (JSON and hash) and the resulting individual Addressables (usually one per group) onto your server where your app can access and download them.
This way you can basically even have two complete separate Unity projects, one for building the content, one for the actual app.
You only need to be sure that both projects have the same code base used by your addressables and that all required dependencies are either in the projects or within the Addressables.
See Loading from Multiple Projects