public override void Update(float deltaTime) { UpdateInputField(deltaTime); _inputName.Update(deltaTime); _inputHost.Update(deltaTime); _inputPort.Update(deltaTime); _loginButton.Update(deltaTime); _exitButton.Update(deltaTime); _userName = _inputName.GetInputText(); _sOptionalButton.Update(deltaTime); // check button click if (_sOptionalButton.ClickedInsideUI()) { SoundOptionButtonBehavior(); } if (_loginButton.ClickedInsideUI() || Input.IsKeyDown(Keys.Enter)) { LoginButtonBehavior(); } if (_exitButton.ClickedInsideUI()) { ExitButtonBehavior(); } base.Update(deltaTime); }
protected void LoginButtonBehavior() { if (_inputHost.GetInputText() == "" || _inputPort.GetInputText() == "") { LoginScene.SetNotice("Host or Port is empty !"); return; } _network.Connect(_inputHost.GetInputText(), int.Parse(_inputPort.GetInputText())); Debug.WriteLine(_inputHost.GetInputText() + " " + int.Parse(_inputPort.GetInputText())); }
public override void Update(float deltaTime) { _inputName.Update(deltaTime); _loginButton.Update(deltaTime); _exitButton.Update(deltaTime); _userName = _inputName.GetInputText(); _sOptionalButton.Update(deltaTime); if (_sOptionalButton.ClickedInsideButton()) { SoundOptionButtonBehavior(); } base.Update(deltaTime); }