When I try to assigning “Attendance Items” in the class:
public class Attendance
{
public Camera eventCamera;
public GameObject eventTrigger;
public GameObject msgZeCanvas;
public obslObj [] AttendanceItems ;
}
whose elements are:
public class obslObj
{
public GameObject items;
public Rigidbody rbItem;
}
when I try iteration in loop I have problem, because I cannot relate to the length of the array’s function.
Lenght:
for (int i=0; i<Attendance.AttendanceItems.Length; i++)
as well as
foreach (obslObj item in Attendance.AttendanceItems)
which are included in another class:
public class AttendanceEventScript: MonoBehaviour
When I try to compile I get the error:
AttendanceEventScript.cs (39,69):
error CS0120: An object reference is
required is access non-static member
`Attendance.AttendanceItems’
Any ideas?