x


Reset script variable values automatically?

This is getting annoying- I edit a script in Unitron, I save it, and then I have to select the object (or objects, if several different prefabs share the script) it's attached to, click on the name of the script in the inspector, and select "reset" to get the variables to update.

I find myself having to do this a lot more than I would have to edit the value of a variable in the inspector. Is there an editor script or something to make it automatically reset all scripts every time you run the game?

more ▼

asked Apr 01 '11 at 05:16 PM

terablargh gravatar image

terablargh
74 6 7 15

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

2 answers: sort voted first

Have a look at this function.

more ▼

answered Apr 01 '11 at 05:37 PM

e.bonneville gravatar image

e.bonneville
5.7k 100 117 165

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

If you change the variable name, it will automatically reset ;)

more ▼

answered Apr 06 '12 at 08:21 PM

MorphVGX gravatar image

MorphVGX
31 4 6 6

(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:

x3420
x482
x356
x351
x171

asked: Apr 01 '11 at 05:16 PM

Seen: 2742 times

Last Updated: Apr 06 '12 at 08:21 PM