-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor Global State #39
Conversation
…he` into `ResourceLoader` `ResourceLoader` is a far more obvious name for a class which loads assets from disk. It also makes a lot of sense to move basically everything that has to do with loading these assets into one class to avoid scattering it across many files.
… callees Additionally, touches `WaynetCreator`, `VobCreator` and `WorldCreator`
Hi Luis. Some findings: GameConfiguration.cs
|
This is a weird issue I only found through `git bisect`. It must have something to do with the shaders but really? I have to call `InitSky` AFTER I'm done settings up the meshes? How peculiar.
Ready for review. Please test: Everything 😄 Most important bits:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lmichaelis . Nicely done. I added my remarks at the specific code parts. Feel free to comment, use, or decline at your own judgement.
Tested:
- Lab
Open to test:
- Normal game
A few general questions about the source code:
- You removed the SingletonBehaviour<?> from all/most of the *Manager.cs classes. Whenever we don't need more than 1 instance, we made classes static (Only reason was to show: Hey, I'm existing only once!). Is there a use case why this class isn't static? We could also make this class static and call an Init() function.
- Some classes like GlobalEventDispatcher or IGlobalDataProvider don't sound like our classes. I suggest we think about a common prefix for class names, which sound like Unity ones. Goal: To distinguish easily between our logic and Unity's. I'm happy to change my mind, but want to discuss it with you first.
- GameManager is handling all the Unity events like Update(), LateUpdate(), FixedUpdate(). My first idea was: The managers should take care of it on their own. Can you explore the benefits and drawbacks a little bit better, please. I'm on the fence right now.
The idea here is to make the dependencies explicit. So, if a manager requires another manager to function correctly, we need to make sure that the other manager is properly initialized before its used. Passing them explicitly (-> dependency injection) helps make that dependency obvious to anyone inspecting the code.
Hm maybe. I'd suggest we discuss a naming scheme internally and then add that to the style guide. Then we can rename all of the existing classes (since we'll probably need to rename others too).
With this setup, the managers cannot take care of this because they're not |
Hi @lmichaelis I thought about it and fully agree for the managers:
Please add a few information on the docs about the Manager handling and where they're initialized, then I'm fine about the three topics above. |
I tested the main game including MainMenu, NPCs, and world switching. Except from the two texture issues (Textures of NPCs+Vobs in Lab scene + image frame in Gomez' throne room), everything works fine! Please go on. |
…njection # Conflicts: # Assets/Gothic-UnZENity-Core/Scripts/Caches/PrefabCache.cs # Assets/Gothic-UnZENity-Core/Scripts/Manager/XRDeviceSimulatorManager.cs # ProjectSettings/ProjectSettings.asset
Looks great. I will check with the lab issue. I also think it's related to my opened Unity. |
Draft PR to track issues or change requests for new GUZ architecture.