private void ToggleWeatherParticle(BiomeType biomeType, bool state) { if (biomeType == BiomeType.NONE) { return; } WeatherComponent ActiveComponents = BiomeEffects[biomeType].GetComponent <WeatherComponent>(); ActiveComponents?.WindZone.gameObject.SetActive(state); foreach (var item in ActiveComponents.WeatherParticles) { item.enableEmission = state; } foreach (ParticleSystem item in ActiveComponents.AmbienceParticle) { item.enableEmission = state; } }
public void ManualBoardSwap(BiomeType boardType) { if (boardType != Type) { SwitchToBiome(BiomeAmbiences[boardType]); WeatherComponent ActiveComponents = BiomeEffects[Type].GetComponent <WeatherComponent>(); ActiveComponents?.WindZone.gameObject.SetActive(false); foreach (ParticleSystem item in ActiveComponents.WeatherParticles) { item.gameObject.SetActive(false); } foreach (ParticleSystem item in ActiveComponents.AmbienceParticle) { item.gameObject.SetActive(false); } ToggleWeatherParticle(boardType, true); Type = boardType; } }