//ゲームシーン開始時 private async void GameSceneFirstSettings() { CancellationToken token = this.GetCancellationTokenOnDestroy(); _flagManager = FindObjectOfType <FlagManager>(); _rpcState = FindObjectOfType <RPCState>(); _networkManager = FindObjectOfType <NetworkManager>(); if (!PhotonNetwork.IsConnected) { await _networkManager.ConnectSettings("aaa", "bbb", token); } GameSceneSecondSettings(); }
public async void GameSceneSettings() { CancellationToken token = this.GetCancellationTokenOnDestroy(); _rpcState = FindObjectOfType <RPCState>(); //ここで全員そろえる await UniTask.WaitUntil(() => _rpcState.RoomRPCAwaitState == RPCAwaitStateList.ColorPropertySent, cancellationToken : token); _networkManager.CloseRoom(); colorSetPanel.SetActive(false); _cancellationToken = this.GetCancellationTokenOnDestroy(); timeLimitText.SetActive(true); await new PunTimer().TimerAsync(_gameStartCount, _cancellationToken);//いきなりロード画面に移ったらびっくりするから loadSceneCanvas.SetActive(true); //PhotonNetwork.IsMessageQueueRunning = false; /*if (PhotonNetwork.IsMasterClient) * { * await UniTask.Delay(TimeSpan.FromSeconds(2f), cancellationToken: _linkedToken.Token); * }*/ SceneManager.LoadScene(GameScene); }
private void Awake() { photonView = GetComponent <PhotonView>(); if (photonView.IsMine) { gameManager = FindObjectOfType <GameManager>(); playerManager = FindObjectOfType <PlayerManager>(); menuButtonManager = FindObjectOfType <MenuButtonManager>(); talkPanelManager = FindObjectOfType <TalkButtonManager>(); playerActionUIController = FindObjectOfType <PlayerActionUIController>(); _collider = GetComponent <CapsuleCollider>(); playerInput = GetComponent <PlayerInput>(); _rpcState = FindObjectOfType <RPCState>(); _roomManager = FindObjectOfType <RoomManager>(); token = this.GetCancellationTokenOnDestroy(); playerInput.ObserveEveryValueChanged(x => x.PushedAction) .Where(x => x) .Subscribe(_ => { //基地編集中にはできないように if (_roomManager.MyRoomChildrenList.MoveGoodsObj.activeSelf) { return; } switch (nextAction) { case ActionEnum.Dig: playerManager.loadSceneCanvas.SetActive(true); StartDig(); playerManager.currentPlayerState = PlayerState.Diging; break; case ActionEnum.SpeakToNPC: SpeakToNPC(); playerManager.currentPlayerState = PlayerState.Talking; break; case ActionEnum.SpeakToPlayer: SpeakToPlayer(); break; case ActionEnum.EnterRoom: EnterRoom(); break; case ActionEnum.PickUpTrap: PickUpTrap(); break; case ActionEnum.CheckObj: CheckTree(); break; case ActionEnum.ExitRoom: ExitRoom(); break; default: break; } playerActionUIController.SetActionText(""); }) .AddTo(this); } }
public void SetColorProperty() { PunSettings.PropertiesManager.PlayerCustomPropertiesSettings(colorRPC, PunSettings.PropertiesKeyList.HatColorKey, PhotonNetwork.LocalPlayer); _rpcState = FindObjectOfType <RPCState>(); _rpcState.MyRPCStateSet(RPCAwaitStateList.ColorPropertySent); }
public void Awake() { //PhotonNetwork.AddCallbackTarget(this); _rpcState = FindObjectOfType <RPCState>(); }
public void Awake() { _rpcState = FindObjectOfType <RPCState>(); }