public void Switch(int i) { i = (int)Mathf.Clamp(i, 0, obj.Length - 1); generator.obj = obj [i]; generator.CheckPooled(); }