コード例 #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;
    }