我在Unity3d中创建场景并将其资产预算导出为.unity3d文件。此外,我从我的服务器下载assetbudle到我的android应用程序。场景被加载,但我为多维数据集写的rotaion脚本缺失。我可以从我的Android应用程序中看到对象,从那里启动UnityPlayerActivity,但对象不旋转,因为我可以在Unity中看到有关此行为的参考脚本(游戏对象“玩家”)缺失
请你帮忙。
这是参考脚本我使用的Android
IEnumerator receive(string message)
{
// Download compressed scene. If version 5 of the file named "Streamed-Level1.unity3d" was previously downloaded and cached.
// Then Unity will completely skip the download and load the decompressed scene directly from disk.
var download = WWW.LoadFromCacheOrDownload(message,19);
yield return download;
// Handle error
if (download.error != null)
{
Debug.LogError(download.error);
yield break;
}
// In order to make the scene available from LoadLevel, we have to load the asset bundle.
// The AssetBundle class also lets you force unload all assets and file storage once it is no longer needed.
var bundle = download.assetBundle;
sceneNames = bundle.GetAllScenePaths();
// Load the level we have just downloaded
SceneManager.LoadScene(sceneNames[0]);
}
}
而且从我的活动我使用方法加载资产要发送消息给UnityPlayerActivity到
UnityPlayer.UnitySendMessage("Main Camera", "receive", "https://MyServer/Level5.unity3d");
你有没有附加脚本我附上脚本这实际上是转动我的对象的对象立方主摄像机,实际上所谓的“”主摄像头“? – Programmer
。如果我连接相同的脚本‘主摄像头’相机围绕物体旋转。并显示Object Cube的脚本丢失 – Yogesh
W/Unity:此行为的引用脚本丢失! (文件名:./Runtime/Mono/MonoBehaviour.cpp行:1514) (文件名:./Runtime/Mono/MonoBehaviour.cpp行:1514) W/Unity:此行为的引用脚本丢失! Unity:此行为(游戏对象'主相机')上的引用脚本丢失! – Yogesh