void Awake() { plantsDatabase = new PlantsDatabase(this); singleSpawner = new SinglePlantSpawner(); fieldSpawner = new FieldPlantSpawner(); singleSpawner.InjectSettings(this); fieldSpawner.InjectSettings(this); }
public void InjectSettings(SimulationSettings s) { manager = World.Active.GetOrCreateManager <EntityManager>(); settings = s; database = s.plantsDatabase; terrain = settings.simulationTerrain; terrainData = terrain.terrainData; terrainSize = terrainData.size; terrainOrigin = terrain.transform.position; }
void Start() { manager = World.Active.GetOrCreateManager <EntityManager>(); syncTransforms = World.Active.GetOrCreateManager <SyncTransformSystem>(); singleSpawner = settings.singleSpawner; fieldSpawner = settings.fieldSpawner; mainCamera = Camera.main; terrainMask = LayerMask.NameToLayer("Terrain"); plantsMask = LayerMask.NameToLayer("Plants"); WindSpeedChange(100f); WindDirectionChange(0); database = settings.plantsDatabase; }