Roles are chosen in the bootstrap dev panel before Host/Client. NGO
ConnectionApproval is enabled at runtime and maps the role payload to
the matching prefab variant per connection (Hunter/Hider), so each peer
spawns the correct avatar including the host.
- PlayerRole.cs (new): single source of truth enum { Hider, Hunter }.
- NetworkBootstrap.cs: role toggle, ConnectionApproval + role payload,
server ApprovalCheck mapping role -> PrefabIdHash.
- NetworkPlayerSetup.cs: serialized PlayerRole field + Role property.
- GameModeManager.cs: BuildModes(role) - Hunter -> [First Person, Paint],
Hider -> [Third Person, Paint, Free Cam]; binds role from spawned avatar.
- Hunter.prefab: role = Hunter override.
- SampleScene.unity: NetworkBootstrap prefab references wired.
Also includes user inspector scale tuning (Hunter 2.5->2.4, Hider 0.5->0.7).
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
11 lines
361 B
C#
11 lines
361 B
C#
/// <summary>
|
|
/// Which side a spawned avatar plays. Picked at connect time (NetworkBootstrap) and sent as the
|
|
/// connection-approval payload so the server spawns the matching prefab variant, then baked into
|
|
/// that prefab and read back by GameModeManager to build the role's mode set.
|
|
/// </summary>
|
|
public enum PlayerRole
|
|
{
|
|
Hider = 0,
|
|
Hunter = 1,
|
|
}
|