|
@@ -16,7 +16,7 @@ public class RoleSelectView : MonoBehaviour
|
|
|
|
|
|
|
|
void RenderPlayer(int playerIndex) {
|
|
void RenderPlayer(int playerIndex) {
|
|
|
Transform root = this.transform.Find("Player" + (playerIndex + 1));
|
|
Transform root = this.transform.Find("Player" + (playerIndex + 1));
|
|
|
- int roleID = PKGameMode.playerRoleIDs[playerIndex];
|
|
|
|
|
|
|
+ int roleID = GlobalData.localPK_playerRoleIDs[playerIndex];
|
|
|
if (!inited[playerIndex]) {
|
|
if (!inited[playerIndex]) {
|
|
|
inited[playerIndex] = true;
|
|
inited[playerIndex] = true;
|
|
|
Button left = root.Find("Left").GetComponent<Button>();
|
|
Button left = root.Find("Left").GetComponent<Button>();
|
|
@@ -38,13 +38,13 @@ public class RoleSelectView : MonoBehaviour
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void NextRole(int playerIndex, int variety) {
|
|
void NextRole(int playerIndex, int variety) {
|
|
|
- PKGameMode.playerRoleIDs[playerIndex] += variety;
|
|
|
|
|
- if (PKGameMode.playerRoleIDs[playerIndex] < 1) {
|
|
|
|
|
- PKGameMode.playerRoleIDs[playerIndex] = RoleMgr.roleCount;
|
|
|
|
|
- } else if (PKGameMode.playerRoleIDs[playerIndex] > RoleMgr.roleCount) {
|
|
|
|
|
- PKGameMode.playerRoleIDs[playerIndex] = 1;
|
|
|
|
|
|
|
+ GlobalData.localPK_playerRoleIDs[playerIndex] += variety;
|
|
|
|
|
+ if (GlobalData.localPK_playerRoleIDs[playerIndex] < 1) {
|
|
|
|
|
+ GlobalData.localPK_playerRoleIDs[playerIndex] = RoleMgr.roleCount;
|
|
|
|
|
+ } else if (GlobalData.localPK_playerRoleIDs[playerIndex] > RoleMgr.roleCount) {
|
|
|
|
|
+ GlobalData.localPK_playerRoleIDs[playerIndex] = 1;
|
|
|
}
|
|
}
|
|
|
- if (PKGameMode.playerRoleIDs[playerIndex] == PKGameMode.playerRoleIDs[1 - playerIndex]) {
|
|
|
|
|
|
|
+ if (GlobalData.localPK_playerRoleIDs[playerIndex] == GlobalData.localPK_playerRoleIDs[1 - playerIndex]) {
|
|
|
NextRole(playerIndex, variety);
|
|
NextRole(playerIndex, variety);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|