Beispiel #1
0
    public void EnableAccelerate(bool acc, float speed)
    {
        if (!m_bWing) //不是翅膀不加速
        {
            return;
        }
        if (accelerate != acc)
        {
            if (m_pFSM.animator)
            {
                m_pFSM.animator.SetBool("AccelerateFloat", acc);
            }
            if (wingAnimator)
            {
                wingAnimator.SetBool("AccelerateFloat", acc);
            }

            if (m_pFSM.isHero)
            {
                if (acc)
                {
                    ImageEffects.ImageEffectManager.API_EnableImageEffect <ImageEffects.RadialBlur>();
                    LightingEffectManager lightEffect = m_pFSM.GetComponent <LightingEffectManager>();
                    lightEffect.BindLighting(99998); //加速飞行默认99998号光效
                    lightEffect.BindLighting(281);   //加速飞行默认281号光效
                    lightEffect.BindLighting(282);   //加速飞行默认282号光效
                }
                else
                {
                    ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.RadialBlur>();
                    LightingEffectManager lightEffect = m_pFSM.GetComponent <LightingEffectManager>();
                    lightEffect.RemoveLighting(99998);
                    lightEffect.RemoveLighting(281);
                    lightEffect.RemoveLighting(282);
                }
            }
        }

        m_maxSpeed = speed;
        accelerate = acc;
    }
Beispiel #2
0
    ///// <summary>
    ///// 死亡前的碰撞层
    ///// </summary>
    //private int nOldCollisionLayer = -1;
    // 进入状态
    public bool OnEnter(IntPtr lParam)
    {
        //退出假死状态
        if (m_pFSM != null && m_pFSM.animatorCtrl != null)
        {
            m_pFSM.animatorCtrl.Dying = false;
        }

        Debug.Log("on OnEnter CreaturePosture_Dead " + this.m_pFSM.name);
        if (m_pFSM.showLog)
        {
            Trace.Log(m_pFSM.name + "=======OnEnter CreaturePosture_Dead======");
        }

        cmd_creature_die context = IntPtrHelper.toData <cmd_creature_die>(lParam);

        if (m_pFSM.showLog)
        {
            Trace.Log("DeadInterval:" + context.nDeadInterval);
            Trace.Log("reborn second:" + context.nInterval);
        }



        m_pFSM.rebornTick = context.nInterval - context.nDeadInterval;
        if (m_pFSM.rebornTick <= 0)
        {
            Trace.Log("rebornTick <= 0!");
            //return false;                   吃鸡地图,这个时差是0,所以先不要返回
        }
        m_nDeadInterval = context.nDeadInterval;

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

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

        SkillCtrl sk = m_pFSM.GetComponent <SkillCtrl>();

        if (sk)
        {
            sk.enabled = false;
        }

        SoldierController sco = m_pFSM.GetComponent <SoldierController>();

        if (sco)
        {
            sco.dead = true;
        }

        if (m_pFSM.animator)
        {
            m_pFSM.animator.SetTrigger("Dead");

            m_pFSM.animator.ResetTrigger("Reborn");
        }

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

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

        startTick = GameLogicAPI.getSyncTickCount(); // GameLogicAPI.getTickCount();
        endTick   = startTick + (uint)m_pFSM.rebornTick;
        tick_cameraSwitchAfterDead = startTick + m_pFSM.cameraSwitchAfterDead;

        if (m_pFSM.isHero)
        {
            //GFxGameHud hud = SFGFxMovieManager.GetWindow<GFxGameHud>();
            //if (SFGFxMovieManager.CheckTheMovieCanUse(hud))
            //{
            //    hud.ShowReliveTime(((float)m_pFSM.rebornTick));
            //}
            ScreenREC.GetInstance().SwitchRECState(ScreenREC.EMRECState.EMREC_STOP);

            //ImageEffects.ImageEffectManager.API_EnableImageEffect<ImageEffects.FullScreenGray>();
            if (ImageSetting.GetData().currImageQuality == ImageQuality.Fastest)
            {
                LightingEffectFactory.EnableDeadEffect();
                ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.FullScreenSaturation>();
                ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.DepthOfFieldScatter>();
            }
            else
            {
                LightingEffectFactory.DisableDeadEffect();
                ImageEffects.ImageEffectManager.API_EnableImageEffect <ImageEffects.FullScreenSaturation>();
                ImageEffects.ImageEffectManager.API_DisableImageEffect <ImageEffects.DepthOfFieldScatter>();
            }
        }

        //死亡不碰撞
        if (m_pFSM.controller)
        {
            //nOldCollisionLayer = m_pFSM.gameObject.layer;
            //m_pFSM.gameObject.layer = LayerMask.NameToLayer(Config.LayerIngoreRayCast);
            m_pFSM.pickableCount = 0;
        }

        int nEntityID = m_pFSM.entityID;

        U3D_Render.EntityView ev = EntityFactory.getPlayerViewByID(nEntityID);

        //添加金币掉落光效
        if (GameLogicAPI.isInWarScene() > 0)
        {
            addMoneyEffect(ev, context.uMurderID);
        }

        USpeedUI.Blood.UBloodManager.Instance.OnEntityDead(m_pFSM.entityID, ENTITY_TYPE.TYPE_PLAYER_ROLE);
        // 小地图隐藏
//         U3D_Render.EntityView objev = EntityFactory.getEntityViewByID(m_pFSM.entityID);
//         if (objev != null && GFxMinimapManager.Instance != null)
//         {
//             GFxMinimapManager.Instance.SetObjectVisible(m_pFSM.entityID, objev.createinfo.nMinimapIcon, 0);
//         }
        return(true);
    }