Ejemplo n.º 1
0
        //Photon ルーム入ってるの確認後
        private async void GameSceneSecondSettings()
        {
            var token = this.GetCancellationTokenOnDestroy();

            roomManager.SetPlayerInfo();
            playerManager.SetPlayerInfo();

            //ここで全員そろえる
            _rpcState.MyRPCStateSet(RPCAwaitStateList.PlayerInstance);
            await UniTask.WaitUntil(() => _rpcState.RoomRPCAwaitState == RPCAwaitStateList.PlayerInstance, cancellationToken : token);

            scoreManager.SetField();
            _flagManager.SetField();

            _digPointGenerator = FindObjectOfType <DigPointGenerator>();
            _digPointGenerator.DigPointGenerate(token).Forget();

            //ここで全員そろえる
            _rpcState.MyRPCStateSet(RPCAwaitStateList.FirstInMain);
            await UniTask.WaitUntil(() => _rpcState.RoomRPCAwaitState == RPCAwaitStateList.First, cancellationToken : token);

            Debug.Log("StartSettingsState");



            Game();
        }
Ejemplo n.º 2
0
        private async void Awake()
        {
            loadImage.SetActive(true);
            CancellationToken token = this.GetCancellationTokenOnDestroy();

            //通信再開(ここが終わるまで送信処理をしない)///////////////////////////////////////////////////////////////////////////////////
            await UniTask.Delay(RoadAwaitTimeMilli, cancellationToken : token);

            PhotonNetwork.IsMessageQueueRunning = true;
            //////////////////////////////////////////////////////////////////////////////////////////////////

            await votePanelManager.VoteSettings(token);

            loadImage.SetActive(false);
            BGMManager.Instance.Play(BGMPath.RESULT_BGM);
            //投票タイムと投票結果送信
            await Vote(token);

            rpcState.MyRPCStateSet(RPCAwaitStateList.FinishMasterTotalling);

            //ここでそろえる
            await UniTask.WaitUntil(() => rpcState.RoomRPCAwaitState == RPCAwaitStateList.FinishMasterTotalling,
                                    cancellationToken : token);

            //個人集計処理
            await SetResultDic(token);

            rpcState.MyRPCStateSet(RPCAwaitStateList.FinishMyTotalling);

            //ここでそろえる
            await UniTask.WaitUntil(() => rpcState.RoomRPCAwaitState == RPCAwaitStateList.FinishMyTotalling,
                                    cancellationToken : token);

            votePanel.SetActive(false);
            scorePanel.SetActive(true);

            //結果発表
            await ShowResult(token);

            //最終結果表示
            //await UniTask.Delay(AwaitTimeMilli, cancellationToken:token);

            await UniTask.Delay(ShowTimeMilli, cancellationToken : token);

            //ゲーム終了後(自分のスクショ保存など)
            networkManager.DisConnect();
            await ShowMyRoomImage(token);

            finishPanel.SetActive(true);


            //パネル切り替え

            SaveImage(token);
            BackMatchingScene(token).Forget();

            //これでゲーム終了
        }
Ejemplo n.º 3
0
    protected override void EnterRoom()
    {
        if (checkTarget.transform.parent.GetComponent <PhotonView>().Owner.CustomProperties[PunSettings.PropertiesKeyList.RoomPosKey] is Vector3 pos)
        {
            gameObject.transform.position = pos;
            _roomManager.SetCurrentRoom(checkTarget.transform.parent.gameObject);

            if (_rpcState.MyRPCAwaitState == RPCAwaitStateList.FirstInMain)
            {
                _rpcState.MyRPCStateSet(RPCAwaitStateList.FirstInRoom);
                BGMManager.Instance.Play(BGMPath.SNOW_BGM);
            }
            else if (_rpcState.MyRPCAwaitState == RPCAwaitStateList.SecondInMain)
            {
                _rpcState.MyRPCStateSet(RPCAwaitStateList.SecondInRoom);
            }
        }
        else
        {
            Debug.LogError("Couldn't get roomPos");
        }
        //checkTarget = null;
    }
Ejemplo n.º 4
0
        //カメラが写す範囲をキャプチャ
        public async void CaptureAndSend(CancellationToken token)
        {
            GetCamera();
            _screenShotElement = await new CaptureView().Capture(_camera, token);
            Debug.Log("element:" + _screenShotElement);
            screenShotProperties.SetField(_screenShotElement, rpcState);

            rpcState.MyRPCStateSet(RPCAwaitStateList.StartScreenShot);
            await UniTask.WaitUntil(() => rpcState.RoomRPCAwaitState == RPCAwaitStateList.StartScreenShot,
                                    cancellationToken : token);

            if (PhotonNetwork.IsMasterClient)
            {
                screenShotProperties.SetElement();
            }
        }
Ejemplo n.º 5
0
 public void SetColorProperty()
 {
     PunSettings.PropertiesManager.PlayerCustomPropertiesSettings(colorRPC, PunSettings.PropertiesKeyList.HatColorKey, PhotonNetwork.LocalPlayer);
     _rpcState = FindObjectOfType <RPCState>();
     _rpcState.MyRPCStateSet(RPCAwaitStateList.ColorPropertySent);
 }