Skip to content
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

Merged
merged 11 commits into from
Oct 18, 2017
Merged

ロビー画面を作る #95

merged 11 commits into from
Oct 18, 2017

Conversation

chromee
Copy link
Member

@chromee chromee commented Oct 17, 2017

対応Issue

確認項目

  • ロビー画面作成
  • ゲーム画面に遷移したとき、playerIdとteamIdが正しく割り振られている

@chromee chromee added the WIP label Oct 17, 2017
@chromee chromee self-assigned this Oct 17, 2017
@chromee chromee changed the title chorome/network lobby ロビー画面を作る Oct 17, 2017
@chromee
Copy link
Member Author

chromee commented Oct 18, 2017

アセットの導入は別PRにわけた方がよかったですね…
変更数がえらいことになってしまった…

Copy link
Member Author

@chromee chromee left a 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;
Copy link
Member Author

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();
}
Copy link
Member Author

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();
}
Copy link
Member Author

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;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここ

}

[Command]
void CmdSetPlayerIdAndTeamId()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここ

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

退出時の処理とかすぐに追加できそう?
teamPlayerCountの値をこの実装で処理するなら退出時にデクリメントしたいところ
退出時の処理が面倒ならプレイヤーが追加されるたびに各チームの人数を計算する実装に変えた方があとあと楽かも

Copy link
Member Author

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のときだけデクリメントしてないので修正しておきます

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@chromee
Copy link
Member Author

chromee commented Oct 18, 2017

修正しました!

Copy link
Member

@RauziDssh RauziDssh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants