位置: 编程技术 - 正文
推荐整理分享Protecting Content With AssetBundle[Unity],希望有所帮助,仅作参考,欢迎阅读内容。
文章相关热门搜索词:,内容如对您有帮助,希望把文章链接给更多的朋友!
Whilst it is possible to use encryption to secure your Assets as they are being transmitted, once the data is in the hands of the client it is possible to find ways to grab the content from them. For instance, there are tools out there which can record 3D data at the driver level, allowing users to extract models and textures as they are sent to the GPU. For this reason, our general stance is that if users are determined to extract your assets, they will be able to.
However, it is possible for you to use your own data encryption on AssetBundle files if you still want to.
One way to do this is making use of the TextAsset type to store your data as bytes. You can encrypt your data files and save them with a .bytes extension, which Unity will treat as a TextAsset type. Once imported in the Editor the files as TextAssets can be included in your AssetBundle to be placed in a server. In the client side the AssetBundle would be downloaded and the content decrypted from the bytes stored in the TextAsset. With this method the AssetBundles are not encrypted, but the data stored which is stored as TextAssets is.
An alternative approach is to fully encrypt the AssetBundles from source and then download them using the WWW class. You can give them whatever file extension you like as long as your server serves them up as binary data. Once downloaded you would then use your decryption routine on the data from the .bytes property of your WWW instance to get the decrypted AssetBundle file data and create the AssetBundle from memory using AssetBundle.CreateFromMemory.
The advantage of this latter approach over the first one is that you can use any method (except AssetBundles.LoadFromCacheOrDownload) to transmit your bytes and the data is fully encrypted - for example sockets in a plugin. The drawback is that it won’t be Cached using Unity’s automatic caching. You can in all players except the WebPlayer store the file manually on disk and load it using AssetBundles.CreateFromFile
A third approach would combine the best of both approaches and store an AssetBundle itself as a TextAsset, inside another normal AssetBundles. The unencrypted AssetBundle containing the encrypted one would be cached. The original AssetBundle could then be loaded into memory, decrypted and instantiated usingAssetBundle.CreateFromMemory.
Unity3D图像后处理特效——Fisheye image effect
unity学习之增删查改 unity学习,希望我的博客能给正在学习unity的朋友们带来帮助今天我们来学习在vs中对数据库中的数据进行增删查改,直接来看代码吧封装,方便方法的
慎用 NavMeshObstacle.Carve 在Bake场景的时候,Navigation窗口的Bake页面有一个高度,场景中的导航网通常作为一个平面,当NavMeshObstacle距离小于这个高度时,才会在导航网上挖洞,
标签: Protecting Content With AssetBundle[Unity]
本文链接地址:https://www.jiuchutong.com/biancheng/377293.html 转载请保留说明!友情链接: 武汉网站建设