Esempio n. 1
0
        void Update()
        {
            if (timer.TimeElapsed(30000) || wrd == null)
            {
                var lst = File.ReadAllLines(remendpath).TakeWhile(a => a != "").ToList();
                wrd = lst[r.Next(lst.Count - 1)].Replace("\t", "\t\t\t\t\t\t\t\t\t\t\t");
            }
            textBox3.Text = wrd;

            if (timer.TimeElapsed(5000) && visib)
            {
                Save();
            }

            var t = TimeSpan.FromMilliseconds(timer._MilisecondsElapsed);

            tmElapsed += t;

            textBox1.Text = DateTime.Now + "\t\tElapsed " + tm(tmElapsed);
            var s = textBox2.Text;

            if (s.IndexOf("\n") != -1)
            {
                Title = tmElapsed.Minutes + ":" + tmElapsed.Seconds + " " + s.Substring(0, s.IndexOf("\n") - 1);
            }
            timer.Update();
        }
Esempio n. 2
0
        private void Update()
        {
            if (timer.TimeElapsed(30000))
            {
                lst = File.ReadAllLines(remendpath).TakeWhile(a => a != "").ToList();
                wrd = lst[r.Next(lst.Count - 1)].Split(new[] { '\t' }, StringSplitOptions.RemoveEmptyEntries);
            }

            tbTimeLeft.Text = "Remind:" + wrd[0] + "\t" + DateTime.Now + "\t\tLeft " + tm(tmLeft) + "\t\tElapsed " + tm(tmElapsed) + " \tRemind:" + wrd[1];
            var t = TimeSpan.FromMilliseconds(timer._MilisecondsElapsed);

            if (tmLeft != new TimeSpan())
            {
                tmLeft -= t;
            }
            tmElapsed += t;
            if (tmLeft < new TimeSpan())
            {
                tmLeft = TimeSpan.FromMinutes(5);
                ShowWindow();
            }
            if (timer.TimeElapsed(5000) && visib)
            {
                File.WriteAllText(dnevnikPath, tbTasks.Text);
            }

            timer.Update();
        }
Esempio n. 3
0
    protected virtual void Update()
    {
        //EditorApplication.playmodeStateChanged = OnPlaymodeStateChanged;
        autosavetm += 0.01f;
        _TimerA.Update();
        SceneView.onSceneGUIDelegate = OnSceneUpdate;
        bool autosave = (DateTime.Now - idletime) < TimeSpan.FromMinutes(10) && autosavetm > 60 * 20;

        if (autosave)
        {
            autosavetm = 0;
            Backup();
        }
        var ao = Selection.activeObject;

        if (ao != null && !lastUsed.Contains(ao))
        {
            lastUsed.Insert(0, ao);
        }

        if (_TimerA.TimeElapsed(3000))
        {
            this.Repaint();
        }
    }
Esempio n. 4
0
 private void UpdateZombieSpawn()
 {
     foreach (bs bs in alwaysUpdate)
     {
         if (bs != null)
         {
             bs.AlwaysUpdate();
         }
     }
     if (enableZombies)
     {
         if (timer.TimeElapsed(2000) && Network.isServer)
         {
             if (Zombies.Count < 1 + stage)
             {
                 InstZombie();
             }
             if (Zombies.Where(a => a == null || a.Alive == false).Count() == Zombies.Count)
             {
                 NextLevel();
             }
         }
     }
     if (DebugKey(KeyCode.Q))
     {
         Debug.Log("Disconnect");
         Network.Disconnect();
     }
     _Loader.WriteVar("Stage:" + stage);
     timer.Update();
 }
