我在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