Esempio n. 1
0
    public static void UpdateTextures()
    {
        if (!FogOfWar.enable)
        {
            return;
        }
        FrameSynchr instance = Singleton <FrameSynchr> .get_instance();

        float num = (float)((ulong)instance.CurFrameNum - (ulong)FogOfWar.commitFrame) * Singleton <GameFowManager> .get_instance().GPUInterpolateReciprocal;

        if (instance.bActive)
        {
            uint num2 = (uint)((Time.realtimeSinceStartup - instance.startFrameTime) * 1000f);
            num2 *= (uint)instance.FrameSpeed;
            uint num3 = instance.CurFrameNum * instance.FrameDelta;
            int  num4 = (int)(num2 - num3);
            num4 -= instance.nJitterDelay;
            num4  = Mathf.Clamp(num4, 0, (int)instance.FrameDelta);
            num  += (float)num4 / instance.FrameDelta * Singleton <GameFowManager> .get_instance().GPUInterpolateReciprocal;
        }
        num = Mathf.Clamp01(num);
        FogOfWar.fowMats[1].SetTexture("_FowTex0", FogOfWar.fowTextures[1]);
        FogOfWar.fowMats[1].SetTexture("_FowTex1", FogOfWar.fowTextures[0]);
        FogOfWar.fowMats[1].SetFloat("_Factor", num);
        FogOfWar.fowTextures[2].DiscardContents();
        Graphics.Blit(null, FogOfWar.fowTextures[2], FogOfWar.fowMats[1]);
        RenderTexture.active = null;
        FogOfWar.fowMats[1].SetTexture("_FowTex0", null);
        FogOfWar.fowMats[1].SetTexture("_FowTex1", null);
        Shader.SetGlobalTexture("_FogOfWar", FogOfWar.fowTextures[2]);
    }
        public void UpdateCurAnimState()
        {
            if (this.actor.ActorMesh == null || this.actor.ActorMeshAnimation == null || this.curAnimName == null || this.actor.ActorMeshAnimation.GetClip(this.curAnimName) == null)
            {
                return;
            }
            Animation   actorMeshAnimation = this.actor.ActorMeshAnimation;
            FrameSynchr instance           = Singleton <FrameSynchr> .GetInstance();

            AnimationState animationState = actorMeshAnimation[this.curAnimName];
            float          num            = (float)((instance.LogicFrameTick - this.curAnimPlayFrameTick) / 1000.0);

            if (animationState.wrapMode == WrapMode.Loop)
            {
                if (animationState.length == 0f)
                {
                    num = 0f;
                }
                else
                {
                    int num2 = (int)(num / animationState.length);
                    num -= (float)num2 * animationState.length;
                }
                actorMeshAnimation.Play(this.curAnimName);
                animationState.time = num;
            }
            else
            {
                if (num >= animationState.length)
                {
                    num = animationState.length;
                }
                animationState.time = num;
            }
        }
Esempio n. 3
0
        public float Update()
        {
            FrameSynchr instance = Singleton <FrameSynchr> .GetInstance();

            if (instance.bActive)
            {
                long num3 = ((long)instance.LogicFrameTick) - this.startFrameTick;
                return(num3 * 0.001f);
            }
            this.curTime += Time.deltaTime;
            return(this.curTime);
        }
Esempio n. 4
0
        public float Update()
        {
            FrameSynchr instance = Singleton <FrameSynchr> .GetInstance();

            float result;

            if (instance.bActive)
            {
                long logicFrameTick = (long)instance.LogicFrameTick;
                long num            = logicFrameTick - this.startFrameTick;
                result = (float)num * 0.001f;
            }
            else
            {
                this.curTime += Time.deltaTime;
                result        = this.curTime;
            }
            return(result);
        }