Exemple #1
0
 void Update()
 {
     prestartTm -= Time.deltaTime;
     UpdateTimeText();
     UpdateOther();
     timer.Update();
 }
Exemple #2
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();
 }
Exemple #3
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();
    }
Exemple #4
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();
        }
    }
Exemple #5
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();
        }
Exemple #6
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();
        }
Exemple #7
0
 void Update()
 {
     networkTime += Time.deltaTime;
     prestartTm  -= Time.deltaTime;
     UpdateTimeText();
     UpdateOther();
     timer.Update();
 }
Exemple #8
0
    void Update()
    {
        timer.Update();
        string t = debugtext + "\r\nErrors:" + errors + " Exceptions:" + exceptions + "\r\nLastLog:" + lastLog + "\r\n" + debugvars;

        debugGui.text = t;
        debugvars     = "";
    }
Exemple #9
0
 void Update()
 {
     if (timer.TimeElapsed(1000))
     {
         fps = (int)timer.GetFps();
     }
     UpdateOther();
     timer.Update();
 }
Exemple #10
0
 void Update()
 {
     //networkTime += Time.deltaTime;
     if (timer.TimeElapsed(1000))
     {
         fps = (int)timer.GetFps();
     }
     UpdateOther();
     timer.Update();
 }
Exemple #11
0
 public void Update()
 {
     if (_Player != null)
     {
         UpdateScoreBoard();
         UpdatePlayerScores();
         UpdateOther();
         UpdatePointer();
     }
     timer.Update();
 }
Exemple #12
0
 void Update()
 {
     UpdateOther();
     UpdatePlayerNick();
     if (networkView.isMine && !fall && !_Game.pause && _Game.prestartTm < 0)
     {
         UpdateRopes();
         UpdateFall();
     }
     timer.Update();
 }
Exemple #13
0
 void FixedUpdate()
 {
     if (ft.TimeElapsed(120))
     {
         MotionBlur.enabled    = true;
         MotionBlur.blurAmount = Vector3.Distance(oldpos, transform.position) / 8;
         oldpos = transform.position;
     }
     ft.Update();
     //CamUpdate();
 }
Exemple #14
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();
    }
Exemple #15
0
 public override void Update()
 {
     base.Update();
     UpdateAnimations();
     //if (debug) state = State.crouch;
     UpdateOther();
     UpdateSelectNode();
     UpdateCheckStuck();
     UpdateMove();
     UpdateSeePlayer();
     UpdateAttack();
     timer.Update();
 }
Exemple #16
0
    public void Update()
    {
        //if (Anim != null && Anim.clip != null)

        animationState.speed = animationSpeedFactor;
        if (TimeOffsetFactor != 0 && TimeOffsetFactor != oldoffset)
        {
            animationState.time = (this.transform.position.x * TimeOffsetFactor) % animationState.length;
            oldoffset = TimeOffsetFactor;
        }

        timer.Update();
    }
Exemple #17
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();
 }
Exemple #18
0
    void LateUpdate()
    {
        if (Alive)
        {
            UpdateOther();
            if (networkView.isMine)
            {
                UpdateInput();
            }

            UpdateMove();
            timer.Update();
        }
    }
Exemple #19
0
    void Update()
    {
        for (int i = 0; i < lifeIcon.Length; i++)
        {
            lifeIcon[i].enabled = _Player.life > i;
        }

        UpdatePower();

        if (Input.GetKeyDown(KeyCode.Tab))
        {
            Screen.lockCursor = !Screen.lockCursor;
        }


        score.text = scores + "";
        timer.Update();
    }
Exemple #20
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();
        }
    }
Exemple #21
0
 private void OnSceneUpdate(SceneView scene)
 {
     UpdateOther(scene);
     UpdateSetCam(scene);
     timer.Update();
 }
Exemple #22
0
 public void Update()
 {
     UpdateOther();
     UpdateMove();
     timer.Update();
 }
Exemple #23
0
 protected override void Update()
 {
     Thread.Sleep(20);
     _TimerA.Update();
 }
Exemple #24
0
 void Update()
 {
     UpdateOther();
     timer.Update();
 }
