コード例 #1
0
 public override void onEvent(int evt, object param)
 {
     if (evt == (int)UnitEvent.AttrChanged)
     {
         AttrPlugin.EventData ed = (AttrPlugin.EventData)param;
         if (ed.attrId != (int)AttrID.Speed)
         {
             return;
         }
         for (int i = 0, max = mEffects.Count; i < max; ++i)
         {
             mEffects [i].setSpeed((float)ed.val);
         }
     }
 }
コード例 #2
0
    void onAttrChange(AttrPlugin.EventData data)
    {
        if (data.attrId == (int)AttrID.HP)
        {
            int hp = (int)data.val;
            if (hp > 0)
            {
                return;
            }
            if (isServer)
            {
                buff.addBuff(2);
            }
        }

        if (data.attrId == (int)AttrID.Speed)
        {
            scale = (float)data.val;
        }
    }
コード例 #3
0
 public override void onEvent(int evt, object param)
 {
     if (evt == (int)UnitEvent.AttrChanged)
     {
         AttrPlugin.EventData ed = (AttrPlugin.EventData)param;
         if (ed.attrId != (int)AttrID.Speed)
         {
             return;
         }
         if (mAnimtor != null)
         {
             mAnimtor.speed = (float)ed.val;
         }
         if (mAnim != null)
         {
             foreach (AnimationState state in mAnim)
             {
                 state.speed = (float)ed.val;
             }
         }
     }
 }