Exemplo n.º 1
0
        private void Start()
        {
            _startHostButton.SetOnClickAction(() => {
                SetInteractable(false);
                OnHostButtonClicked.Dispatch();
            });
            _connectButton.SetOnClickAction(() => {
                var address = EnteredAddress;
                if (address != null)
                {
                    SetInteractable(false);
                    OnConnectButtonClicked.Dispatch(address);
                }
                else
                {
                    Debug.LogWarningFormat("Cant parse ip address");
                }
            });
            _backButton.SetOnClickAction(() => {
                SetInteractable(true);
                OnBackButtonClicked.Dispatch();
            });
            var myIp = NetUtils.GetLocalIPAddress();

            _myIpLabel.text   = myIp;
            _hostIpInput.text = "192.168.0.20";
            SetInteractable(true);
        }
Exemplo n.º 2
0
 private void Start()
 {
     _startGameButton.SetOnClickAction(OnStartGameClicked.Dispatch);
     _randomColorOnStart.SetOnChangedAction(value => {
         OnToggleRandomColorOnStart.Dispatch(value);
         UpdateColorPickerState();
     });
     _dropdown.SetOnValueChangedAction(OnControlTypeIndexChanged);
     _startMultiplayerButton.SetOnClickAction(OnMultiplayerGameClicked.Dispatch);
 }