コード例 #1
0
 void HandleEffect(BeHitEffect effect, LooksInfo looks)
 {
     if (effect.Status == EffectStatus.WaitForRender)
     {
         if (looks.CurState == LooksInfo.State.Loaded)
         {
             var trans = EntityManager.GetComponentObject <Transform>(looks.LooksEntity);
             EffectUtil.SetHitEffectColor(trans, new Color(1, 1, 1, 1), true);
             effect.Status = EffectStatus.Rendering;
         }
     }
     else if (effect.Status == EffectStatus.Rendering)
     {
         long curTime = TimeEx.ServerTime;
         if (curTime >= effect.EndTime)
         {
             if (looks.CurState == LooksInfo.State.Loaded)
             {
                 var trans = EntityManager.GetComponentObject <Transform>(looks.LooksEntity);
                 EffectUtil.SetHitEffectColor(trans, new Color(1, 1, 1, 0), false);
             }
             effect.Status = EffectStatus.None;
         }
     }
 }
コード例 #2
0
 void HandleSuckHPAndHit(SuckHPEffect suckHP, BeHitEffect beHit)
 {
     //如果同时有吸血和受击,那吸血优先
     if (suckHP.IsShowing() && beHit.IsShowing())
     {
         beHit.Status = EffectStatus.None;
     }
 }