x


Storing information in an object

I am in the process of making a game, where there will be randomly generated a lot of planets. Atm. I'm making the "proof of concept" and are using spheres to represent each planet. When you click a planet it is selected and various information are to be shown on the gui, like name, planet type, size, etc.

My question is: How would I go about storing the information "in" the spheres? Attaching a script to contain the values won't work if I random generate a lot of planets.

more ▼

asked Apr 02 '12 at 05:50 PM

Mekuri gravatar image

Mekuri
2 1 2 2

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

1 answer: sort voted first

I'm not sure why a script shouldn't work... That's actually the only way. What's the problem of attaching a script that holds the additional information? You can even add the script via script (AddComponent). What kind of information do you want to store and where will this information come from when you create them randomly? I guess it wold help when you can go a bit more in detail what concept you have in mind.

more ▼

answered Apr 02 '12 at 06:32 PM

Bunny83 gravatar image

Bunny83
45.2k 11 49 207

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

x16
x14
x7

asked: Apr 02 '12 at 05:50 PM

Seen: 364 times

Last Updated: Apr 02 '12 at 06:32 PM