Example #1
0
 /// <summary>
 /// 实体死亡
 /// </summary>
 /// <param name="entityID"></param>
 /// <param name="t"></param>
 public void OnEntityDead(int entityID, ENTITY_TYPE t)
 {
     if (entityID == CurrentSelectedID ||
         entityID == EntityFactory.MainHeroID)
     {
         CurrentSelectedID = -1;
         ChangeBossBloodTarget(-1);
     }
     if (t == ENTITY_TYPE.TYPE_MONSTER)
     {
         if (m_BloodMap.ContainsKey(entityID))
         {
             CacheBlood(m_BloodMap[entityID]);
         }
         if (BossBloodEntityTable.ContainsKey(entityID))
         {
             BossBloodProityList.Remove(BossBloodEntityTable[entityID]);
             BossBloodEntityTable.Remove(entityID);
         }
         EntityLeaveBossBloodDistance(entityID);
     }
     if (t == ENTITY_TYPE.TYPE_PLAYER_ROLE)
     {
         SetDead(entityID, true);
     }
 }
Example #2
0
    /// <summary>
    /// 实体死亡
    /// </summary>
    /// <param name="entityID"></param>
    public static void OnEntityDead(int entityID, ENTITY_TYPE t)
    {
        if (Movie.GetSingleton <GfxBloodMovie>() == null)
        {
            return;
        }
        if (entityID == CurrentSelectedID ||
            entityID == EntityFactory.MainHeroID)
        {
            CurrentSelectedID = -1;
            ChangeBossBloodTarget(-1);
        }

        //怪物
        if (t == ENTITY_TYPE.TYPE_MONSTER)
        {
            if (m_BloodMap.ContainsKey(entityID))
            {
                if (OptimitzedControlPlane.Instance.EnityCreateOptimize)
                {
                    CacheBlood(m_BloodMap[entityID]);
                }
                else
                {
                    Destroy(m_BloodMap[entityID]);
                }
            }

            if (BossBloodEntityTable.ContainsKey(entityID))
            {
                BossBloodProityList.Remove(BossBloodEntityTable[entityID]);
                BossBloodEntityTable.Remove(entityID);
            }

            EntityLeaveBossBloodDistance(entityID);
        }

        //玩家
        if (t == ENTITY_TYPE.TYPE_PLAYER_ROLE)
        {
            if (m_BloodMap.ContainsKey(entityID))
            {
                //如果是主角,特殊处理一下
                if (entityID == EntityFactory.MainHeroID)
                {
                    bPlayerDead = true;
                    m_BloodMap[entityID].SetPlayerVisible(false);
                }
                m_BloodMap[entityID].SetVisible(false);
            }
        }
    }