コード例 #1
0
    public void SetTranslucent(bool b)
    {
        int num = this._translCounter;

        this._translCounter += !b ? -1 : 1;
        if (((num > 0) != (this._translCounter > 0)) && this.CheckMats())
        {
            if (this._translCounter > 0)
            {
                SMaterialEffect_Translucent translucent = this.FindOrCreateEffect <SMaterialEffect_Translucent>(2);
                translucent.enableFade   = true;
                translucent.fadeInterval = 0.1f;
                translucent.minAlpha     = 0.4f;
                translucent.Play();
            }
            else
            {
                SMaterialEffect_Translucent effect = this.FindEffect(2) as SMaterialEffect_Translucent;
                if (effect != null)
                {
                    if (effect.enableFade)
                    {
                        effect.BeginFadeOut();
                    }
                    else
                    {
                        this.StopEffect(effect);
                    }
                }
            }
        }
    }
コード例 #2
0
    public void SetTranslucent(bool b, bool bForbidFade = false)
    {
        int num = this.m_effectCounter[2];

        this.m_effectCounter[2] += ((!b) ? -1 : 1);
        if (num > 0 == this.m_effectCounter[2] > 0)
        {
            return;
        }
        if (!this.CheckMats())
        {
            return;
        }
        if (this.m_effectCounter[2] > 0)
        {
            SMaterialEffect_Translucent sMaterialEffect_Translucent = this.FindOrCreateEffect <SMaterialEffect_Translucent>(2);
            sMaterialEffect_Translucent.enableFade   = true;
            sMaterialEffect_Translucent.fadeInterval = 0.1f;
            sMaterialEffect_Translucent.minAlpha     = 0.4f;
            sMaterialEffect_Translucent.Play();
        }
        else
        {
            SMaterialEffect_Translucent sMaterialEffect_Translucent2 = this.FindEffect(2) as SMaterialEffect_Translucent;
            if (sMaterialEffect_Translucent2 == null)
            {
                return;
            }
            if (sMaterialEffect_Translucent2.enableFade && !bForbidFade)
            {
                sMaterialEffect_Translucent2.BeginFadeOut();
            }
            else
            {
                this.StopEffect(sMaterialEffect_Translucent2);
            }
        }
    }