Skip to content

Commit

Permalink
Set max players to 6 and set actor color to be fixed rather than random
Browse files Browse the repository at this point in the history
  • Loading branch information
jemmec committed Mar 15, 2022
1 parent 25e1560 commit 763abdb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
13 changes: 8 additions & 5 deletions Assets/CoReality/Scripts/AvatarSystem/AvatarModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static Material DefaultHandMaterial
"Vague",
"Rare",
"Jolly"
};
};

[SerializeField]
private List<string> _randomNouns = new List<string>{
Expand All @@ -103,7 +103,7 @@ public static Material DefaultHandMaterial
"Calculator",
"Texture",
"Force"
};
};

[SerializeField]
private List<Color> _randomColors = new List<Color>{
Expand All @@ -113,7 +113,7 @@ public static Material DefaultHandMaterial
Color.blue,
Color.cyan,
Color.magenta,
};
};

//--------------------------------------

Expand Down Expand Up @@ -202,9 +202,12 @@ private void SpawnAvatar(bool remote, int viewID = -1)
//Set color
_localAvatar.Name = _randomAdjectives[UnityEngine.Random.Range(0, _randomAdjectives.Count)] + " "
+ _randomNouns[UnityEngine.Random.Range(0, _randomNouns.Count)];
_localAvatar.Color = _randomColors[UnityEngine.Random.Range(0, _randomColors.Count)];

print("Spawn Avatar End");
//Set the avatar's color to the actor number
int actorNum = PhotonNetwork.LocalPlayer.ActorNumber;
if (actorNum >= 0) //Ensure not -1
_localAvatar.Color = _randomColors[PhotonNetwork.LocalPlayer.ActorNumber];

}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Assets/CoReality/Scripts/NetworkModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public void OnConnectedToMaster()
{
IsOpen = true,
IsVisible = true,
MaxPlayers = 0,
MaxPlayers = 6,
PublishUserId = true,
CleanupCacheOnLeave = true
},
Expand Down

0 comments on commit 763abdb

Please sign in to comment.