public static void AddNew(string effectName, VisualEffect prefab) { EffectManager.Effect newEffect = new EffectManager.Effect(); newEffect._effectName = effectName; newEffect._prefab = prefab; List <EffectManager.Effect> effectsList = GetAll(); effectsList.Add(newEffect); Dictionary <string, EffectManager.Effect> dictionary = GetDictionary(); if (dictionary != null) { // CreateEffectDictionary has already been called! // We need to also add this new effect to the dictionary. dictionary.Add(effectName, newEffect); } }
public static VisualEffect GetVisual(string effectName) { EffectManager.Effect effect = Get(effectName); return(effect?.GetEffect()); }