public AnimationEffectData GetAnimationEffectData(AnimationEffectType type)
        {
            if (type == AnimationEffectType.NONE)
                return null;

            return m_animationEffectDic[type];
        }
        public void PlayAnimationEffect(AnimationEffectType type, Vector2 position)
        {
            if (type == AnimationEffectType.NONE) return;

            AnimationEffect aEffect = m_animationEffectPool.Borrow();
            if (aEffect == null) return;

            AnimationEffectData aData = GetAnimationEffectData(type);
            if (aData == null) { aEffect.Stop(); return; }

            aEffect.transform.position = position;
            aEffect.Init(aData);
            aEffect.Play();
        }
Esempio n. 3
0
 public EffectAnimation(Dictionary <string, string> tmp)
 {
     if (tmp.ContainsKey("trigger"))
     {
         trigger = tmp["trigger"];
         type    = AnimationEffectType.Trigger;
     }
     else if (tmp.ContainsKey("bool"))
     {
         try
         {
             boolean = bool.Parse(tmp["bool"]);
         } catch (System.FormatException)
         {
             Debug.LogError(string.Format("Animation Effect got malformed bool: {0}", tmp["bool"]));
         } finally {
             type = AnimationEffectType.Bool;
         }
     }
     else if (tmp.ContainsKey("float"))
     {
         try
         {
             _float = float.Parse(tmp["float"]);
         }
         catch (System.FormatException)
         {
             Debug.LogError(string.Format("Animation Effect could not parse float: {0}", tmp["float"]));
         }
         finally
         {
             type = AnimationEffectType.Float;
         }
     }
     else
     {
         Debug.LogError("Animation Effect doesn't have any effect (trigger/bool/float)");
     }
 }