这是我第一次尝试使用amazon s3,我仍在学习。
我不确定我是否需要在android SDK中做些什么。
这是我的脚本,用于从amazon s3加载资产:
public Text debugText;
// initialization
void Start()
{
string url = "This is a url";
WWW www = new WWW(url);
StartCoroutine(WaitForReq(www));
}
IEnumerator WaitForReq(WWW www)
{
yield return www;
AssetBundle bundle = www.assetBundle;
if (www.error == null)
{
GameObject SPIDER = (GameObject)bundle.LoadAsset("SPIDER");
//For debugging, see if asset is being loaded
debugText.text = ("Object has loaded");
//Instantiates at the location of where the ImageTarget is
var loadedAsset = Instantiate(SPIDER, new Vector3(transform.position.x, transform.position.y, transform.position.z), Quaternion.identity);
//Makes transform of loadedAsset the transform of the ImageTarget
loadedAsset.transform.parent = gameObject.transform;
loadedAsset.gameObject.active = false;
}
else
{
Debug.Log(www.error);
}
}
08-26 13:45:07.598: I/Unity(10633): StopVuforia
08-26 13:45:07.598: I/Unity(10633):
08-26 13:45:07.598: I/Unity(10633): (Filename:
./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:45:46.320: W/UnityMain(10633): type=1400 audit(0.0:105566): avc:
denied { read } for name="version" dev="proc" ino=4026532375
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0
tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633
pgcomm="name.name"
08-26 13:45:46.403: I/Unity(10633): StartVuforia
08-26 13:45:46.403: I/Unity(10633):
08-26 13:45:46.403: I/Unity(10633): (Filename:
./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:45:46.400: W/UnityMain(10633): type=1400 audit(0.0:105567): avc:
denied { read } for name="u:object_r:camera_prop:s0" dev="tmpfs" ino=15357
scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:camera_prop:s0
tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633
pgcomm="name.name"
08-26 13:46:19.877: I/Unity(10633): StopVuforia
08-26 13:46:19.877: I/Unity(10633):
08-26 13:46:19.877: I/Unity(10633): (Filename:
./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:46:27.050: W/UnityMain(10633): type=1400 audit(0.0:105655): avc: denied { read } for name="version" dev="proc" ino=4026532375 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:proc:s0 tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633 pgcomm="name.name"
08-26 13:46:27.089: I/Unity(10633): StartVuforia
08-26 13:46:27.089: I/Unity(10633):
08-26 13:46:27.089: I/Unity(10633): (Filename: ./Runtime/Export/Debug.bindings.h Line: 43)
08-26 13:46:27.080: W/UnityMain(10633): type=1400 audit(0.0:105656): avc: denied { read } for name="u:object_r:camera_prop:s0" dev="tmpfs" ino=15357 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:camera_prop:s0 tclass=file permissive=0 ppid=1024 pcomm="main" pgid=10633 pgcomm="name.name"