x


How can I set the static checkbox of a GameObject in an editor script?

I'm trying to write an editor script to get models into unity3d (iphone) which have a lot of their setup already dealt with.

I'd like to be able to specify that a transform, or gameobject is static as if i'd ticked the checkbox in the editor, but can't seem to see a way to do this.

Is it possible? What member controls this property?

Cheers

more ▼

asked Jan 24 '10 at 09:45 PM

jimbobuk gravatar image

jimbobuk
1.1k 34 42 54

I don't think you can but if it is possible I sure would like to know as well :-)

Jan 25 '10 at 12:20 AM Jaap Kreijkamp
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

The GameObject class has a property called isStatic that you can use from editor scripts.

more ▼

answered Jan 25 '10 at 03:21 PM

andeeee gravatar image

andeeee ♦
1.4k 3 6 18

Thanks a lot. That works great, I was at the transform level and didn't think to peak into the corresponding gameobject. That's great, I can automatically assign static as required now. Cheers

Jan 26 '10 at 12:37 AM jimbobuk
(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:

x2087
x1999
x1278
x348

asked: Jan 24 '10 at 09:45 PM

Seen: 2531 times

Last Updated: Jan 26 '10 at 12:43 AM