Ejemplo n.º 1
0
 public void OnEnable()
 {
     PhotonNetwork.AddCallbackTarget(this);
     DisableIfNotMine();
 }
Ejemplo n.º 2
0
 private void Awake()
 {
     PhotonNetwork.AddCallbackTarget(this);
     view = GetComponent <PhotonView>();
 }
 public override void OnEnable()
 {
     base.OnEnable();
     // register to photn callback functions
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 4
0
 public void Awake()
 {
     PhotonNetwork.AddCallbackTarget(this);
     PhotonNetwork.AutomaticallySyncScene = true;
     instance = this;
 }
Ejemplo n.º 5
0
 private void Awake()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 6
0
 public override void awake()
 {
     base.awake();
     UITool.SetActionTrue(this.skin);
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 7
0
 public override void OnEnable()
 {
     base.OnEnable();
     PhotonNetwork.AddCallbackTarget(this);
     SceneManager.sceneLoaded += onSceneFinishedLoading; //setting up event listener for whenver we load a new scene. Whenever we call a new scene we call our onSceneFinishedLoading method.
 }
Ejemplo n.º 8
0
        public override void OnServerStateEnter()
        {
            PhotonNetwork.AddCallbackTarget(this);
            responds = new bool[players.Count];
            var playerNames = RongPlayerIndices.Select(
                playerIndex => CurrentRoundStatus.GetPlayerName(playerIndex)
                ).ToArray();
            var handData = RongPlayerIndices.Select(
                playerIndex => CurrentRoundStatus.HandData(playerIndex)
                ).ToArray();
            var richiStatus = RongPlayerIndices.Select(
                playerIndex => CurrentRoundStatus.RichiStatus(playerIndex)
                ).ToArray();
            var multipliers = RongPlayerIndices.Select(
                playerIndex => gameSettings.GetMultiplier(CurrentRoundStatus.IsDealer(playerIndex), players.Count)
                ).ToArray();
            var totalPoints = RongPointInfos.Select((info, i) => info.BasePoint * multipliers[i]).ToArray();
            var netInfos    = RongPointInfos.Select(info => new NetworkPointInfo
            {
                Fu         = info.Fu,
                YakuValues = info.YakuList.ToArray(),
                Dora       = info.Dora,
                UraDora    = info.UraDora,
                RedDora    = info.RedDora,
                BeiDora    = info.BeiDora,
                IsQTJ      = info.IsQTJ
            }).ToArray();

            Debug.Log($"The following players are claiming rong: {string.Join(",", RongPlayerIndices)}, "
                      + $"PlayerNames: {string.Join(",", playerNames)}");
            var rongInfo = new EventMessages.RongInfo
            {
                RongPlayerIndices     = RongPlayerIndices,
                RongPlayerNames       = playerNames,
                HandData              = handData,
                WinningTile           = WinningTile,
                DoraIndicators        = MahjongSet.DoraIndicators,
                UraDoraIndicators     = MahjongSet.UraDoraIndicators,
                RongPlayerRichiStatus = richiStatus,
                RongPointInfos        = netInfos,
                TotalPoints           = totalPoints
            };

            // send rpc calls
            ClientBehaviour.Instance.photonView.RPC("RpcRong", RpcTarget.AllBufferedViaServer, rongInfo);
            // get point transfers
            transfers = new List <PointTransfer>();
            for (int i = 0; i < RongPlayerIndices.Length; i++)
            {
                var rongPlayerIndex = RongPlayerIndices[i];
                var point           = RongPointInfos[i];
                var multiplier      = multipliers[i];
                int pointValue      = point.BasePoint * multiplier;
                int extraPoints     = i == 0 ? CurrentRoundStatus.ExtraPoints * (players.Count - 1) : 0;
                transfers.Add(new PointTransfer
                {
                    From   = CurrentPlayerIndex,
                    To     = rongPlayerIndex,
                    Amount = pointValue + extraPoints
                });
            }

            // richi-sticks-points
            transfers.Add(new PointTransfer
            {
                From   = -1,
                To     = RongPlayerIndices[0],
                Amount = CurrentRoundStatus.RichiSticksPoints
            });
            next = !RongPlayerIndices.Contains(CurrentRoundStatus.OyaPlayerIndex);
            // determine server time out
            serverTimeOut = ServerMaxTimeOut * RongPointInfos.Length + ServerConstants.ServerTimeBuffer;
            firstTime     = Time.time;
        }
Ejemplo n.º 9
0
        /// <summary>
        /// The object has been enabled.
        /// </summary>
        protected override void OnEnable()
        {
            base.OnEnable();

            PhotonNetwork.AddCallbackTarget(this);
        }
Ejemplo n.º 10
0
 private void Start()
 {
     CreatePlayer();
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 11
0
 public override void OnEnable()
 {
     PhotonNetwork.AddCallbackTarget(this);
     PhotonNetwork.AutomaticallySyncScene = true;
 }
Ejemplo n.º 12
0
 public ConnectionManager()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 13
0
 public override void OnEnable()
 {
     SceneManager.sceneLoaded += OnSceneFinishedLoading;
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 14
0
 public virtual void Initialize()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// OnEnable Unity function. Make sure to call base.OnEnable() if overriding
 /// </summary>
 protected virtual void OnEnable() => PhotonNetwork.AddCallbackTarget(this);
Ejemplo n.º 16
0
 public virtual void OnEnable()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
 private void Start()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 18
0
 public override void OnDisable()
 {
     base.OnEnable();
     PhotonNetwork.AddCallbackTarget(this);
     SceneManager.sceneLoaded -= OnSceneFinishedLoading;
 }
        private void OnEnable()
        {
            PhotonNetwork.AddCallbackTarget(this);

            StartCoroutine(AddPlayerDeathListener());
        }
Ejemplo n.º 20
0
 public override void OnEnable()
 {
     //Register to photon callbacks
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 21
0
    private int multiplayerSceneIndex; // num for build index to scene

    public override void OnEnable()    // trigerred on LobbyController
    {
        PhotonNetwork.AddCallbackTarget(this);
    }
    private int multiplayerSceneIndex; //Number for the build index to the multiplay scene


    public override void OnEnable()
    {
        PhotonNetwork.AddCallbackTarget(this);
    }
Ejemplo n.º 23
0
 public override void OnEnable()
 {
     base.OnEnable();
     PhotonNetwork.AddCallbackTarget(this);
     //Scene
 }
 private void OnEnable()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }
Ejemplo n.º 25
0
 public PhotonRoomManager()
 {
     PhotonNetwork.AddCallbackTarget(this);
 }