Do you feel like this basic service locator💻is not enough? If you want to add contexts (GameObject, scene and project), I just released a follow-up tutorial📖for supporters on my Patreon - www.patreon.com/posts/112983319. Check it out!
I've been learning so much from you, your marching cube, triplanar and shaders videos saved me, you're always my reference channel to learn unity, I think your work is so incredible, I really want your channel to grow
One question, do you intend to make a continuation video of the marching cube one day, bringing lod and implementing transvoxel to fix the seams problem? About lods your algorithm is very easy to implement lods, just skip the iteration vertices of the mesh in the code, and increase the size of the indexing cubes to get the correct noise
Thank you for the kind words! I am glad I could help. Currently I am focusing more on writing clean code and learning about the design patterns. Additionaly I would like to finish the game I am working on. Marching cubes is definitely an interesting topic and I would love to make a longer series about it. Unfortunately, right now it is not my priority. Maybe some time in the future.
Some people like to use dependency injection more as typically, you are passing the dependecies through a constructor. Then you can easily see which dependencies a class has. On the other side, with the service locator, the class is getting the dependencies directly from the service locator. I think that both approaches are valid and you can mix them as you want. Dependency injection framework like Zenject is really similiar to the service locator, it just has more functionality that I didn't add in the video. So all of these techniques will help you to achieve the same thing.
10:01 During Start() how can you be sure that ISoundService was created and registered in service locator? Can this code be redone in a self-sufficient manner?
ServerInstaller 7:10 creates/installs the services in its Awake, which always runs before any Start. Still the possibility that a service locator may be not registered and be null exist, that's why he is checking for null (with ?) every time the turret script tries to use them.
Additionaly, you could crete some IService interface that all services should follow and would also include a function to create some default implementation for each service. If the service locator would notice that a service is not registered, it could call the function to create some default implementation of a service and use that one.
Do you feel like this basic service locator💻is not enough? If you want to add contexts (GameObject, scene and project), I just released a follow-up tutorial📖for supporters on my Patreon - www.patreon.com/posts/112983319. Check it out!
I've been learning so much from you, your marching cube, triplanar and shaders videos saved me, you're always my reference channel to learn unity, I think your work is so incredible, I really want your channel to grow
One question, do you intend to make a continuation video of the marching cube one day, bringing lod and implementing transvoxel to fix the seams problem?
About lods your algorithm is very easy to implement lods, just skip the iteration vertices of the mesh in the code, and increase the size of the indexing cubes to get the correct noise
Thank you for the kind words! I am glad I could help. Currently I am focusing more on writing clean code and learning about the design patterns. Additionaly I would like to finish the game I am working on. Marching cubes is definitely an interesting topic and I would love to make a longer series about it. Unfortunately, right now it is not my priority. Maybe some time in the future.
SOOOOOOOOOO! GOOOOD!!!
Thank you
Definately a handy pattern, but how it's called anti-patern?
Can the dependency injection (Zenject) cover the same tasks?
Some people like to use dependency injection more as typically, you are passing the dependecies through a constructor. Then you can easily see which dependencies a class has. On the other side, with the service locator, the class is getting the dependencies directly from the service locator. I think that both approaches are valid and you can mix them as you want. Dependency injection framework like Zenject is really similiar to the service locator, it just has more functionality that I didn't add in the video. So all of these techniques will help you to achieve the same thing.
10:01 During Start() how can you be sure that ISoundService was created and registered in service locator?
Can this code be redone in a self-sufficient manner?
ServerInstaller 7:10 creates/installs the services in its Awake, which always runs before any Start. Still the possibility that a service locator may be not registered and be null exist, that's why he is checking for null (with ?) every time the turret script tries to use them.
Additionaly, you could crete some IService interface that all services should follow and would also include a function to create some default implementation for each service. If the service locator would notice that a service is not registered, it could call the function to create some default implementation of a service and use that one.