static TowerFactory() { Parameters = TowerParameters.Instance; EntityManager = World.DefaultGameObjectInjectionWorld.EntityManager; //TODO: Implement EntityArechtype for towers Archetype = EntityManager.CreateArchetype(new ComponentType[] { ComponentType.ReadWrite <LocalToWorld>(), ComponentType.ReadWrite <Translation>(), ComponentType.ReadWrite <Rotation>(), ComponentType.ReadWrite <Targetting>(), ComponentType.ReadOnly <TowerTag>() }); }
public void Construct(Vector3 position, TowerData towerData, CreepsManager creepsManager, Bullet.Factory bulletFactory) { TowerData = towerData; TowerParameters = new TowerParameters(TowerData); _towerVisual = new TowerVisual(this, TowerData); _towerTargeting = new TowerTargeting(this, creepsManager); _towerShooting = new TowerShooting(this, bulletFactory); gameObject.transform.position = position; _towerVisual.SetupVisual(); }