void Awake() { plantsDatabase = new PlantsDatabase(this); singleSpawner = new SinglePlantSpawner(); fieldSpawner = new FieldPlantSpawner(); singleSpawner.InjectSettings(this); fieldSpawner.InjectSettings(this); }
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; }