playMaker

Author Topic: Reset Variables  (Read 2337 times)

MaDDoX

  • 1.2 Beta
  • Full Member
  • *
  • Posts: 165
    • View Profile
    • FluidPlay Studios
Reset Variables
« on: May 04, 2011, 08:01:19 PM »
What if you have, in a certain state, to set multiple int/floats to zero and some gameobject variables to null? Plenty of "Set" actions right? No longer! Brought to you by Sandro Bihaiko, my business partner and our studio's lead coder, this is one of those nifty lil' things that makes your day just a bit easier :)

Enjoy!

PS.: In case you check the code and guess why did he use "Foreach", Sandro assured me that there's absolutely no performance loss compared to the regular FOR expression. He confirmed it with his friend Rodrigo Bamboo (one of Unity Technologies main software engineers and creator of the Boo language), and he said that the compiler is already fully optimized for "foreach" usage, people just forget to use the "break" to stop the loop when needed - then blame the function itself. I had no idea and trusted the popular belie.. er, myth. Happy to know better now, I also find this command much easier to code and read :)
--
Breno "MaDDoX" Azevedo
@brenoazevedo

Andrew.Lukasik

  • Full Member
  • ***
  • Posts: 134
    • View Profile
    • my twitter @andrewlukasik
Re: Reset Variables
« Reply #1 on: September 04, 2011, 04:29:28 PM »
<3