Ejemplo n.º 1
0
        public void Update(float t)
        {
            var flag = false;

            timeSinceFreezeRequest += t;
            if (timeSinceFreezeRequest < 0.0)
            {
                timeSinceFreezeRequest = 1f;
            }
            if (timeSinceFreezeRequest < 0.200000002980232)
            {
                flag = true;
            }
            if (!active)
            {
                return;
            }
            if (os.connectedComp == null || !os.connectedComp.ip.Equals(target.ip))
            {
                active = false;
                if (timer < 0.5)
                {
                    AchievementsManager.Unlock("trace_close", false);
                }
            }
            else if (!flag)
            {
                timer -= t * timeDilation;
                if (timer <= 0.0)
                {
                    timer  = 0.0f;
                    active = false;
                    os.timerExpired();
                }
            }
            var num1 = (float)(timer / (double)startingTimer * 100.0);
            var num2 = num1 < 45.0 ? num1 < 15.0 ? 1f : 5f : 10f;

            if (num1 % (double)num2 > lastFrameTime % (double)num2)
            {
                beep.Play();
                os.warningFlash();
            }
            lastFrameTime = num1;
        }