Reply To: Can I write a custom group ?

Slate Forums Support Can I write a custom group ? Reply To: Can I write a custom group ?

#1153
jakin
Participant

I want the group actor is A or B or C, so I need to craete actor by some define ID instead of using prefab for my work

It like this
void OnStart()
{
if (ID == 1) actor = GameObject.Instantiate(A_Prefab);
else if (ID == 2) actor = GameObject.Instantiate(B_Prefab);
else if (ID == 3) actor = GameObject.Instantiate(C_Prefab);
}