码迷,mamicode.com
首页 > 编程语言 > 详细

unity3d AssetBundle包加密

时间:2017-04-24 14:38:03      阅读:210      评论:0      收藏:0      [点我收藏+]

标签:mil   site   传输   website   article   ima   pad   微软   microsoft   

保护资源管理文件的相关内容
Unity同意用户使用AssetBundle.CreateFromMemory从一个 byte[]数组中建立一个AssetBundle的对象。在执行传输解密时,能够用这样的加密方法来提高安全性和保护用户建立的资源管理中的内容。

技术分享
string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d";
IEnumerator Start () {
// Start a download of the given URL
WWW www = new WWW (url);

// Wait for download to complete
yield return www;

// Get the byte data
byte[] encryptedData = www.bytes;

// Load the TextAsset object
byte[] decryptedData = YourDecryptionMethod(encryptedData);

// Create an AssetBundle from the bytes array
AssetBundle bundle = AssetBundle.CreateFromMemory(decryptedData);

// You can now use your AssetBundle
}

unity3d AssetBundle包加密

标签:mil   site   传输   website   article   ima   pad   微软   microsoft   

原文地址:http://www.cnblogs.com/lytwajue/p/6756681.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!