Although I still love the functionality and ease of use that Linq provides, the particular project that I'm working on seems to show LINQ's true colors in comparison to a generic for loop iteration. I'm still opting to use a List for my object recycler, but LINQ has proven to be more than 5 times slower on an ipad or iphone 4 in my tests than iterating generically. I'm spawning objects and picking random ones in the List almost every second and even more than that over time, it's too slow.
@prime31studios your tutorials are extremely helpful. Not only do you completely explain everything in an organized and learned manner, but you also make the assumptions that these advanced methods are being watched by novices and point out everything in a logical and compiler-driven dialogue. I wish more tutorial creators / teachers were as good as you, and I hope you find the time and willingness to provide more advanced scripting / programming tutorials. These practices answer a lot of ?'s
@jjonasz absolutely. It would work well for particle prefabs. You could even get a bit fancy with it (and this really depends on your game) and have it expand as more explosions come and then it could contract as well if there is a part of your game that may have a whole bunch of explosions at the same time then it will be far less the rest of the level.
@prime31studios Thanks! So if a gameobject is not active, then there's no drain on cpu resources, right?
If I want to make a recycler for explosions, then should I put it in a new script that handles the explosions (or a level manager script) or put it in my bullet's script (which is currently where explosions are being instantiated because that is where the collision detection occurs)?
@jjonasz right. inactive game objects dont strain CPU but they do still take up some memory. I would put the explosion recycler on your level manager. That way it can be accessed from all your bullet scripts easily.
Another great tutorial! Hope Unity guys will soon make some kind of flag that will allow to preload all data for instantiated item. Right now one can pre-instantiate an item but for example textures won't be loaded until the object gets rendered.
Although I still love the functionality and ease of use that Linq provides, the particular project that I'm working on seems to show LINQ's true colors in comparison to a generic for loop iteration. I'm still opting to use a List for my object recycler, but LINQ has proven to be more than 5 times slower on an ipad or iphone 4 in my tests than iterating generically. I'm spawning objects and picking random ones in the List almost every second and even more than that over time, it's too slow.
dannnyskim 2 months ago
Comment removed
dannnyskim 2 months ago
@prime31studios your tutorials are extremely helpful. Not only do you completely explain everything in an organized and learned manner, but you also make the assumptions that these advanced methods are being watched by novices and point out everything in a logical and compiler-driven dialogue. I wish more tutorial creators / teachers were as good as you, and I hope you find the time and willingness to provide more advanced scripting / programming tutorials. These practices answer a lot of ?'s
dannnyskim 2 months ago in playlist More videos from prime31studios
@dannnyskim many thanks and glad you enjoyed the tutorials!
mikeprime31 2 months ago
Would it be beneficial to do this for particle prefabs, say explosions? Or are those best left to be instantiated normally?
jjonasz 1 year ago
@jjonasz absolutely. It would work well for particle prefabs. You could even get a bit fancy with it (and this really depends on your game) and have it expand as more explosions come and then it could contract as well if there is a part of your game that may have a whole bunch of explosions at the same time then it will be far less the rest of the level.
prime31studios 1 year ago
@prime31studios Thanks! So if a gameobject is not active, then there's no drain on cpu resources, right?
If I want to make a recycler for explosions, then should I put it in a new script that handles the explosions (or a level manager script) or put it in my bullet's script (which is currently where explosions are being instantiated because that is where the collision detection occurs)?
jjonasz 1 year ago
@jjonasz right. inactive game objects dont strain CPU but they do still take up some memory. I would put the explosion recycler on your level manager. That way it can be accessed from all your bullet scripts easily.
prime31studios 1 year ago
@prime31studios Awesome, thanks!
jjonasz 1 year ago
Please keep the videos coming, they're great.
Jon23Davis 1 year ago
Another great tutorial! Hope Unity guys will soon make some kind of flag that will allow to preload all data for instantiated item. Right now one can pre-instantiate an item but for example textures won't be loaded until the object gets rendered.
yonoslaw 1 year ago
Comment removed
Xraller 1 year ago
a big THANK YOU for the quality and effort you are putting into these series
septien 1 year ago
@septien we're just glad someone is watching these and hopefully learning something new!
prime31studios 1 year ago
nicely done tut vid. Thank you. Thanks for sharing walkthroughs on some of the more advanced Unity C# techniques.
3duaun 1 year ago