you just have to be carefully not have references to the scene. let say there are 1000 levels and every level have its own prefab and u drag them to a field on the So. and if the so is referenced in the scene, then all the prefabs will be loaded into the ram and this can cause some issues. I dont have any refence to the SOs and load them by name (index)
Great stuff :) It just came to mind, did you show how you solved the strange collision "glitches" where the ball collides with perfectly aligned cube colliders?
Did you invent this technique? I have been implementing it for my next generation Brick Breaker mobile game and haven't been able to find a single other example like this. What can I search for to find other examples? I would have assumed that many 2d puzzle games would use this paradigm, especially Match 3.
"Invent"... I don't think so 😅. It's basically a trimmed down version of what Unity does already with the scenes. We're only storing the relevant information that we need to rebuild the level at runtime. I don't have other resources handy for similar implementation :(
Resources.Load should work if you have all of your levels in a "Resources" folder. It's a little bit finnicky to make it work properly sometimes. I always have to try it with and without the file extension because I forget the way it wants it to work.
I'm sorry, I accidentally lied to you earlier. I am using Resources.LoadAll(). You can see that here: github.com/llamacademy/minigolf/blob/main/Assets/LlamAcademy/Minigolf/UI/MainMenu.cs
I did the same for my solitaire levels and used LevelSO too, naming right 🤣.
Super interesting usage, thanks for sharing !
💪 great name IMO 🤣
you just have to be carefully not have references to the scene. let say there are 1000 levels and every level have its own prefab and u drag them to a field on the So. and if the so is referenced in the scene, then all the prefabs will be loaded into the ram and this can cause some issues. I dont have any refence to the SOs and load them by name (index)
Great stuff :)
It just came to mind, did you show how you solved the strange collision "glitches" where the ball collides with perfectly aligned cube colliders?
Coming up next 🙂
Did you invent this technique? I have been implementing it for my next generation Brick Breaker mobile game and haven't been able to find a single other example like this.
What can I search for to find other examples? I would have assumed that many 2d puzzle games would use this paradigm, especially Match 3.
"Invent"... I don't think so 😅. It's basically a trimmed down version of what Unity does already with the scenes. We're only storing the relevant information that we need to rebuild the level at runtime. I don't have other resources handy for similar implementation :(
So all the Levels in the Holes Menu had their respective SO manually dragged into the main Level Data SO? They're not dynamically populated?
Yes I dragged them all. You can do a Resources.Load or do asset bundles if you’d like.
Thanks for the prompt reply! I've never had a famous TH-camr be so generous 🙂
I currently use Resources.Load, but it doesn't work in the Builds. Is it only a prototyping feature?
Resources.Load should work if you have all of your levels in a "Resources" folder. It's a little bit finnicky to make it work properly sometimes. I always have to try it with and without the file extension because I forget the way it wants it to work.
I'm sorry, I accidentally lied to you earlier. I am using Resources.LoadAll(). You can see that here: github.com/llamacademy/minigolf/blob/main/Assets/LlamAcademy/Minigolf/UI/MainMenu.cs