Ejemplo n.º 1
0
    protected sealed override bool Continue()
    {
        Vector4 vector;
        Vector4 vector2;
        float   x;

        if (this.duration <= 0.0)
        {
            return(false);
        }
        double num = HUDIndicator.stepTime - this.damageTime;

        if (num > this.duration)
        {
            return(false);
        }
        this.propBlock.Clear();
        double num2 = num / this.duration;
        double t    = num2 * this.speedModX;
        double num4 = num2 * this.speedModY;
        double num5 = num2 * this.speedModZ;

        if (t > 1.0)
        {
            t = 1.0 - (t - 1.0);
        }
        if (num4 > 1.0)
        {
            num4 = 1.0 - (num4 - 1.0);
        }
        if (num5 > 1.0)
        {
            num5 = 1.0 - (num5 - 1.0);
        }
        double num6 = TransitionFunctions.Spline(t, (double)1.0, (double)0.0);
        double num7 = (num4 >= 0.10000000149011612) ? TransitionFunctions.Spline((double)((num4 - 0.1) / 0.9), (double)1.0, (double)0.0) : TransitionFunctions.Spline((double)(num4 / 0.1), (double)0.0, (double)1.0);
        double num8 = Math.Cos(num5 * 1.5707963267948966);

        vector.x  = (float)num8;
        vector.y  = (float)num6;
        vector.z  = (float)num7;
        vector.w  = (float)num2;
        vector2.x = (float)(num8 / this.speedModX);
        vector2.y = (float)(num6 / this.speedModY);
        vector2.z = (float)(num7 / this.speedModZ);
        vector2.w = (float)(1.0 - num2);
        if (this.inverseX)
        {
            vector2.x = 1f - vector2.x;
        }
        if (this.inverseY)
        {
            vector2.y = 1f - vector2.y;
        }
        if (this.inverseZ)
        {
            vector2.z = 1f - vector2.z;
        }
        if (this.swapX)
        {
            x         = vector2.x;
            vector2.x = vector.x;
            vector.x  = x;
        }
        if (this.swapY)
        {
            x         = vector2.y;
            vector2.y = vector.y;
            vector.y  = x;
        }
        if (this.swapZ)
        {
            x         = vector2.z;
            vector2.z = vector.z;
            vector.z  = x;
        }
        if (vector != this.lastBoundMin)
        {
            this.lastBoundMin = vector;
            this.propBlock.Set("_MinChannels", this.lastBoundMin);
        }
        if (vector2 != this.lastBoundMax)
        {
            this.lastBoundMax = vector2;
            this.propBlock.Set("_MaxChannels", this.lastBoundMax);
        }
        Vector3 vector3 = HUDIndicator.worldToCameraLocalMatrix.MultiplyVector(this.worldDirection);

        vector3.Normalize();
        if ((vector3.y * vector3.y) <= 0.99f)
        {
            base.transform.localEulerAngles = new Vector3(0f, 0f, Mathf.Atan2(vector3.z, vector3.x) * 57.29578f);
        }
        this.panel.propertyBlock = this.propBlock;
        return(true);
    }
Ejemplo n.º 2
0
    protected sealed override bool Continue()
    {
        Vector4 vector4  = new Vector4();
        Vector4 vector41 = new Vector4();
        float   single;

        if (this.duration <= 0)
        {
            return(false);
        }
        double num = HUDIndicator.stepTime - this.damageTime;

        if (num > this.duration)
        {
            return(false);
        }
        this.propBlock.Clear();
        double num1 = num / this.duration;
        double num2 = num1 * this.speedModX;
        double num3 = num1 * this.speedModY;
        double num4 = num1 * this.speedModZ;

        if (num2 > 1)
        {
            num2 = 1 - (num2 - 1);
        }
        if (num3 > 1)
        {
            num3 = 1 - (num3 - 1);
        }
        if (num4 > 1)
        {
            num4 = 1 - (num4 - 1);
        }
        double num5 = TransitionFunctions.Spline(num2, 1, 0);
        double num6 = (num3 >= 0.100000001490116 ? TransitionFunctions.Spline((num3 - 0.1) / 0.9, 1, 0) : TransitionFunctions.Spline(num3 / 0.1, 0, 1));
        double num7 = Math.Cos(num4 * 1.5707963267949);

        vector4.x  = (float)num7;
        vector4.y  = (float)num5;
        vector4.z  = (float)num6;
        vector4.w  = (float)num1;
        vector41.x = (float)(num7 / this.speedModX);
        vector41.y = (float)(num5 / this.speedModY);
        vector41.z = (float)(num6 / this.speedModZ);
        vector41.w = (float)(1 - num1);
        if (this.inverseX)
        {
            vector41.x = 1f - vector41.x;
        }
        if (this.inverseY)
        {
            vector41.y = 1f - vector41.y;
        }
        if (this.inverseZ)
        {
            vector41.z = 1f - vector41.z;
        }
        if (this.swapX)
        {
            single     = vector41.x;
            vector41.x = vector4.x;
            vector4.x  = single;
        }
        if (this.swapY)
        {
            single     = vector41.y;
            vector41.y = vector4.y;
            vector4.y  = single;
        }
        if (this.swapZ)
        {
            single     = vector41.z;
            vector41.z = vector4.z;
            vector4.z  = single;
        }
        if (vector4 != this.lastBoundMin)
        {
            this.lastBoundMin = vector4;
            this.propBlock.Set("_MinChannels", this.lastBoundMin);
        }
        if (vector41 != this.lastBoundMax)
        {
            this.lastBoundMax = vector41;
            this.propBlock.Set("_MaxChannels", this.lastBoundMax);
        }
        Vector3 vector3 = HUDIndicator.worldToCameraLocalMatrix.MultiplyVector(this.worldDirection);

        vector3.Normalize();
        if (vector3.y * vector3.y <= 0.99f)
        {
            base.transform.localEulerAngles = new Vector3(0f, 0f, Mathf.Atan2(vector3.z, vector3.x) * 57.29578f);
        }
        this.panel.propertyBlock = this.propBlock;
        return(true);
    }