Example #1
0
 public ObstacleSpawningController(
     ObstacleEntityFactory obstacleEntityFactory,
     ObstacleEntityConfig obstacleEntityConfig,
     ScreenSizeModel screenSizeModel)
 {
     _obstacleEntityFactory = obstacleEntityFactory;
     _obstacleEntityConfig  = obstacleEntityConfig;
     _screenSizeModel       = screenSizeModel;
 }
Example #2
0
        public ObstacleEntityFactory(ObstacleEntityConfig obstacleEntityConfig)
        {
            _obstacleEntityConfig = obstacleEntityConfig;

            var conversionSettings = GameObjectConversionSettings.FromWorld(
                World.DefaultGameObjectInjectionWorld,
                new BlobAssetStore().AddTo(Disposer)); // ToDo [ECS] Is this correct?

            _entityPrefabs = _obstacleEntityConfig.Prefabs
                             .Select(prefab => GameObjectConversionUtility.ConvertGameObjectHierarchy(
                                         prefab,
                                         conversionSettings))
                             .ToList();
        }