-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ロビー画面を作る #95
ロビー画面を作る #95
Conversation
アセットの導入は別PRにわけた方がよかったですね… |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
自分が変更した部分にコメントつけました。それでもちょっとレビューするのはしんどいと思いますが動作確認だけでもしてもらえるとうれしいです
|
||
player.name = lobby.playerName; | ||
player.playerId = lobby.playerId; | ||
player.teamId = lobby.teamId; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ
StartCoroutine(SetUpHandGun()); | ||
else if (isClient) | ||
CmdSetupHandGun(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ
//ホストのみNetworkConnectionが確立される前にStartが呼び出されてしまうため、NetworkConnectionが確立するまで待つ。 | ||
yield return this.UpdateAsObservable().FirstOrDefault(_ => connectionToClient.isReady).ToYieldInstruction(); | ||
CmdSetupHandGun(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ
[SyncVar] public int playerId = 0; | ||
[SyncVar] public int teamId = 0; | ||
static int team1PlayerCount = 0; | ||
static int team2PlayerCount = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ
} | ||
|
||
[Command] | ||
void CmdSetPlayerIdAndTeamId() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
退出時の処理とかすぐに追加できそう?
teamPlayerCountの値をこの実装で処理するなら退出時にデクリメントしたいところ
退出時の処理が面倒ならプレイヤーが追加されるたびに各チームの人数を計算する実装に変えた方があとあと楽かも
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
デクリメント部分にコメントつけるの忘れてました
退出時はここでデクリメントしてます
https://github.com/denx-jp/SSP/pull/95/files#diff-eb90a57904ef44cdd6e5abedc58c880fR228
言われて気づいたのですがなぜかteamId==2のときだけデクリメントしてないので修正しておきます
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
修正しました! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM👍
対応Issue
確認項目