Example #1
0
        private void Entity_LeaveView(EntityView ev)
        {
            if (ev == null || ev.StateMachine == null)
            {
                return;
            }

            ev.StateMachine.OnLeaveView();
            MapFinderManager.RemoveObject(ref ev);
            LogicDataCenter.warMinimapDataManager.UpdateObjectVisiblity(ev);
        }
Example #2
0
    // 进入状态
    public bool OnEnter(IntPtr lParam)
    {
        //if (m_pFSM.animator)
        //{
        //    m_pFSM.animator.SetTrigger("BreakAttack");
        //    m_pFSM.animator.SetBool("isDead", true);
        //   m_pFSM.animator.Play("Dead");

        //}

        cmd_creature_die cmdDie    = IntPtrHelper.toData <cmd_creature_die>(lParam);
        ulong            uMurderID = cmdDie.uMurderID;

        m_pFSM.SetAnimatorTrigger("BreakAttack");
        m_pFSM.SetAnimatorBool("isDead", true);
        m_pFSM.AnimatorPlay("Dead");
        m_pFSM.outLineCount = m_pFSM.outLineCount - 1;
        m_pFSM.setHightLight(false);

        //关闭死亡时要求关闭的光效
        LightingEffectManager light = m_pFSM.GetComponent <LightingEffectManager>();

        if (light)
        {
            light.CloseLightingWhenDead();
        }

        ////暂时让角色死亡不让射线检测该层
        //nOldLayer = m_pFSM.gameObject.layer;
        //GameUtil.SetLayer(LayerMask.NameToLayer(Config.LayerNeutrality), m_pFSM.gameObject, true);

        //if (m_pFSM.SkinConfig)
        //{
        //    if (m_pFSM.SkinConfig.ScreenCastObject)
        //    {
        //        m_pFSM.SkinConfig.ScreenCastObject.layer = LayerMask.NameToLayer(Config.LayerPlayerFriend);
        //    }

        //}
        //else
        //{
        //    Debug.Log(m_pFSM.entityID.ToString());
        //}

        if (m_pFSM.SkinConfig != null && m_pFSM.SkinConfig.ColliderShape != null)
        {
            m_pFSM.SkinConfig.ColliderShape.enabled = false;
        }
        m_pFSM.pickableCount--;

        //GfxBloodManager.OnEntityDead(m_pFSM.entityID,ENTITY_TYPE.TYPE_MONSTER);
        USpeedUI.Blood.UBloodManager.Instance.OnEntityDead(m_pFSM.entityID, ENTITY_TYPE.TYPE_MONSTER);
        //TopNameManager.OnEntityDead(m_pFSM.entityID, ENTITY_TYPE.TYPE_MONSTER);
        isOnThisState      = true;
        MaxDeadTimeCounter = 0.0f;

        int nEntityID = m_pFSM.entityID;

        U3D_Render.EntityView ev = EntityFactory.getMonsterViewByID(nEntityID);
        addMonsterEffect(ev, uMurderID);

        //死亡通知引导,死亡时间不确定,目前只想到在这硬编码了
        if (ev.CampFlag == SPELL.CampFlag.CampFlag_Enemy && ev.Type == ENTITY_TYPE.TYPE_MONSTER && ev.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_SEX) == (int)MONSTER_TYPE.MONSTER_TYPE_TOWER)
        {
            GUIDE.GuideManager.Instance.SetBBValue(GUIDE.EGuideBBKey.DeadEntityID, ev.ID);
        }

        if (ev != null)
        {
            MapFinderManager.RemoveObject(ref ev);
        }

        return(true);
    }