public void AddEffect(GameObject parent, AnimationType type, BubbleDeathType deathType, bool blocking) { if (!EffectDictionary.ContainsKey(deathType)) { EffectDictionary.Add(deathType, new List <IEnumerator>()); } var effect = blocking ? AnimationEffect.PlayAndRegister(parent, type, RegisterBlockers) : AnimationEffect.Play(parent, type); EffectDictionary[deathType].Add(effect); }
private List <IEnumerator> GetDefaultEffects(BubbleDeathType type) { var effects = new List <IEnumerator>(); var model = gameObject.GetComponent <BubbleModelBehaviour>().Model; if (model.definition.AnimationMap.ContainsKey(type)) { foreach (var animationType in model.definition.AnimationMap[type]) { effects.Add(AnimationEffect.PlayAndRegister(gameObject, animationType, RegisterBlockers)); } } return(effects); }