コード例 #1
0
        public AnimationEffectData GetAnimationEffectData(AnimationEffectType type)
        {
            if (type == AnimationEffectType.NONE)
                return null;

            return m_animationEffectDic[type];
        }
コード例 #2
0
        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();
        }
コード例 #3
0
ファイル: Effect.cs プロジェクト: local-minimum/NaNoRenO2018
 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)");
     }
 }