Hi all, I am working on a windows store app intended to be side loaded onto a surface. I have started attempting to use bundles with the application and all works well in the unity editor, but when I build the project out to a windows store app and try to debug through visual studio, the app can’t seen to access the bundles due to a permissions error.
Here is the code that the app is using to access the bundle:
using UnityEngine;
using System.Collections;
public class SimpleLevelLoader : MonoBehaviour {
[SerializeField] string path;
[SerializeField] string sceneName;
IEnumerator Start ()
{
using (WWW www = WWW.LoadFromCacheOrDownload(path, 0))
{
yield return www;
if(!string.IsNullOrEmpty(www.error))
{
Debug.Log (www.error);
yield break;
}
Application.LoadLevel(sceneName);
yield return null;
www.assetBundle.Unload(false);
}
}
}
This is the example code from the unity 5 bundles training and it works fine in the editor. I am passing in an absolute file path for now, just as a test to see if I could get it working.
When I try to load the bundle in the windows app while running/debugging in visual studio, I get the following error:
First-chance exception at 0x76DA4598 in Template.exe: Microsoft C++ exception: Concurrency::invalid_operation at memory location 0x0975F354.
Error while opening ‘file://C:\Users\aharris\Desktop\Spike Projects\Unity AssetBundle Test\Bundles\PC\mytestbundle’ - Operation has failed with error 0x80070005: Access is denied.
Do I need to specify some permissions in the app or is there a special folder in the project I need to but the bundle?
I have tried putting the bundle in the built app’s Data and Assets folders in the built app’s project folder thinking it would have access, but to no avail.
Thanks