Beispiel #1
0
        public void Assign(SessionInterface defaultInterface)
        {
            MatchmakeUser matchedUser = defaultInterface as MatchmakeUser;

            GameObject newPlayer = gameObjectManager.CreateGameObject(matchedUser.Nickname, false);

            newPlayer.Tag = TAG.Character;
            UserGameObjectIndexes.Add(newPlayer.id);
            Scoreboard.AddNewEmptyPlayerScore(newPlayer.Name);

            UserSession userSession = new UserSession();

            userSession.UserNickname = matchedUser.Nickname;
            userSession.TakeOver(matchedUser);
            userMediator.Add(userSession);

            UserInputProcess userInputProcess = newPlayer.AddComponent <UserInputProcess>();

            userInputProcess.SetFence(this.mapCenter, this.mapHeight, this.mapWidth);
            //Console.WriteLine(matchedUser.Nickname + "이가 게임에 참가했습니다.");

            if (userMediator.GetSessionsCount() == Config.USER_COUNT_PER_ONE_GAME)
            {
                Start();
            }
        }