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

请教,补丁中的方法内,调用泛型逻辑也不可以吗? #49

Closed
Laughing111 opened this issue Nov 6, 2019 · 4 comments
Closed

Comments

@Laughing111
Copy link

Laughing111 commented Nov 6, 2019

报错:
Patch Error:System.Exception: can not load generic method [LoadAsset] of UnityEngine.AssetBundle

补丁中的方法
[Patch]
private void TestABLoad(AssetBundle ab){
GameObject prefab=ab.LoadAsset 《GameObject》 ("testPrefab");
}

@Laughing111
Copy link
Author

泛型打不出来,只有《》代替了

@chexiongsheng
Copy link
Collaborator

可以用泛型,但如果你之前没用过这个泛型,unity不会编译进发布包。这时不是不能用,而是根本没有。

@Laughing111
Copy link
Author

OK,我去试试,然后回来上报结果

@LiuMir
Copy link

LiuMir commented May 24, 2020

OK,我去试试,然后回来上报结果

请问关于使用泛型结果如何?能否贴一下测试例子

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

3 participants