Exemple #25
0
 protected override void Update()
 {
     timer.Update();
 }
Exemple #26
0
 void Update()
 {
     timer.Update();
 }
Exemple #27
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            UnityEditor.EditorApplication.isPaused = true;
        }
        UpdateOther();
        if (!gui)
        {
            UpdateCursor();
        }
        UpdateKeyboard();

        if (tool != ToolType.Grid || Input.GetMouseButton(1))
        {
            SelectedPrefab.SetActive(false);
        }
        if (SelectedPrefab.name.StartsWith("startpos"))
        {
            if (click)
            {
                spawnTr.position = cursorPos;
            }
            SelectedPrefab.SetActive(false);
        }
        else if (tool == ToolType.Grid)
        {
            UpdateGrid();
        }
        else if (tool == ToolType.Move)
        {
            if (MouseOverPrefab != null)
            {
                MouseOverPrefab.transform.position = cursorPos;
                if (Input.GetKeyDown(KeyCode.C))
                {
                    var g = (Transform)Instantiate(MouseOverPrefab.transform.GetChild(0), MouseOverPrefab.pos, MouseOverPrefab.rot);
                    g.parent = level;
                }
            }
        }
        else if (tool == ToolType.Rotate)
        {
            if (MouseOverPrefab != null)
            {
                MouseOverPrefab.rotz = (lastpos.Value.x - cursorPos.x) * 40;
            }
        }
        else if (tool == ToolType.Scale)
        {
            if (MouseOverPrefab != null)
            {
                MouseOverPrefab.scale = Vector3.one * (1f + ((cursorPos.x - lastpos.Value.x) / 4f));
            }
        }
        else if (tool == ToolType.Trail)
        {
            UpdateDrawTrail();
        }
        timer.Update();
    }
Exemple #28
0
    void LateUpdate()
    {
        name = "Player" + "+" + GetId();



        if (networkView.isMine)
        {
            vel  = new Vector3(Input.GetAxis("Horizontal"), 0, Input.GetAxis("Vertical"));
            vel  = _Cam.oldrot * vel.normalized;
            vel += vel * 5;
            var v = _Cursor.pos - _PlayerOwn.pos;
            v.y = 0;
            if (v != Vector3.zero)
            {
                _PlayerOwn.rot = Quaternion.LookRotation(v);
            }
        }
        controller.SimpleMove(vel);
        vel *= .98f;

        Vector3 speed = Quaternion.Inverse(transform.rotation) * controller.velocity;

        if (Input.GetMouseButtonDown(0) && !punch.enabled)
        {
            foreach (Zombie z in trigger.colliders.Where(a => a is Zombie))
            {
            }
            an.CrossFade(punch.name);
            punch.speed = 0;
            timer.AddMethod(100, delegate { punch.speed = 1; });
        }
        if (Input.GetMouseButtonDown(1) && !Shoot.enabled)
        {
            an.CrossFade(Shoot.name);
            Shoot.speed = 0;
            timer.AddMethod(500, delegate { Shoot.speed = 1; });
        }


        var sn = speed;

        sn.y = 0;
        sn   = sn.normalized;
        _Loader.WriteVar("Player vel" + sn);

        if (sn != Vector3.zero)
        {
            float LFlim = .9f;
            var   q     = Quaternion.LookRotation(sn).eulerAngles;

            if (sn.x < -LFlim)
            {
                Fade(sn.z > -LFlim ? sleft : sright);
            }
            else if (sn.x > LFlim)
            {
                Fade(sn.z > -LFlim ? sright : sleft);
            }
            else
            {
                if (sn.z > 0)
                {
                    Fade(run);
                }
                else
                {
                    Fade(runback);
                    q.y += 180;
                }
                foreach (var a in downbody)
                {
                    var r = a.rotation.eulerAngles;
                    r.y       += q.y;
                    a.rotation = Quaternion.Lerp(a.rotation, Quaternion.Euler(r), .8f);
                }
            }
        }
        else
        {
            Fade(idle);
        }


        timer.Update();
    }
Exemple #29
0
 void Update()
 {
     UpdateHostList();
     UpdateOther();
     timer.Update();
 }