private void InitTurn()
 {
     if (t.Turn == 0 && PhotonNetwork.room.PlayerCount == 2 && PhotonNetwork.isMasterClient)
     {
         t.BeginTurn();
         t.Info();
     }
 }
 public override void OnPhotonPlayerConnected(PhotonPlayer newPlayer)
 {
     print("Player connected: " + newPlayer);
     if (PhotonNetwork.room.PlayerCount == 2 && PhotonNetwork.isMasterClient)
     {
         turnManager.BeginTurn();
     }
 }
Exemple #3
0
    /// <summary>
    /// ポップアップフェードアウト
    /// </summary>
    /// <returns></returns>
    public IEnumerator PopupFedOut()
    {
        //対戦相手表示
        yield return(new WaitForSeconds(2));

        PopupPanel.SetActive(false);

        if (PhotonNetwork.LocalPlayer.IsMasterClient)
        {
            //マスタークライアントがターン開始
            turnManager.BeginTurn();
        }

        yield break;
    }
Exemple #4
0
 /// <summary>Call to start the turn (only the Master Client will send this).</summary>
 public void StartTurn()
 {
     if (PhotonNetwork.isMasterClient)
     {
         turnManager.BeginTurn();
     }
 }
Exemple #5
0
        private IEnumerator Start()
        {
            if (PhotonNetwork.IsMasterClient)
            {
                var startPlayerId = Random.Range(0, 2);
                var startPlayer   = PhotonNetwork.PlayerList[startPlayerId];
                PhotonNetwork.CurrentRoom.SetTurnPlayer(startPlayer);
            }
            _nowPhase = new FirstPick();
            _nowPhase.Execute();
            yield return(new WaitWhile(() => PhotonNetwork.LocalPlayer.GetStartCheck() || PhotonNetwork.PlayerListOthers[0].GetStartCheck()));

            _nowPhase = new BattleSetup();
            _nowPhase.Execute();
            _turnManager.BeginTurn();
        }
Exemple #6
0
 void IPunTurnManagerCallbacks.OnTurnCompleted(int turn)
 {
     if (PhotonNetwork.IsMasterClient)
     {
         m_turnManager.BeginTurn();
     }
 }
    /// <summary>
    /// ターンが時間切れになった時に呼び出される
    /// </summary>
    /// <param name="turn"></param>
    void IPunTurnManagerCallbacks.OnTurnTimeEnds(int turn)
    {
        Debug.LogFormat("OnTurnTimeEnds {0}", turn);
        // 新たなターンを開始する
        PunTurnManager turnManager = GameObject.FindObjectOfType <PunTurnManager>();

        turnManager.BeginTurn();
    }
Exemple #8
0
    public void OnPlayerFinished(Player player, int turn, object move)
    {
        bool finishedByLocal  = turnManager.GetPlayerFinishedTurn(PhotonNetwork.LocalPlayer);
        bool finishedByRemote = turnManager.GetPlayerFinishedTurn(PhotonNetwork.PlayerListOthers[0]);



        Debug.Log(">>>>>>> local:" + finishedByLocal + " VS remote: " + finishedByRemote + " <<<<<");
        if (player == PhotonNetwork.LocalPlayer) //Local is the one who finished
        {
            isMyTurn = false;
            gameManager.EndTurn();
            Debug.Log("I just finished! -------");
            Debug.Log("  -Local Player property 'turn' set to false and remote to true!");
        }
        else
        {
            Debug.Log("The other player just finished! -------");
            isMyTurn = true;
            gameManager.DecodeMove(move);
        }


        Debug.Log("Pieces: local: " + gameManager.controller.localPlayerInfo.listOfPlayedPositions.Count + " VS " + gameManager.controller.remotePlayerInfo.listOfPlayedPositions.Count);
        if (gameManager.CheckIfAnyWinner())
        {
            Debug.Log("Someone won or there is a tie");
            gameManager.EndOfROund();
            Debug.Log("**********END ROUND********");
        }
        else if (isMyTurn)
        {
            turnManager.BeginTurn();
            Debug.Log("The round has ended. Because: " + gameManager.messageLog);

            //gameManager.SomethingHappened(msg);
        }
        Debug.Log("############TURN END############");
    }
Exemple #9
0
 private void TurnStart()
 {
     punTurnManager.BeginTurn();
 }