예제 #1
0
 private void InputFieldValueChanged(string data)
 {
     if (int.TryParse(data, out int result))
     {
         PlayerPrefsWrapper.Set(Key, result);
     }
 }
예제 #2
0
        public void Update()
        {
            if (Input.GetKeyDown(KeyCode.P) && Input.GetKey(KeyCode.Tab))
            {
                MessageBox.Info($"PlayerPrefs:\n"
                                + $"{StrPrefs.input_message.ToString()} {PlayerPrefsWrapper.Get(StrPrefs.input_message)}\n"
                                + $"{StrPrefs.input_nickname.ToString()} {PlayerPrefsWrapper.Get(StrPrefs.input_nickname)}\n"
                                + $"{StrPrefs.server_ip.ToString()} {PlayerPrefsWrapper.Get(StrPrefs.server_ip)}\n"
                                + $"{StrPrefs.input_session_name.ToString()} {PlayerPrefsWrapper.Get(StrPrefs.input_session_name)}\n"
                                + $"{IntPrefs.chat_buffer_updates.ToString()} {PlayerPrefsWrapper.Get(IntPrefs.chat_buffer_updates)}\n"
                                + $"{IntPrefs.sender.ToString()} {PlayerPrefsWrapper.Get(IntPrefs.sender)}\n"
                                + $"{IntPrefs.session_id.ToString()} {PlayerPrefsWrapper.Get(IntPrefs.session_id)}\n");
            }

            if (Input.GetKeyDown(KeyCode.F12) && Input.GetKey(KeyCode.F2))
            {
                PlayerPrefs.DeleteAll();
            }

            if (Input.GetKeyDown(KeyCode.U) && Input.GetKey(KeyCode.Tab))
            {
                God.NetworkManager.Send(new in_game_info());
            }

            if (Input.GetKeyDown(KeyCode.L) && Input.GetKey(KeyCode.Tab))
            {
                PlayerPrefsWrapper.Set(StrPrefs.server_ip, Constants.IpLocalhost);
                God.NetworkManager.ConnectToServer();
            }
        }
 public override void Execute()
 {
     if (PlayerPrefsWrapper.Get(IntPrefs.chat_buffer_updates) != chat_buffer_updates)
     {
         PlayerPrefsWrapper.Set(IntPrefs.chat_buffer_updates, chat_buffer_updates);
         God.NetworkManager.Send(new in_read_chat());
     }
 }
 public override void HandleSignal()
 {
     if (game != null)
     {
         PlayerPrefsWrapper.Set(StrPrefs.data_save, JsonManager.Serialize(game));
         MessageBox.Info("Game saved successfully");
     }
     God.NetworkManager.Send(new in_game_info());
 }
        public override void HandleSignal()
        {
            God.NetworkManager.Users = users;
            int uid = users.FindIndex(s => s == PlayerPrefsWrapper.Get(StrPrefs.input_nickname));

            if (uid == -1)
            {
                MessageBox.Error("You aren't registered. Contact administrator for additional info");
                return;
            }
            PlayerPrefsWrapper.Set(IntPrefs.sender, uid);
        }
예제 #6
0
 public override void Execute()
 {
     if (!session_name.IsNullOrEmpty())
     {
         SessionInfoPanel.DrawPanel(this);
         PlayerPrefsWrapper.Set(StrPrefs.session_name, session_name);
         SessionBehaviour.SetSessionName(session_name);
     }
     if (players_uid != null)
     {
         PlayersScrollList.DrawScrollList(players_uid);
         SessionBehaviour.SetPlayers(players_uid);
     }
     if (!state.IsNullOrEmpty())
     {
         PlayerPrefsWrapper.Set(StrPrefs.state, state);
         SessionBehaviour.SetState(state);
     }
     if (game != null)
     {
         game.Execute();
     }
 }
예제 #7
0
 private void Start()
 {
     _inputField.text = int.TryParse(_inputField.text, out int result) ? PlayerPrefsWrapper.Get(Key, result).ToString() : PlayerPrefsWrapper.Get(Key).ToString();
     PlayerPrefsWrapper.Set(Key, int.Parse(_inputField.text));
 }
예제 #8
0
 private void InputFieldValueChanged(string text)
 {
     PlayerPrefsWrapper.Set(Key, text);
 }
예제 #9
0
 private void Start()
 {
     _inputField.text = PlayerPrefsWrapper.Get(Key, _inputField.text);
     PlayerPrefsWrapper.Set(Key, _inputField.text);
 }
예제 #10
0
 private void SetupClient()
 {
     PlayerPrefsWrapper.Set(StrPrefs.server_ip, Constants.Ip);
 }
 private void OnButtonClick()
 {
     PlayerPrefsWrapper.Set(IntPrefs.session_id, _sessionId);
     SessionInfoPanel.DrawPanel(SessionScrollList.GetSessionById(_sessionId));
 }
 public override void HandleSignal()
 {
     PlayerPrefsWrapper.Set(IntPrefs.session_id, session_id);
     God.NetworkManager.Send(new in_game_join());
 }