Unity 3 D AssetBundleパッケージ暗号化

1273 ワード

リソース管理ファイルを保護する関連コンテンツ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
}