Esempio n. 5
0
    void Update()
    {
        infoText.text = "Fps: " + fps + " Errors:" + _Console.exceptionCount + " Ping: " + (int)pingAverage;
        if (_TimerA.TimeElapsed(500))
        {
            fps = (int)_TimerA.GetFps();
        }

        if (Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.M))
        {
            _Console.enabled = !_Console.enabled;
        }

        _Music.audio.volume  = _SettingsWindow.MusicVolume;
        AudioListener.volume = disableSounds ? 0 : _SettingsWindow.SoundVolume;
        //if (Network.sendRate != _SettingsWindow.NetworkSendRate) Network.sendRate = _SettingsWindow.NetworkSendRate;
        if (!isWebPlayer && Input.GetKey(KeyCode.LeftControl) && Input.GetKeyDown(KeyCode.C))
        {
            var path = curdir + "/ScreenShots/Screenshot" + DateTime.Now.ToFileTime() + ".png";
            Debug.Log("sceenshot saved " + path);
            Application.CaptureScreenshot(path);
        }
        _TimerA.Update();
        //WWW2.Update();
    }
Esempio n. 6
0
 void UpdateOther()
 {
     name = "Player:" + nick;
     if (networkView.isMine && timer.TimeElapsed(1000))
     {
         networkView.RPC("SetPing", RPCMode.All, Network.isServer ? 0 : Network.GetLastPing(Network.connections[0]), _Loader.fps, _Loader.exceptionCount);
     }
 }
Esempio n. 7
0
 void Update()
 {
     if (timer.TimeElapsed(1000))
     {
         fps = (int)timer.GetFps();
     }
     UpdateOther();
     timer.Update();
 }
Esempio n. 8
0
    private void UpdateInput()
    {
        if (timer.TimeElapsed(2000)) //regenerate
        {
            life += 1;
        }
        life = Mathf.Min(life, 100);
        if (life <= 0 && !_Game.CantDie)
        {
            networkView.RPC("Die", RPCMode.All);
        }

        bool stay = punch.enabled || punch2.enabled || punch3.enabled || ShootAnim.enabled || gesture.enabled;

        if (!stay)
        {
            tmLastCombo += Time.deltaTime;
        }
        _Game.GameText.text = "Stage:" + _Game.stage + " Zombies:" + _Game.AliveZombies.Count() + " Killed:" + killed + " Life:" + Mathf.Max(0, life);
        if (!stay)
        {
            vel  = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
            vel  = _Cam.oldrot * vel.normalized;
            vel *= 6;
            if (slow > 0)
            {
                vel *= .5f;
            }
        }
        else
        {
            vel = Vector3.zero;
        }

        var v = _Cursor.pos - _PlayerOwn.pos;

        v.y = 0;
        if (vel != Vector3.zero)
        {
            gunRot = Quaternion.LookRotation(vel);
        }

        if (Input.GetKeyDown(KeyCode.Space))
        {
            networkView.RPC("Gesture", RPCMode.All);
        }

        if (Input.GetMouseButtonDown(0) && !stay)
        {
            Combo();
            networkView.RPC("Hit", RPCMode.All, combo);
        }
        if (Input.GetMouseButtonDown(1) && !stay)
        {
            networkView.RPC("Shoot", RPCMode.All);
        }
    }
Esempio n. 9
0
    void UpdateOther()
    {
        if (life <= 0)
        {
            Die();
            return;
        }

        if (timer.TimeElapsed(TmState) && state != State.runAway)
        {
            state = (State)states[Random.Range(0, states.Length - 1)];
            if (selected)
            {
                Debug.Log("state switch" + state);
            }
            TmState = Random.Range(3000, 10000);
        }
    }
Esempio n. 10
0
 void Update()
 {
     //networkTime += Time.deltaTime;
     if (timer.TimeElapsed(1000))
     {
         fps = (int)timer.GetFps();
     }
     UpdateOther();
     timer.Update();
 }
Esempio n. 11
0
 void FixedUpdate()
 {
     if (ft.TimeElapsed(120))
     {
         MotionBlur.enabled    = true;
         MotionBlur.blurAmount = Vector3.Distance(oldpos, transform.position) / 8;
         oldpos = transform.position;
     }
     ft.Update();
     //CamUpdate();
 }
