public void Init() { obstacleManager = this.gameObject.GetComponent <ObstacleManager>(); itemManager = this.gameObject.GetComponent <ItemManager>(); _pos = Vector3.zero; _rota = Vector3.zero; for (int i = 0; i < OBJ_MAX; i++) { if (!Obstacle_OFF) { obstacleManager.Init(i, ref _pos, ref _rota); } else { RandPosRota(); } if (!Item_OFF) { itemManager.Init(i, _pos, _rota); } } }