public void InitLevel() { //if (_player != null) Destroy(_player); PlayerCreator playerCreator = new PlayerCreator(_settings.PlayerConstructSettings); _player = playerCreator.CreatePlayer(); GateSpawner gateSpawner = new GateSpawner(_player.GetComponent <IRotatable>(), _settings.GateSettings); gateSpawner.CreateGatePools(); _roadSpawner = new RoadSpawner(_settings.RoadSettings); _roadSpawner.Init(gateSpawner.GatePools); _cameraSettings.Init(_player.GetComponent <ICameraControllable>()); }
void Start() { gs = FindObjectOfType <GateSpawner>(); player = FindObjectOfType <Player>(); }