찾기
내용으로 건너뛰기
추적
문서의 이전 판을 선택했습니다!
저장하면 이 자료로 새 판을 만듭니다.
미디어 파일
======Protecting Content====== 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. <file csharp>string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d"; IEnumerator Start () { // Start a download of the encrypted assetbundle WWW www = new WWW.LoadFromCacheOrDownload (url, 1); // Wait for download to complete yield return www; // Load the TextAsset from the AssetBundle TextAsset textAsset = www.assetBundle.Load("EncryptedData", typeof(TextAsset)); // Get the byte data byte[] encryptedData = textAsset.bytes; // Decrypt the AssetBundle data byte[] decryptedData = YourDecryptionMethod(encryptedData); // Use your byte array. The AssetBundle will be cached }</file> An alternative approach is to fully encrypt the AssetBundles from source and 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 [[ScriptRef:AssetBundle.CreateFromMemory.html|AssetBundle.CreateFromMemory]]. <file csharp>string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d"; IEnumerator Start () { // Start a download of the encrypted assetbundle WWW www = new WWW (url); // Wait for download to complete yield return www; // Get the byte data byte[] encryptedData = www.bytes; // Decrypt the AssetBundle data byte[] decryptedData = YourDecryptionMethod(encryptedData); // Create an AssetBundle from the bytes array AssetBundle bundle = AssetBundle.CreateFromMemory(decryptedData); // You can now use your AssetBundle. The AssetBundle is not cached. }</file> 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 all players except the WebPlayer store the file manully on disk and load it using [[ScriptRef:AssetBundle.CreateFromFile.html|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 using [[ScriptRef:AssetBundle.CreateFromMemory.html|AssetBundle.CreateFromMemory]]. <file csharp>string url = "http://www.mywebsite.com/mygame/assetbundles/assetbundle1.unity3d"; IEnumerator Start () { // Start a download of the encrypted assetbundle WWW www = new WWW.LoadFromCacheOrDownload (url, 1); // Wait for download to complete yield return www; // Load the TextAsset from the AssetBundle TextAsset textAsset = www.assetBundle.Load("EncryptedData", typeof(TextAsset)); // Get the byte data byte[] encryptedData = textAsset.bytes; // Decrypt the AssetBundle data byte[] decryptedData = YourDecryptionMethod(encryptedData); // Create an AssetBundle from the bytes array AssetBundle bundle = AssetBundle.CreateFromMemory(decryptedData); // You can now use your AssetBundle. The wrapper AssetBundle is cached }</file> [[AssetBundlesIntro|back to AssetBundles Intro]] {{tag>유니티 unity}} * 출처: [[http://unitykoreawiki.com/index.php?n=KrMain.protectingcontent|유니티코리아위키]] (CC BY-NC-SA 2.0)
2+1?
이 필드는 비어 있도록 유지하세요:
저장
미리 보기
취소
편집 요약
참고: 이 문서를 편집하면 내용은 다음 라이선스에 따라 배포하는 데 동의하는 것으로 간주합니다:
CC Attribution-Noncommercial-Share Alike 4.0 International
연결문서
AssetBundles (Pro only)
유니티3D ( Unity3D )
문서 도구
문서 보기
이전 판
연결문서
맨 위로
다크 모드로 보기
☀️
Toggle Menu
유니티3D ( Unity3D )
너두 고쳐두 됩니다.
사이트 도구
최근 바뀜
미디어 관리자
사이트맵
사용자 도구
등록
로긴
최근 수정된 문서
misuse_topical5
노박
unique_items
dinner_bell
deputy_beagle
ratslayer
one_for_my_baby
alerio
power_fist
제거됨
fixer
climb_ev_ry_mountain
companion
[장비 분실]
crashed_vertibird
brotherhood_t-51b_power_armor
marco
i_forgot_to_remember_to_forget
cateye