コード例 #1
0
        public override void OnClientStateEnter()
        {
            CurrentRoundStatus.UpdatePoints(Points);
            Debug.Log($"Current points: {string.Join(",", CurrentRoundStatus.Points)}");
            var pointAndPlace = MahjongLogic.SortPointsAndPlaces(Points);
            var places        = pointAndPlace.Select(v => v.Value).ToArray();

            controller.PointTransferManager.SetTransfer(CurrentRoundStatus, places, PointTransfers,
                                                        () => { ClientBehaviour.Instance.NextRound(); });
        }
コード例 #2
0
        public override void OnServerStateEnter()
        {
            var pointsAndPlaces = MahjongLogic.SortPointsAndPlaces(CurrentRoundStatus.Points);
            var names           = CurrentRoundStatus.PlayerNames.ToArray();
            var points          = CurrentRoundStatus.Points.ToArray();
            var places          = pointsAndPlaces.Select(v => v.Value).ToArray();
            var info            = new EventMessages.GameEndInfo
            {
                PlayerNames = names,
                Points      = points,
                Places      = places
            };

            ClientBehaviour.Instance.photonView.RPC("RpcGameEnd", RpcTarget.AllBufferedViaServer, info);
        }