Esempio n. 12
0
 private void UpdatePointer()
 {
     if (timer.TimeElapsed(500))
     {
         scr = _Game.scores.Where(a => a != null).OrderBy(a => Vector3.Distance(a.pos, _Player.pos)).FirstOrDefault();
     }
     //Debug.Log(scr == null);
     if (scr != null)
     {
         _Cam.Pointer.rotation = Quaternion.Lerp(_Cam.Pointer.rotation, Quaternion.LookRotation(scr.pos - _Cam.pos), .2f);
     }
 }
Esempio n. 13
0
    public void Update()
    {
        hittm -= Time.deltaTime;
        name   = "Zombie" + "+" + GetId() + "+" + (selected == _PlayerOwn ? "Owner" : "");
        if (timer.TimeElapsed(100))
        {
            if (selected != _PlayerOwn && (_PlayerOther == null || Vector3.Distance(pos, _PlayerOwn.pos) < Vector3.Distance(pos, _PlayerOther.pos)))
            {
                networkView.RPC("RPCSelectPlayer", RPCMode.All, _PlayerOwn.id);
            }
        }

        if (selected != null)
        {
            var ztopl = (selected.pos - pos).normalized;
            ztopl.y = 0;

            var   dist  = Vector3.Distance(selected.pos, pos);
            float speed = _Game.SpeedCurv.Evaluate(dist);

            var nm = controller.velocity.magnitude / _Game.SpeedCurv.Evaluate(_Game.SpeedCurv.length);


            if (dist > 1f)
            {
                controller.SimpleMove(ztopl * speed);
            }

            bool stay = nm < .1f;
            if (stay)
            {
                Fade(idle);
            }
            else if (dist < 5)
            {
                Fade(run);
            }
            else
            {
                Fade(walk);
            }

            if (dist < 2f && !upperHit.enabled)
            {
                an.CrossFade(stay ? hitstay.name : upperHit.name);
            }
            walk.speed = Mathf.Sqrt(Mathf.Sqrt(.3f * speed));
            run.speed  = Mathf.Sqrt(Mathf.Sqrt(.1f * speed));
            model.transform.rotation = Quaternion.LookRotation(ztopl);
        }
        timer.Update();
    }
Esempio n. 14
0
 void Update()
 {
     if (timer.TimeElapsed(2000) && Network.isServer && Zombies.Count < 10 && enableZombies)
     {
         var zsp = ZombieSpawns.Random();
         Network.Instantiate(ZombiePrefab, zsp.pos, zsp.rot, (int)NetworkGroup.Zombie);
     }
     if (DebugKey(KeyCode.Q))
     {
         Debug.Log("Disconnect");
         Network.Disconnect();
     }
     timer.Update();
 }
Esempio n. 15
0
 private void UpdateOther()
 {
     hitTm -= Time.deltaTime;
     name   = "Zombie" + "+" + GetId() + "+" + (controlBy == _PlayerOwn ? "Owner" : "");
     if (timer.TimeElapsed(100))
     {
         if (controlBy != _PlayerOwn && _PlayerOwn.Alive && (_PlayerOther == null || !_PlayerOther.Alive || Vector3.Distance(pos, _PlayerOwn.pos) < Vector3.Distance(pos, _PlayerOther.pos)))
         {
             networkView.RPC("RPCSelectPlayer", RPCMode.All, _PlayerOwn.id);
         }
     }
     if (life <= 0 && controlBy == _PlayerOwn)
     {
         networkView.RPC("Die", RPCMode.All);
     }
 }
Esempio n. 16
0
    protected virtual void Update()
    {
        autosavetm += 0.01f;
        _TimerA.Update();

        SceneView.onSceneGUIDelegate = OnSceneUpdate;

        //if (autosavetm > 60 * 5)
        //{
        //    autosavetm = 0;
        //    Backup();
        //}
        var ao = Selection.activeObject;

        if (ao != null && !lastUsed.Contains(ao))
        {
            lastUsed.Insert(0, ao);
        }

        if (_TimerA.TimeElapsed(3000))
        {
            this.Repaint();
        }
    }