protected override void OnStartRunning() { _cellsArchetype = EntityManager.CreateArchetype( typeof(CellContent), typeof(CellPosition), typeof(CellSelectionFlag), typeof(WorldPositionLink)); _helper = new GameStateHelper(EntityManager, Entities); }
protected override void OnStartRunning() { _positionConverter = GameStateHelper.CreateWorldPositionConverter(Entities); _gameHelper = new GameStateHelper(EntityManager, Entities); for (int i = 0; i < _gameHelper.GetSize().Width; i++) { for (int j = 0; j < _gameHelper.GetSize().Height; j++) { Transform cellBack = GameObject.Instantiate(_cellBackPrefab).transform; Vector2 woorldPosition = _positionConverter.LogicToWorld(new Vector2(i, j)); cellBack.position = new Vector3(woorldPosition.x, woorldPosition.y); } } }
protected override void OnStartRunning() { _converter = GameStateHelper.CreateWorldPositionConverter(Entities); }