纳金网

标题: unity3d 资源加密问题 [打印本页]

作者: tianhett    时间: 2015-2-4 22:51
标题: unity3d 资源加密问题

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包加密



作者: HIDEOKOJIMA    时间: 2015-2-4 23:08
Thanks for sharing this one !
作者: myonkyo    时间: 2015-2-5 09:55
感谢分享,谢谢提供下载
作者: herry7x    时间: 2015-2-5 11:30

Thanks for sharing this one !




欢迎光临 纳金网 (http://go.narkii.com/club/) Powered by Discuz! X2.5