Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

加载打包的场景时会报错 #35

Open
dzq opened this issue Nov 15, 2017 · 0 comments
Open

加载打包的场景时会报错 #35

dzq opened this issue Nov 15, 2017 · 0 comments

Comments

@dzq
Copy link

dzq commented Nov 15, 2017

错误信息:

InvalidOperationException: This method cannot be used on a streamed scene AssetBundle.
UnityEngine.AssetBundle.LoadAssetAsync (System.String name, System.Type type) (at C:/buildslave/unity/build/artifacts/generated/common/runtime/AssetBundleBindings.gen.cs:238)
LuaFramework.ResourceManager+<OnLoadAsset>c__Iterator0`1[UnityEngine.GameObject].MoveNext () (at Assets/LuaFramework/Scripts/Manager/ResourceManager.cs:157)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)

Packager里面添加打包场景语句如下:
AddBuildMap("scenes" + AppConst.ExtName, "*.unity", "Assets/Tanks/Scenes");
场景只有一个 TanksExample
Main.lua里面加载场景代码:

--主入口函数。从这里开始lua逻辑
function Main()							
	 LuaHelper = LuaFramework.LuaHelper
	 resMgr = LuaHelper.GetResManager()  -- 资源管理器
	 resMgr:LoadPrefab("scenes",{"TanksExample"}, OnLoadFinish)
end
--加载完成后的回调--
function OnLoadFinish(objs)
	print("TanksExample Loaded")
	--UnityEngine.SceneManagement.SceneManager.LoadSceneAsync("TanksExample"  )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant