I very little scripting and/or programming experiuence, but i am a quick study. This is my first real work with array, so i dont fully understand the concepts yet, but im getting there.
using Unity Script
What i am trying to do is dynamically create an array from objects stored in a built in array. I want the the new array to add objects that meet certain conditions. From this array, one of the objects will be 'randomly' selected for instantiation.
-Built in array ARR contains objects A, B and C.
-each object has property X.
-Build array New by adding ojects from ARR with an X value above 10.
-get resulting size of array New, and use that as the max value in a random range
Is this possible? Is it the right way to acheive my end result?
Did you read the manual? http://docs.unity3d.com/Documentation/ScriptReference/Array.html Let us know if that doesn't answer your question.
answered Aug 01 '12 at 12:07 AM
After a bit of trial and error, i came up with something that worked. This is the pertinent part of the script afer cleanup. I have tested it and it does what i want. Forgive the amature code. If anyone sees a better way to do any of this, or see something i missed, let me know.
objTbl.Push(obj); } } }