|
So I have been trying to figure out what #pragma does. It looks like it calls some libraries but I am not sure. If it is calling libraries, what are available libraries for use and what do these libraries do? Thanks in advance everyone!
(comments are locked)
|
|
pragma is a pre-compiler directive. ie it tells the compiler what to do or how to behave. eg #strict - "be uptight when you compile this schizzle bro!" They're also very helpful in optimizing your game.
Sep 04 '11 at 12:01 AM
unluckyBastard
how are they helpful in optimizing?
Sep 04 '11 at 01:53 AM
Diet Chugg
by being strict. they won't allow you to do as dirty code. e.g. when defining a variable without #pragma you can leave out the typing and unity will figure out what the variable 's supposed to be when you use it. But the 'figuring out'-part can take a lot of resources. That's why it's considered bad habit / dirty code to not always type stuff. With #pragma you must tell of what type the variable will be and it will give you an error if you don't comply. Greetz, Ky.
Sep 06 '11 at 08:27 PM
SisterKy
Greta, now I now... the new version of MonoDevelop includes #pragma strict on all new scripts. This will keep me on my toes ;-)
Feb 17 '12 at 01:29 AM
POLYGAMe
It's Unity 3.5 that includes #pragma strict for new scripts, not MonoDevelop.
Feb 17 '12 at 01:45 AM
Eric5h5
(comments are locked)
|
