public void HideAllVisualEffects(MoodVFX moodVfx) { foreach (var moodVFX in _moodVFXs) { if (moodVfx.EffectContainer == moodVFX.EffectContainer) { continue; } moodVFX.EffectContainer.SetActive(false); } }
public void ChangeVisualEffect(Mood mood) { List <MoodVFX> moodVFXs = _moodVFXs.Where(m => m.Mood == mood).ToList(); if (moodVFXs.Count == 0) { return; } MoodVFX moodVFX = moodVFXs[Random.Range(0, moodVFXs.Count)]; HideAllVisualEffects(moodVFX); moodVFX.EffectContainer.SetActive(true); }