Added: 1 year ago
From: prime31studios
Views: 2,049
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (15)

Sign In or Sign Up now to post a comment!
  • 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.

  • Comment removed

  • @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 many thanks and glad you enjoyed the tutorials!

  • Would it be beneficial to do this for particle prefabs, say explosions? Or are those best left to be instantiated normally?

  • @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.

  • @prime31studios Awesome, thanks!

  • Please keep the videos coming, they're great.

  • 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.

  • Comment removed

  • a big THANK YOU for the quality and effort you are putting into these series

  • @septien we're just glad someone is watching these and hopefully learning something new!

  • nicely done tut vid. Thank you. Thanks for sharing walkthroughs on some of the more advanced Unity C# techniques.

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more