Esempio n. 1
0
 void Start()
 {
     PhotonNetwork.autoJoinLobby = false;
     _subscription = Provider.Store.Subscribe(state =>
     {
         bool nextPlayingRequested = PlayingRequested.Get(state);
         if (nextPlayingRequested == _playingRequested)
         {
             return;
         }
         _playingRequested = nextPlayingRequested;
     });
 }
Esempio n. 2
0
 void Start()
 {
     _button = this.GetComponent <Button>();
     _button.interactable = _name != "";
     _subscription        = Provider.Store.Subscribe(state =>
     {
         string nextName           = Name.Get(state);
         bool nextPlayingRequested = PlayingRequested.Get(state);
         if (nextName == _name && nextPlayingRequested == _playingRequested)
         {
             return;
         }
         _name                = nextName;
         _playingRequested    = nextPlayingRequested;
         _button.interactable = _name != "" && !_playingRequested;
     });
 }
Esempio n. 3
0
        void Start()
        {
            _inputField   = this.GetComponent <InputField>();
            _subscription = Provider.Store.Subscribe(state =>
            {
                // INITIALIZE INPUT
                string value      = _inputField.text;
                string playerName = Name.Get(state);
                if (value == "" && playerName != "")
                {
                    _inputField.text = playerName;
                }

                // CHECK FOR PLAYING REQUESTED
                bool nextPlayingRequested = PlayingRequested.Get(state);
                if (nextPlayingRequested == _playingRequested)
                {
                    return;
                }
                _playingRequested        = nextPlayingRequested;
                _inputField.interactable = !_playingRequested;
            });
        }