Как сделать массив из GameObject в C#?
Как сделать массив из GameObject в C# и обращаться к ним для их невидимости? Вот GameObject которые надо пихнуть в массив:
public GameObject pot_1;
public GameObject pot_2;
public GameObject pot_3;
public GameObject pot_4;
public GameObject pot_5;
public GameObject pot_6;
public GameObject pot_7;
public GameObject pot_8;
public GameObject pot_9;
public GameObject pot_10;
И ещё, где надо создавать массив, в методе Start или же просто в Class?
Ответы (1 шт):
Автор решения: Sandra Lee
→ Ссылка
вот так в Start пихай GameObject[] pots = new GameObject[10] {pot_1,pot_2,pot_3,pot_4,pot_5,pot_6,pot_7,pot_8,pot_9,pot_10}