コード例 #1
0
    private void RPC_StartInitialize(bool _isBot)
    {
        PhotonPlayer botPhoton = null;

        isMine = photonView.isMine;
        isBot  = _isBot;

        if (isBot)
        {
            botPhoton = PhotonTexasPokerManager.instance.GetBotwithIndex(IDX_READONLY);// bots[PhotonTexasPokerManager.instance.bots.Count - 1];
        }
        if (botPhoton == null && isBot)
        {
            Debug.Log("GA DAPET BOT PHOTON BOS");
        }

        int ownerSlotIndex = PhotonUtility.GetPlayerProperties <int>(isBot ? botPhoton : this.photonView.owner, PhotonEnums.Player.SlotIndex);

        uiPlayerPoker = _PokerGameManager.instance.stockPlayers[ownerSlotIndex];
        uiPlayerPoker.gameObject.SetActive(true);
        uiPlayerPoker._myParasitePlayer = this;
        uiPlayerPoker.myPlayer          = isBot ? botPhoton : this.photonView.owner;
        nickname = isBot ? botPhoton.NickName : this.photonView.owner.NickName;

        transform.SetParent(uiPlayerPoker.transform);
        transform.localScale    = new Vector3(1, 1, 1);
        transform.localPosition = new Vector3(0, 0, 0);

        uiPlayerPoker.StartInitialize(ownerSlotIndex, isMine, isBot);

        if (isMine)
        {
            PhotonUtility.SetPlayerPropertiesArray(uiPlayerPoker.myPlayer, new string[] { PhotonEnums.Player.ReadyInitialized, PhotonEnums.Player.NextRoundIn }, new object[] { true, true });
        }
    }
コード例 #2
0
    void UpdateUIPlayer()
    {
        panelBet.SetActive(totalBet <= 0 ? false : true);
        txtBet.text     = totalBet.toFlexibleCurrency();
        txtMyMoney.text = myMoney.toFlexibleCurrency();

        if (isMine || isBot)
        {
            PhotonUtility.SetPlayerPropertiesArray(myPlayer, new string[] { PhotonEnums.Player.Money, PhotonEnums.Player.TotalBet, PhotonEnums.Player.ChipsBet }, new object[] { myMoney, totalBet, chipsBet });
        }
    }
コード例 #3
0
 public void StartRound()
 {
     txtTimer.text = "0";
     if (PhotonUtility.GetPlayerProperties <bool> (PhotonNetwork.player, PhotonEnums.Player.ReadyInitialized))
     {
         PhotonUtility.SetPlayerPropertiesArray(PhotonNetwork.player, new string[] { PhotonEnums.Player.Active, PhotonEnums.Player.NextRoundIn }, new object[] { true, true });
     }
     else
     {
         PhotonUtility.SetPlayerPropertiesArray(PhotonNetwork.player, new string[] { PhotonEnums.Player.Active, PhotonEnums.Player.NextRoundIn }, new object[] { false, false });
     }
     if (crStartRound != null)
     {
         StopCoroutine(crStartRound);
     }
     crStartRound = StartCoroutine(_StartTimer(15f));
 }
コード例 #4
0
    public void Show()
    {
        Logger.E("a");
        gameObject.SetActive(true);
        //Only call it for one time since show is sending two time to the round restart

        if (PhotonNetwork.isMasterClient)
        {
            if (GlobalVariables.gameType == GameType.TexasPoker)
            {
                SetupPoker();
            }
        }

        //Don't allow any other players to be in this round
        PhotonPlayer[] _bots = PhotonTexasPokerManager.instance.bots.ToArray();
        foreach (PhotonPlayer bot in _bots)
        {
            if (PhotonUtility.GetPlayerProperties <bool>(bot, PhotonEnums.Player.ReadyInitialized))
            {
                PhotonUtility.SetPlayerPropertiesArray(bot, new string[] { PhotonEnums.Player.Active, PhotonEnums.Player.NextRoundIn }, new object[] { true, true });
            }
            else
            {
                PhotonUtility.SetPlayerPropertiesArray(bot, new string[] { PhotonEnums.Player.Active, PhotonEnums.Player.NextRoundIn }, new object[] { false, false });
            }
        }

        //Reset bet money to calculate giftpoints
        GlobalVariables.playerBetMoney = 0;

        if (PhotonUtility.GetPlayerProperties <bool>(PhotonNetwork.player, PhotonEnums.Player.ReadyInitialized))
        {
            PhotonUtility.SetPlayerPropertiesArray(PhotonNetwork.player, new string[] { PhotonEnums.Player.Active, PhotonEnums.Player.NextRoundIn }, new object[] { true, true });
        }
        else
        {
            PhotonUtility.SetPlayerPropertiesArray(PhotonNetwork.player, new string[] { PhotonEnums.Player.Active, PhotonEnums.Player.NextRoundIn }, new object[] { false, false });
        }

        if (GlobalVariables.gameType == GameType.TexasPoker)
        {
            StartCoroutine(StartRoundTimerPoker());
        }
    }
コード例 #5
0
    private void RPC_Initiate()
    {
        int ownerSlotIndex = PhotonUtility.GetPlayerProperties <int> (this.photonView.owner, PhotonEnums.Player.SlotIndex);

        uiPlayer = SicboManager.instance.stockPlayers[ownerSlotIndex];
        uiPlayer.gameObject.SetActive(true);
        uiPlayer.parasite     = this;
        uiPlayer.photonPlayer = this.photonView.owner;
        nickname = this.photonView.owner.NickName;

        transform.SetParent(uiPlayer.transform);
        transform.localScale    = new Vector3(1, 1, 1);
        transform.localPosition = new Vector3(0, 0, 0);

        uiPlayer.Initiate(ownerSlotIndex, photonView.isMine);
        if (photonView.isMine)
        {
            Logger.W("is mine set player properties array");
            PhotonUtility.SetPlayerPropertiesArray(uiPlayer.photonPlayer, new string[] { PhotonEnums.Player.ReadyInitialized, PhotonEnums.Player.NextRoundIn }, new object[] { true, true });
        }
    }