Exemplo n.º 1
0
    private void UpdateLog()
    {
        StringBuilder sb = new StringBuilder("version:" + bs.settings.version);

        if (!bs._Loader.ownSite)
        {
            sb.Append("a");
        }

        if (errorCount > 0)
        {
            sb.Append(" errors:" + errorCount);
        }
        if (isDebug)
        {
            sb.Append(" Debug");
        }
        if (isDebug && !online)
        {
            sb.Append(" offline");
        }

        LogScreen(sb.ToString());
        if (Input2.GetKey(android ? KeyCode.Alpha4 : KeyCode.F4) && Input2.GetKeyDown(android ? KeyCode.Alpha6 : KeyCode.F6))
        {
            consoleWindow.enabled = !consoleWindow.enabled;
        }
        //print(PhotonNetwork.connectionStateDetailed);
        sbuilder.Append(sbuilder2);
        if (log)
        {
            log.text = sbuilder.ToString();
        }
        sbuilder = new StringBuilder();
    }
 private KeyCode FetchKey()
 {
     if (Input2.GetKeyDown(KeyCode.Escape))
     {
         return(KeyCode.None);
     }
     for (int i = 0; i < 429; i++)
     {
         if (Input2.GetKeyDown((KeyCode)i))
         {
             return((KeyCode)i);
         }
     }
     return(KeyCode.None);
 }
Exemplo n.º 3
0
    private void UpdateKeys()
    {
        if (UnityEngine.Input.GetKeyDown(KeyCode.Mouse3))
        {
            Application.CaptureScreenshot("screenshots/" + DateTime.Now.Ticks + ".png");
        }
        if (Application.isEditor)
        {
            if (Input.GetKeyDown(KeyCode.P))
            {
                Debug.Break();
            }
        }
        if (Input.GetKeyDown(KeyCode.Backslash))
        {
            reporter.gameObject.SetActive(!reporter.gameObject.activeSelf);
        }
        if (Input2.GetKeyDown(KeyCode.B, true))
        {
            _levelEditor.Toggle();
        }

        if (Input.GetKeyDown(KeyCode.Escape) || Input2.GetKeyDown(KeyCode.M))
        {
            if (!win.enabled && _GameGui)
            {
                win.ShowWindow(_GameGui.Menu);
            }
            else
            {
                win.Back();
            }
        }

        if (Input2.GetKeyDown(KeyCode.F12, true) || Input2.GetKeyDown(KeyCode.F11, true))
        {
            FullScreen();
        }
    }
    public void Update()
    {
        if (CameraMain != null)
        {
            CameraMain.fieldOfView = Mathf.Min(CameraMain.fieldOfView * 1.5f, Mathf.Lerp(CameraMain.fieldOfView, fieldOfView + Mathf.Max(0, _Player.avrVel) * .2f + Mathf.Max(0, _Player.velm - _Player.avrVel) * .5f, Time.deltaTime * 3));
        }

        if (online)
        {
            //AudioListener.pause = Time.timeSinceLevelLoad < 2;
            if (listOfPlayers.Where(a => a != null).Count(a => !a.enabled) > 2 && Time.timeSinceLevelLoad > 5)
            {
                Debug.LogException(new Exception("server sync error"));
            }
        }

        if (Input2.GetKeyDown(KeyCode.F3))
        {
            Player.VoteKick(Player.kickPlayer);
        }



        if (KeyDebug(KeyCode.R, "Restart level"))
        {
            CallRPC(SetTimeCount, 0f);
        }

#if !UNITY_WP8 && VOICECHAT
        if (Input.GetKeyDown(KeyCode.Y) && !room.disableVoiceChat)
        {
            //_GameGui.CallRPC(_GameGui.Chat, _Loader.playerName + Tr(" voice chat"));
            print("Voice Chat: " + Application.HasUserAuthorization(UserAuthorization.Microphone));
            if (!VoiceChatRecorder.Instance.enabled)
            {
                StartCoroutine(InitMicrophone());
            }
        }
#endif

        //if (Input2.GetKeyDown(KeyCode.N))
        //ToggleWindow(AllyWindow);
        if (Loader.errorCount > 100 && !isDebug)
        {
            _Loader.ignoredRooms.Add(room.name);
            LeaveRoom();
        }
        UpdateBots();

        if (Input2.GetKeyUp(KeyCode.Return))
        {
            _ChatGui.EnableChat();
        }

        if (Input2.GetKeyDown(KeyCode.C))
        {
            MainCamera.Next();
        }
        if (Input2.GetKeyDown(KeyCode.Tab))
        {
            ShowScoreBoard();
        }
        if (Input2.GetKeyUp(KeyCode.Tab))
        {
            CloseWindow();
        }

        UpdateGameState();
        if (SecureInt.detected)
        {
            ext.Block(" hack");
        }

        SetSecure("life", (int)_Player.life);
        SetSecure("bullets", (int)_Player.curWeapon.bullets);
        SetSecure("bullets2", (int)_Player.machineGun.bullets);
        room.Update();
    }