Author Topic: Best practices?  (Read 1659 times)

bobledo28

  • Guest
Best practices?
« on: August 30, 2012, 06:01:23 AM »
Hi, I have been checking some of the examples, and I have come across where lots of buttons are created on runtime.

I thought the best practice was to not create things on runtime.

example:

If I got an ingame menu options,  should I have created the menu when starting the application making it disabled and make it visible when requested, or should I create the different menu options during runtime?

Thanks

ENAY

  • Full Member
  • ***
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 248
    • View Profile
Re: Best practices?
« Reply #1 on: August 30, 2012, 07:28:09 AM »
Unless you manually want to hardcode your prefabs, there is nothing stopping you preparing them in the Atlas before hand. Problem is, it is a pain changing the atlases later as you have to do each one by hand.
The examples have everything created in runtime as that is basically the entire program. In a real game of course you will stagger your Instantiates across your program when you need them to make the load time less noticable.

Depends on your game/program though to decide your best needs.