|
I currently have the following: And in the unity property inspactor script definition area I have: Now I would like to create these objects in code as I need to pass into them some parameter. How can I do this in code? In other words how can I initialize the myWalls list with the gameobjects Wall1, Wall2 and Wall3?
(comments are locked)
|
thanks for taking the time to reply but I am not sure this answer is what I am looking for. What I would like to do is eliminate the need to define Element 0, 1 and 2 in the inspector. I want to do everything in code. Something like myWalls[0] = ??; myWalls[1] = ??; myWalls[2] = ??;
Aug 18 '12 at 08:40 AM
rscholey
You can use Resources.Load or LoadAll and cycle through the elements to fill your list maybe something like that? I normally type unityscript so i apologize if i made some mistakes in syntax... i think it may be system object (lower case) rather than the JavaScript equivalent Uppercase Object. and you can use a for each type loop Sorry my C# is rusty
Aug 18 '12 at 08:46 AM
OperationDogBird
Thanks. I will try this out and mark if it worked okay which I think it will :-)
Aug 18 '12 at 08:49 AM
rscholey
(comments are locked)
|
