x


what is #pragma

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?

 #pragma strict
 #pragma implicit
 #pragma downcast

Thanks in advance everyone!

more ▼

asked Sep 03, 2011 at 09:45 PM

Diet Chugg gravatar image

Diet Chugg
479 69 64 80

(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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!"

more ▼

answered Sep 03, 2011 at 11:57 PM

yatayata gravatar image

yatayata
61 4 3 4

They're also very helpful in optimizing your game.

Sep 04, 2011 at 12:01 AM unluckyBastard

how are they helpful in optimizing?

Sep 04, 2011 at 01:53 AM Diet Chugg

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, 2012 at 01:29 AM POLYGAMe

It's Unity 3.5 that includes #pragma strict for new scripts, not MonoDevelop.

Feb 17, 2012 at 01:45 AM Eric5h5

Ah, makes sense... since I was opening it through Unity ;-)

Feb 17, 2012 at 05:37 AM POLYGAMe
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x98
x36

asked: Sep 03, 2011 at 09:45 PM

Seen: 6740 times

Last Updated: Jun 10, 2013 at 03:32 PM