Example #1
0
 public void OnHitted(float damage)
 {
     if (m_PlayerData.CanBeHitted())
     {
         if (m_BuffMgr.CheckHasBuff(BuffType.NaNoboostBuff))
         {
             return;
         }
         int dodgeVal = GetDodgeVal();
         if (dodgeVal > 0)
         {
             int randVal = Random.Range(0, 101);
             if (randVal < dodgeVal)
             {
                 GameObject missObj = Global.gApp.gResMgr.InstantiateObj(EffectConfig.Fighttips_miss);
                 missObj.transform.SetParent(transform, false);
                 return;
             }
         }
         if (m_BuffMgr.CheckHasBuff(BuffType.ShieldBuff))
         {
             m_BuffMgr.RemoveBuff(BuffType.ShieldBuff);
             m_PlayerData.ResetProtectTime();
             return;
         }
         m_PlayerData.OnHit(damage);
     }
 }
Example #2
0
 public virtual void Update(float dt)
 {
     m_CurTime = m_CurTime + dt;
     if (m_CurTime >= m_Duration)
     {
         m_BuffMgr.RemoveBuff(this);
     }
 }