Skip to content

为什么我的Hotfix文件夹下的脚本GameEntry自动引用的ugf的,必须手动添加using Game #12

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

Closed
XiaoBojun opened this issue Jul 4, 2023 · 6 comments

Comments

@XiaoBojun
Copy link

我下载项目参考,修改我的项目,但我的项目Hotfix文件夹下的脚本中,GameEntry自动引用的ugf的,无法调用事件、资源等,必须手动添加using Game。但博主你的项目不需要,我想知道这是怎么设置的,我在unity改了脚本优先级也不行

@GREAT1217
Copy link
Owner

检查下项目中 Assets/Game/Scripts/Hotfix/Game.Hotfix 文件。如果没有,用 git revert 回来。

image

@XiaoBojun
Copy link
Author

你好,参照项目改的,但还是有这样问题
image
image
image
image

@GREAT1217
Copy link
Owner

因为我的命名空间是 Game、Game.Hotfix、Game.Editor,可以理解为存在父子级关系。

你的截图里,我没看到 SettingForm 的命名空间,如果是 Main.Hotfix 应该不会有错,如果是 HotFix.Runtime 那就需要调用 Main了。

@XiaoBojun
Copy link
Author

我明白了,原来是这样,谢谢

@GREAT1217
Copy link
Owner

其次,我也没看到你的 Unity 是否有编译报错,如果 Unity 编译通过,VS 不通过,可以删除解决方案重新生成下 sln 。

@XiaoBojun
Copy link
Author

嗯嗯,我知道怎么解决了,我不知道这个存在父子级关系

@GREAT1217 GREAT1217 pinned this issue Jul 4, 2023
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

2 participants