print(“Hello World”)
I was using the FPS1 tutorial set(http://forum.unity3d.com/threads/139276-ETeeskiTutorials-FPS1-42-Inverse-Kinematic-Arm-Tutorial-scripts-and-project-download) and translating it to c#. I wanted make a gun manager. I made a class containing all necessary public variables and I made an array of classes.
Question: How do I go through this array? Thanks in advance
for loops are very easy, practically the same as they are in js.
for(int i = 0; i < classArray.Length; i++)
{
classArray *= new ClassType();*
// or
ClassType item = classArray*;*
// item.functions(arguments);
// item.variables = values;
}
or if you don’t need to set the value if the array you can do a foreach
foreach(ClassType item in classArray)
{
//item.functions(arguments);
//item.variables = values;
}