Browse Source

Merge pull request #24 from Unity-Technologies/master-staging

Quality of Life & Bug Fixes.
/main
GitHub 7 months ago
commit
3b6a28a2
70 changed files with 351 additions and 1322 deletions
  1. 998
      Assets/Art/Font/CheckboxFLF SDF.asset
  2. 6
      Assets/Art/Icons/CursorIcon.png.meta
  3. 199
      Assets/Prefabs/NGO/InGameLogic.prefab
  4. 4
      Assets/Prefabs/NGO/PlayerCursor.prefab
  5. 54
      Assets/Prefabs/NGO/SymbolContainer.prefab
  6. 28
      Assets/Prefabs/NGO/SymbolObject.prefab
  7. 66
      Assets/Prefabs/UI/LobbyCanvas.prefab
  8. 68
      Assets/Scenes/mainScene.unity
  9. 4
      Packages/manifest.json
  10. 31
      Packages/packages-lock.json
  11. 5
      ProjectSettings/BurstAotSettings_StandaloneWindows.json
  12. 2
      ProjectSettings/CommonBurstAotSettings.json
  13. 16
      ProjectSettings/Packages/com.unity.services.vivox/Settings.json
  14. 8
      ProjectSettings/ProjectSettings.asset
  15. 4
      ProjectSettings/UnityConnectSettings.asset
  16. 3
      Assets/Scripts/GameLobby/LobbyRelaySample.asmdef
  17. 4
      Assets/Scripts/GameLobby/Game/LocalMenuState.cs
  18. 4
      Assets/Scripts/GameLobby/Game/LocalLobbyObserver.cs
  19. 3
      Assets/Scripts/GameLobby/Game/LobbyUserObserver.cs
  20. 4
      Assets/Scripts/GameLobby/Game/LobbyServiceDataObserver.cs
  21. 40
      Assets/Scripts/GameLobby/Game/GameManager.cs
  22. 2
      Assets/Scripts/GameLobby/Infrastructure/Messenger.cs
  23. 2
      Assets/Scripts/GameLobby/UI/StartLobbyButtonUI.cs
  24. 6
      Assets/Scripts/GameLobby/UI/MainMenuUI.cs
  25. 4
      Assets/Scripts/GameLobby/UI/JoinCreateLobbyUI.cs
  26. 6
      Assets/Scripts/GameLobby/UI/GameStateVisibilityUI.cs
  27. 4
      Assets/Scripts/GameLobby/UI/BackButtonUI.cs
  28. 16
      Assets/Scripts/GameLobby/NGO/SymbolObject.cs
  29. 33
      Assets/Scripts/GameLobby/NGO/SymbolContainer.cs
  30. 2
      Assets/Scripts/GameLobby/NGO/SetupInGame.cs
  31. 10
      Assets/Scripts/GameLobby/NGO/InGameRunner.cs
  32. 4
      Assets/Scripts/GameLobby/Lobby/LobbyContentHeartbeat.cs
  33. 8
      Assets/Scripts/GameLobby/Lobby/LobbyAsyncRequests.cs
  34. 9
      Assets/Scripts/GameLobby/Lobby/LobbyAPIInterface.cs
  35. 4
      Assets/Scripts/GameLobby/Relay/RelayUtpSetup.cs
  36. 1
      Assets/Scripts/GameLobby/Relay/RelayUtpHost.cs
  37. 3
      Assets/Scripts/GameLobby/Relay/RelayUtpClient.cs
  38. 8
      Assets/Scripts/GameLobby/Relay/RelayAPIInterface.cs
  39. 0
      /Assets/Prefabs/UI/LobbyCanvas.prefab.meta
  40. 0
      /Assets/Prefabs/UI/LobbyCanvas.prefab
  41. 0
      /Assets/Scripts/GameLobby/Auth.meta
  42. 0
      /Assets/Scripts/GameLobby/Infrastructure.meta
  43. 0
      /Assets/Scripts/GameLobby/Relay.meta
  44. 0
      /Assets/Scripts/GameLobby/Tests.meta
  45. 0
      /Assets/Scripts/GameLobby/UI.meta
  46. 0
      /Assets/Scripts/GameLobby/LobbyRelaySample.asmdef.meta
  47. 0
      /Assets/Scripts/GameLobby/Lobby.meta
  48. 0
      /Assets/Scripts/GameLobby/Auth
  49. 0
      /Assets/Scripts/GameLobby/LobbyRelaySample.asmdef
  50. 0
      /Assets/Scripts/GameLobby/Game.meta
  51. 0
      /Assets/Scripts/GameLobby/Vivox.meta
  52. 0
      /Assets/Scripts/GameLobby/Game
  53. 0
      /Assets/Scripts/GameLobby/Game/LocalMenuStateObserver.cs.meta
  54. 0
      /Assets/Scripts/GameLobby/Game/LocalMenuState.cs.meta
  55. 0
      /Assets/Scripts/GameLobby/Game/LocalMenuState.cs
  56. 0
      /Assets/Scripts/GameLobby/Infrastructure
  57. 0
      /Assets/Scripts/GameLobby/Tests
  58. 0
      /Assets/Scripts/GameLobby/UI
  59. 0
      /Assets/Scripts/GameLobby/Vivox
  60. 0
      /Assets/Scripts/GameLobby/NGO.meta
  61. 0
      /Assets/Scripts/GameLobby/NGO
  62. 0
      /Assets/Scripts/GameLobby/Lobby
  63. 0
      /Assets/Scripts/GameLobby/Relay

998
Assets/Art/Font/CheckboxFLF SDF.asset
File diff suppressed because it is too large
View File

6
Assets/Art/Icons/CursorIcon.png.meta


alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureType: 7
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1

platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 512
maxTextureSize: 32
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1

forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 512
maxTextureSize: 32
resizeAlgorithm: 0
textureFormat: 4
textureCompression: 1

199
Assets/Prefabs/NGO/InGameLogic.prefab


serializedVersion: 6
m_Component:
- component: {fileID: 485451675458297819}
- component: {fileID: 2273653745935453042}
- component: {fileID: 5378807363724719273}
m_Layer: 0
m_Name: InGameLogic
m_TagString: Untagged

m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7668134686248305871}
- {fileID: 6532331214593598572}
- {fileID: 5289034077109495657}
- {fileID: 365796668369407178}

m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &2273653745935453042
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 238192747445020667}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3}
m_Name:
m_EditorClassIdentifier:
RunInBackground: 0
LogLevel: 1
NetworkConfig:
ProtocolVersion: 0
NetworkTransport: {fileID: 5378807363724719273}
PlayerPrefab: {fileID: 0}
NetworkPrefabs:
- Override: 0
Prefab: {fileID: 3227847727972158006, guid: 905594b4ee5bb864a84af916cc445d1b, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 5240148789413552765, guid: f42ed38d10b57ec48870f76a7a63389e, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 8828823320646980938, guid: e371ca3112f9e244ab574b472387b64b, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
TickRate: 30
ClientConnectionBufferTimeout: 10
ConnectionApproval: 0
ConnectionData:
EnableTimeResync: 0
TimeResyncInterval: 30
EnsureNetworkVariableLengthSafety: 0
EnableSceneManagement: 1
ForceSamePrefabs: 1
RecycleNetworkIds: 1
NetworkIdRecycleDelay: 120
RpcHashSize: 0
LoadSceneTimeOut: 120
MessageBufferTimeout: 20
EnableNetworkLogs: 1
--- !u!114 &5378807363724719273
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 238192747445020667}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6960e84d07fb87f47956e7a81d71c4e6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ProtocolType: 1
m_MaxPacketQueueSize: 256
m_MaxPayloadSize: 6144
m_MaxSendQueueSize: 98304
m_HeartbeatTimeoutMS: 500
m_ConnectTimeoutMS: 1000
m_MaxConnectAttempts: 60
m_DisconnectTimeoutMS: 30000
ConnectionData:
Address: 127.0.0.1
Port: 7777
ServerListenAddress:
DebugSimulator:
PacketDelayMS: 0
PacketJitterMS: 0
PacketDropRate: 0
--- !u!1 &413870477192997562
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 485451675458297819}
m_RootOrder: 1
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &8873025738981341763
Camera:

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 485451675458297819}
m_RootOrder: 2
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &8928417086886337167
MonoBehaviour:

m_EditorClassIdentifier:
m_playerCursorPrefab: {fileID: -1321688216342888635, guid: 905594b4ee5bb864a84af916cc445d1b, type: 3}
m_symbolContainerPrefab: {fileID: 3984715711634906321, guid: f42ed38d10b57ec48870f76a7a63389e, type: 3}
m_symbolObjectPrefab: {fileID: 1734492152380024498, guid: e371ca3112f9e244ab574b472387b64b, type: 3}
m_symbolObjectPrefab: {fileID: -8192876538761676823, guid: e371ca3112f9e244ab574b472387b64b, type: 3}
m_sequenceSelector: {fileID: 6829526275642584874}
m_scorer: {fileID: 2250928641321586401}
m_killVolume: {fileID: 3287911880781162359}

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 485451675458297819}
m_RootOrder: 6
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &3287911880781162359
MonoBehaviour:

m_Children:
- {fileID: 8160705085328016364}
m_Father: {fileID: 485451675458297819}
m_RootOrder: 4
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

- {fileID: 2884208290717289317}
- {fileID: 8722147382518631401}
m_Father: {fileID: 485451675458297819}
m_RootOrder: 5
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}

m_Children:
- {fileID: 8262658662678090917}
m_Father: {fileID: 485451675458297819}
m_RootOrder: 3
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &8802679681577373678
GameObject:

m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!1 &9019482255774987314
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7668134686248305871}
- component: {fileID: 4557534325444114211}
- component: {fileID: 5194253823978692452}
m_Layer: 0
m_Name: NGONetworkManager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7668134686248305871
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9019482255774987314}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 485451675458297819}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &4557534325444114211
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9019482255774987314}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 593a2fe42fa9d37498c96f9a383b6521, type: 3}
m_Name:
m_EditorClassIdentifier:
DontDestroy: 0
RunInBackground: 0
LogLevel: 1
NetworkConfig:
ProtocolVersion: 0
NetworkTransport: {fileID: 5194253823978692452}
PlayerPrefab: {fileID: 0}
NetworkPrefabs:
- Override: 0
Prefab: {fileID: 3227847727972158006, guid: 905594b4ee5bb864a84af916cc445d1b, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 5240148789413552765, guid: f42ed38d10b57ec48870f76a7a63389e, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
- Override: 0
Prefab: {fileID: 8828823320646980938, guid: e371ca3112f9e244ab574b472387b64b, type: 3}
SourcePrefabToOverride: {fileID: 0}
SourceHashToOverride: 0
OverridingTargetPrefab: {fileID: 0}
TickRate: 30
ClientConnectionBufferTimeout: 10
ConnectionApproval: 0
ConnectionData:
EnableTimeResync: 0
TimeResyncInterval: 30
EnsureNetworkVariableLengthSafety: 0
EnableSceneManagement: 1
ForceSamePrefabs: 1
RecycleNetworkIds: 1
NetworkIdRecycleDelay: 120
RpcHashSize: 0
LoadSceneTimeOut: 120
MessageBufferTimeout: 20
EnableNetworkLogs: 1
--- !u!114 &5194253823978692452
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9019482255774987314}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 6960e84d07fb87f47956e7a81d71c4e6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ProtocolType: 1
m_MaximumPacketSize: 1400
m_MaxPacketQueueSize: 128
m_SendQueueBatchSize: 6144
m_HeartbeatTimeoutMS: 500
m_ConnectTimeoutMS: 1000
m_MaxConnectAttempts: 60
m_DisconnectTimeoutMS: 30000
ConnectionData:
Address: 127.0.0.1
Port: 7777
--- !u!1 &9108024644068474088
GameObject:
m_ObjectHideFlags: 0

4
Assets/Prefabs/NGO/PlayerCursor.prefab


m_SortingLayerID: -253801995
m_SortingLayer: 2
m_SortingOrder: 5
m_Sprite: {fileID: 21300000, guid: 9367b4ce9024f5b4090fabc2941d2116, type: 3}
m_Sprite: {fileID: 21300000, guid: 1ec85d26ef9b3d347a5a3438ba496881, type: 3}
m_Size: {x: 29.734224, y: 29.56}
m_Size: {x: 29.720001, y: 29.72}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1

54
Assets/Prefabs/NGO/SymbolContainer.prefab


m_Component:
- component: {fileID: 3305037517699072277}
- component: {fileID: 3984715711634906321}
- component: {fileID: 6367926983050135602}
- component: {fileID: 2302923454152093614}
- component: {fileID: -771508364383930873}
m_Layer: 0
m_Name: SymbolContainer
m_TagString: Untagged

AlwaysReplicateAsRoot: 0
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
--- !u!54 &6367926983050135602
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5240148789413552765}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 120
m_CollisionDetection: 0
--- !u!114 &2974066117406568032
MonoBehaviour:
m_ObjectHideFlags: 0

SyncScaleX: 0
SyncScaleY: 0
SyncScaleZ: 0
PositionThreshold: 0.001
PositionThreshold: 0.01
Interpolate: 0
Interpolate: 1
--- !u!114 &2302923454152093614
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5240148789413552765}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f6c0be61502bb534f922ebb746851216, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &210836793418873202
MonoBehaviour:
m_ObjectHideFlags: 0

m_Script: {fileID: 11500000, guid: 73a6c5df5c3139e448d76f8918fece73, type: 3}
m_Name:
m_EditorClassIdentifier:
m_rb: {fileID: 6367926983050135602}
m_speed: 2
m_speed: 2
--- !u!54 &-771508364383930873
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5240148789413552765}
serializedVersion: 2
m_Mass: 0.1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 0
m_IsKinematic: 1
m_Interpolate: 0
m_Constraints: 120
m_CollisionDetection: 0

28
Assets/Prefabs/NGO/SymbolObject.prefab


m_Component:
- component: {fileID: 4221838266206954178}
- component: {fileID: 1734492152380024498}
- component: {fileID: 2622345469831693260}
- component: {fileID: 1363360377255918887}
- component: {fileID: -8192876538761676823}
- component: {fileID: 4969239463688001465}

AlwaysReplicateAsRoot: 0
DontDestroyWithOwner: 0
AutoObjectParentSync: 1
--- !u!114 &2622345469831693260
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8828823320646980938}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e96cb6065543e43c4a752faaa1468eb1, type: 3}
m_Name:
m_EditorClassIdentifier:
SyncPositionX: 1
SyncPositionY: 1
SyncPositionZ: 1
SyncRotAngleX: 0
SyncRotAngleY: 0
SyncRotAngleZ: 0
SyncScaleX: 0
SyncScaleY: 0
SyncScaleZ: 0
PositionThreshold: 0.001
RotAngleThreshold: 0.01
ScaleThreshold: 0.01
InLocalSpace: 0
Interpolate: 1
CanCommitToTransform: 0
--- !u!65 &1363360377255918887
BoxCollider:
m_ObjectHideFlags: 0

66
Assets/Prefabs/UI/LobbyCanvas.prefab


- component: {fileID: 3687075862038422248}
- component: {fileID: 3403950992349691351}
m_Layer: 5
m_Name: LobbyGameCanvas
m_Name: LobbyCanvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0

objectReference: {fileID: 0}
- target: {fileID: 1919168897190896396, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 208.5
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2056817220376623591, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 3223430358889797224}
- target: {fileID: 3210254045315593125, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 49.5
value: 0
value: -27.5
value: 0
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 102.5
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3592018725093616804, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontColor.b

- target: {fileID: 3592018725093616804, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontColor32.rgba
value: 4291594772
objectReference: {fileID: 0}
- target: {fileID: 4467363028704636643, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontSize
value: 13
objectReference: {fileID: 0}
- target: {fileID: 4558362294547660329, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchorMax.y

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4943886293979569776, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontSize
value: 22.2
objectReference: {fileID: 0}
- target: {fileID: 5151586559654887469, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchorMax.y
value: 0

- target: {fileID: 5151586559654887469, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5926215170268773762, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontSize
value: 18
objectReference: {fileID: 0}
- target: {fileID: 6571416524262008532, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontColor.b

objectReference: {fileID: 0}
- target: {fileID: 6664205945102926799, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 155.5
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6700616695629081094, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_fontSize
value: 22.2
objectReference: {fileID: 0}
- target: {fileID: 7208745489711067383, guid: 2ff073ec9c74c8942bd90a541dc41bfc, type: 3}
propertyPath: m_Name

68
Assets/Scenes/mainScene.unity


value: 6
objectReference: {fileID: 0}
- target: {fileID: 7716713811812636910, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_LocalMenuStateObservers.Array.size
value: 4
objectReference: {fileID: 0}
- target: {fileID: 7716713811812636910, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_LobbyServiceObservers.Array.data[0]
value:
objectReference: {fileID: 2637199315837045694}

propertyPath: m_LocalGameStateObservers.Array.data[5]
value:
objectReference: {fileID: 0}
- target: {fileID: 7716713811812636910, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_LocalMenuStateObservers.Array.data[0]
value:
objectReference: {fileID: 2637199315837045698}
- target: {fileID: 7716713811812636910, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_LocalMenuStateObservers.Array.data[1]
value:
objectReference: {fileID: 1547097153363664359}
- target: {fileID: 7716713811812636910, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_LocalMenuStateObservers.Array.data[2]
value:
objectReference: {fileID: 2637199315837045696}
- target: {fileID: 7716713811812636910, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_LocalMenuStateObservers.Array.data[3]
value:
objectReference: {fileID: 883450645}
- target: {fileID: 7716713811812636911, guid: f80fc24bab3dcda459a2669321e2e5a4, type: 3}
propertyPath: m_RootOrder
value: 4

objectReference: {fileID: 0}
- target: {fileID: 2832906903618240629, guid: 9aae991127b410c45a001ecd7f75311d, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 155.5
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2938110563166987729, guid: 9aae991127b410c45a001ecd7f75311d, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 0}
- target: {fileID: 6314503137265266719, guid: 9aae991127b410c45a001ecd7f75311d, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 49.5
value: 0
value: -27.5
value: 0
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 102.5
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6468178321825623330, guid: 9aae991127b410c45a001ecd7f75311d, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 0}
- target: {fileID: 7029771435095122102, guid: 9aae991127b410c45a001ecd7f75311d, type: 3}
propertyPath: m_AnchorMax.y
value: 1
value: 0
value: 1
value: 0
value: 50
value: 0
value: 50
value: 0
value: 208.5
value: 0
value: -27.5
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7182908607506352373, guid: 9aae991127b410c45a001ecd7f75311d, type: 3}
propertyPath: m_AnchorMax.y

4
Packages/manifest.json


"com.unity.ide.rider": "3.0.7",
"com.unity.ide.visualstudio": "2.0.11",
"com.unity.ide.vscode": "1.2.4",
"com.unity.netcode.adapter.utp": "1.0.0-pre.3",
"com.unity.netcode.gameobjects": "1.0.0-pre.2",
"com.unity.netcode.adapter.utp": "1.0.0-pre.6",
"com.unity.netcode.gameobjects": "1.0.0-pre.6",
"com.unity.nuget.newtonsoft-json": "2.0.0",
"com.unity.render-pipelines.universal": "10.6.0",
"com.unity.services.authentication": "1.0.0-pre.6",

31
Packages/packages-lock.json


"dependencies": {}
},
"com.unity.burst": {
"version": "1.5.5",
"depth": 1,
"version": "1.6.4",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1"

"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.2.1",
"depth": 1,
"version": "1.2.5",
"depth": 2,
"version": "1.0.0-pre.3",
"version": "1.0.0-pre.6",
"com.unity.netcode.gameobjects": "1.0.0-pre.3",
"com.unity.transport": "1.0.0-pre.7"
"com.unity.netcode.gameobjects": "1.0.0-pre.6",
"com.unity.transport": "1.0.0-pre.14"
"version": "1.0.0-pre.3",
"depth": 1,
"version": "1.0.0-pre.6",
"depth": 0,
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.physics": "1.0.0",
"com.unity.modules.physics2d": "1.0.0",
"com.unity.collections": "1.0.0-pre.5"
"com.unity.collections": "1.1.0"
},
"url": "https://packages.unity.com"
},

"url": "https://packages.unity.com"
},
"com.unity.transport": {
"version": "1.0.0-pre.9",
"depth": 0,
"version": "1.0.0-pre.14",
"depth": 1,
"com.unity.burst": "1.5.5",
"com.unity.mathematics": "1.2.1"
"com.unity.burst": "1.6.4",
"com.unity.mathematics": "1.2.5"
},
"url": "https://packages.unity.com"
},

5
ProjectSettings/BurstAotSettings_StandaloneWindows.json


{
"MonoBehaviour": {
"Version": 3,
"Version": 4,
"EnableBurstCompilation": true,
"EnableOptimisations": true,
"EnableSafetyChecks": false,

"CpuMinTargetX64": 0,
"CpuMaxTargetX64": 0,
"CpuTargetsX32": 6,
"CpuTargetsX64": 72
"CpuTargetsX64": 72,
"OptimizeFor": 0
}
}

2
ProjectSettings/CommonBurstAotSettings.json


{
"MonoBehaviour": {
"Version": 3,
"Version": 4,
"DisabledWarnings": ""
}
}

16
ProjectSettings/Packages/com.unity.services.vivox/Settings.json


},
{
"type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",
"key": "domain",
"value": "{\"m_Value\":\"mtu1xp.vivox.com\"}"
"key": "tokenKey",
"value": "{\"m_Value\":\"FDIlna7382W91CMCoztXRWK12KcxJRZu\"}"
"key": "server",
"value": "{\"m_Value\":\"https://unity.vivox.com/appconfig/13746-com_u-21128-test\"}"
"key": "tokenIssuer",
"value": "{\"m_Value\":\"13746-com_u-21128-test\"}"
"key": "tokenIssuer",
"value": "{\"m_Value\":\"13746-com_u-21128-test\"}"
"key": "server",
"value": "{\"m_Value\":\"https://unity.vivox.com/appconfig/13746-com_u-21128-test\"}"
"key": "tokenKey",
"value": "{\"m_Value\":\"FDIlna7382W91CMCoztXRWK12KcxJRZu\"}"
"key": "domain",
"value": "{\"m_Value\":\"mtu1xp.vivox.com\"}"
},
{
"type": "System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089",

8
ProjectSettings/ProjectSettings.asset


XboxOneOverrideIdentityPublisher:
vrEditorSettings: {}
cloudServicesEnabled:
Analytics: 0
Analytics: 1
Build: 0
Collab: 0
Game Performance: 0

m_VersionName:
apiCompatibilityLevel: 6
activeInputHandler: 0
cloudProjectId:
cloudProjectId: 0bf0426b-e1fd-4251-82d0-3eea033ef1ad
projectName:
organizationId:
projectName: com.unity.services.samples.lobby-rooms
organizationId: operate-samples
cloudEnabled: 0
legacyClampBlendShapeWeights: 0
virtualTexturingSupportEnabled: 0

4
ProjectSettings/UnityConnectSettings.asset


UnityConnectSettings:
m_ObjectHideFlags: 0
serializedVersion: 1
m_Enabled: 0
m_Enabled: 1
m_TestMode: 0
m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events
m_EventUrl: https://cdp.cloud.unity3d.com/v1/events

m_Enabled: 0
m_TestMode: 0
UnityAnalyticsSettings:
m_Enabled: 0
m_Enabled: 1
m_TestMode: 0
m_InitializeOnStartup: 1
UnityAdsSettings:

3
Assets/Scripts/GameLobby/LobbyRelaySample.asmdef


"GUID:6087a74f6015aae4daed9a2577a7596c",
"GUID:4ebbcb26024b547159a86c39de1a8fa5",
"GUID:3bf5041814073ec4089849c425919d5a",
"GUID:1491147abca9d7d4bb7105af628b223e"
"GUID:1491147abca9d7d4bb7105af628b223e",
"GUID:3b8ed52f1b5c64994af4c4e0aa4b6c4b"
],
"includePlatforms": [],
"excludePlatforms": [],

4
Assets/Scripts/GameLobby/Game/LocalMenuState.cs


/// Awaits player input to change the local game data.
/// </summary>
[System.Serializable]
public class LocalGameState : Observed<LocalGameState>
public class LocalMenuState : Observed<LocalMenuState>
{
GameState m_State = GameState.Menu;

}
}
public override void CopyObserved(LocalGameState oldObserved)
public override void CopyObserved(LocalMenuState oldObserved)
{
if (m_State == oldObserved.State)
return;

4
Assets/Scripts/GameLobby/Game/LocalLobbyObserver.cs


namespace LobbyRelaySample
{
/// <summary>
/// Holds a LocalLobby value and notifies all subscribers when it has been changed.
/// Check the GameManager in the mainScene for the list of observers being used in the project.
/// </summary>
public class LocalLobbyObserver : ObserverBehaviour<LocalLobby> { }
}

3
Assets/Scripts/GameLobby/Game/LobbyUserObserver.cs


namespace LobbyRelaySample
{
/// <summary>
/// Holds an instance of a lobbyplayer, and implements hooks for the UI to interact with.
/// Holds a LobbyUser value and notifies all subscribers when it has been changed.
/// Check the GameManager in the mainScene for the list of observers being used in the project.
/// </summary>
public class LobbyUserObserver : ObserverBehaviour<LobbyUser> { }
}

4
Assets/Scripts/GameLobby/Game/LobbyServiceDataObserver.cs


namespace LobbyRelaySample
{
/// <summary>
/// Holds a LobbyServiceData value and notifies all subscribers when it has been changed.
/// Check the GameManager in the mainScene for the list of observers being used in the project.
/// </summary>
public class LobbyServiceDataObserver : ObserverBehaviour<LobbyServiceData> { }
}

40
Assets/Scripts/GameLobby/Game/GameManager.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Serialization;
/// All the Data that is important gets updated in here, the GameManager in the mainScene has all the references
/// needed to run the game.
/// <summary>
/// The Observer/Observed Pattern is great for keeping the UI in Sync with the actual Values.
/// Each list below represents a single Observed class that gets updated by other parts of the code, and will
/// trigger the list of Observers that are looking for changes in that class.
///
/// The list is serialized, so you can navigate to the Observers via the Inspector to see who's watching.
/// </summary>
private List<LocalGameStateObserver> m_GameStateObservers = new List<LocalGameStateObserver>();
private List<LocalMenuStateObserver> m_LocalMenuStateObservers = new List<LocalMenuStateObserver>();
[SerializeField]
private List<LocalLobbyObserver> m_LocalLobbyObservers = new List<LocalLobbyObserver>();
[SerializeField]

#endregion
private LocalGameState m_localGameState = new LocalGameState();
private LocalMenuState m_LocalMenuState = new LocalMenuState();
private RelayUtpSetup m_relaySetup;
private RelayUtpClient m_relayClient;

private void BeginObservers()
{
foreach (var gameStateObs in m_GameStateObservers)
gameStateObs.BeginObserving(m_localGameState);
foreach (var gameStateObs in m_LocalMenuStateObservers)
gameStateObs.BeginObserving(m_LocalMenuState);
foreach (var serviceObs in m_LobbyServiceObservers)
serviceObs.BeginObserving(m_lobbyServiceData);
foreach (var lobbyObs in m_LocalLobbyObservers)

}
/// Primarily used for UI elements to communicate state changes, this will receive messages from arbitrary providers for user interactions.
/// The Messaging System handles most of the core Lobby Service calls, and catches the callbacks from those calls.
/// These In turn update the observed variables and propagates the events to the game.
/// When looking for the interactions, look up the MessageType and search for it in the code to see where it is used outside this script.
/// EG. Locator.Get.Messenger.OnReceiveMessage(MessageType.RenameRequest, name);
/// </summary>
public void OnReceiveMessage(MessageType type, object msg)
{

},
OnFailedJoin);
}
else if (type == MessageType.RenameRequest)
else if (type == MessageType.RenameRequest)
{
string name = (string)msg;
if (string.IsNullOrWhiteSpace(name))

}
m_localUser.DisplayName = (string)msg;
}
}
else if (type == MessageType.ClientUserApproved)
{ ConfirmApproval();
}

{ if (m_relayClient is RelayUtpHost)
(m_relayClient as RelayUtpHost).SendInGameState();
}
else if (type == MessageType.ChangeGameState)
else if (type == MessageType.ChangeMenuState)
{ SetGameState((GameState)msg);
}
else if (type == MessageType.ConfirmInGameState)

{ m_localLobby.State = LobbyState.Lobby;
SetUserLobbyState();
}
}
}
bool isLeavingLobby = (state == GameState.Menu || state == GameState.JoinMenu) && m_localGameState.State == GameState.Lobby;
m_localGameState.State = state;
bool isLeavingLobby = (state == GameState.Menu || state == GameState.JoinMenu) && m_LocalMenuState.State == GameState.Lobby;
m_LocalMenuState.State = state;
if (isLeavingLobby)
OnLeftLobby();
}

if (!didSucceed)
{ Debug.LogError("Vivox login failed! Retrying in 5s...");
StartCoroutine(RetryConnection(StartVivoxLogin, m_localLobby.LobbyID));
return;
}
}
}

if (!didSucceed)
{ Debug.LogError("Vivox connection failed! Retrying in 5s...");
StartCoroutine(RetryConnection(StartVivoxJoin, m_localLobby.LobbyID));
return;
}
}
}

2
Assets/Scripts/GameLobby/Infrastructure/Messenger.cs


QueryLobbies = 4,
QuickJoin = 5,
ChangeGameState = 100,
ChangeMenuState = 100,
ConfirmInGameState = 101,
LobbyUserStatus = 102,
UserSetEmote = 103,

2
Assets/Scripts/GameLobby/UI/StartLobbyButtonUI.cs


{
public void ToJoinMenu()
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeGameState, GameState.JoinMenu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeMenuState, GameState.JoinMenu);
}
}
}

6
Assets/Scripts/GameLobby/UI/MainMenuUI.cs


/// <summary>
/// Watches for changes in the game state to/from the main menu.
/// </summary>
[RequireComponent(typeof(LocalGameStateObserver))]
public class MainMenuUI : ObserverPanel<LocalGameState>
[RequireComponent(typeof(LocalMenuStateObserver))]
public class MainMenuUI : ObserverPanel<LocalMenuState>
public override void ObservedUpdated(LocalGameState observed)
public override void ObservedUpdated(LocalMenuState observed)
{
if (observed.State == GameState.Menu)
Show();

4
Assets/Scripts/GameLobby/UI/JoinCreateLobbyUI.cs


/// <summary>
/// The panel that holds the lobby joining and creation panels.
/// </summary>
public class JoinCreateLobbyUI : ObserverPanel<LocalGameState>
public class JoinCreateLobbyUI : ObserverPanel<LocalMenuState>
{
public UnityEvent<JoinCreateTabs> m_OnTabChanged;

CurrentTab = JoinCreateTabs.Create;
}
public override void ObservedUpdated(LocalGameState observed)
public override void ObservedUpdated(LocalMenuState observed)
{
if (observed.State == GameState.JoinMenu)
{

6
Assets/Scripts/GameLobby/UI/GameStateVisibilityUI.cs


/// <summary>
/// Show or hide a UI element based on the current GameState (e.g. in a lobby).
/// </summary>
[RequireComponent(typeof(LocalGameStateObserver))]
public class GameStateVisibilityUI : ObserverPanel<LocalGameState>
[RequireComponent(typeof(LocalMenuStateObserver))]
public class GameStateVisibilityUI : ObserverPanel<LocalMenuState>
public override void ObservedUpdated(LocalGameState observed)
public override void ObservedUpdated(LocalMenuState observed)
{
if (!ShowThisWhen.HasFlag(observed.State))
Hide();

4
Assets/Scripts/GameLobby/UI/BackButtonUI.cs


{
public void ToJoinMenu()
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeGameState, GameState.JoinMenu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeMenuState, GameState.JoinMenu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeGameState, GameState.Menu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeMenuState, GameState.Menu);
}
}
}

16
Assets/Scripts/GameLobby/NGO/SymbolObject.cs


using System.Collections;
using System;
using System.Collections;
using VivoxUnity;
namespace LobbyRelaySample.ngo
{

m_renderer.sprite = m_symbolData.GetSymbolForIndex(symbolIndex.Value);
symbolIndex.OnValueChanged -= OnSymbolIndexSet;
}
public void SetPosition_Server(Vector3 newPosition)
{
SetPosition_ClientRpc(newPosition);
}
[ClientRpc]
void SetPosition_ClientRpc(Vector3 newPosition)
{
transform.localPosition = newPosition;
}
[ServerRpc]
public void ClickedSequence_ServerRpc(ulong clickerPlayerId)

33
Assets/Scripts/GameLobby/NGO/SymbolContainer.cs


using Unity.Netcode;
using System;
using Unity.Netcode;
using Unity.Netcode.Components;
namespace LobbyRelaySample.ngo
{

/// </summary>
[RequireComponent(typeof(Rigidbody))]
[RequireComponent(typeof(NetworkTransform))]
[SerializeField] private Rigidbody m_rb = default;
[SerializeField] private float m_speed = 1;
[SerializeField]
private float m_speed = 1;
/// <summary>
/// Verify both that the game has started and that the network connection is working before moving the symbols.
/// </summary>

public void Start()
{
if (!IsHost)
{ this.enabled = false; // Just disabling this script, not the whole GameObject.
{
this.enabled = false; // Just disabling this script, not the whole GameObject.
GetComponent<NetworkObject>().Spawn();
}

{
m_isConnected = true;
m_rb.MovePosition(Vector3.up * 10);
if (m_hasGameStarted)
BeginMotion();
transform.position = Vector3.up * 10;
void Update()
{
if (!IsHost)
return;
if (!m_hasGameStarted)
return;
BeginMotion();
}
m_rb.velocity = Vector3.down * m_speed;
transform.position += Time.deltaTime * m_speed*Vector3.down;
{ Locator.Get.Messenger.Unsubscribe(this);
{
Locator.Get.Messenger.Unsubscribe(this);
OnGameStarted();
}
}

2
Assets/Scripts/GameLobby/NGO/SetupInGame.cs


}
}
else if (type == MessageType.ChangeGameState)
else if (type == MessageType.ChangeMenuState)
{
// Once we're in-game, any state change reflects the player leaving the game, so we should clean up.
OnGameEnd();

10
Assets/Scripts/GameLobby/NGO/InGameRunner.cs


[SerializeField]
private NetworkObject m_symbolContainerPrefab = default;
[SerializeField]
private NetworkObject m_symbolObjectPrefab = default;
private SymbolObject m_symbolObjectPrefab = default;
[SerializeField]
private SequenceSelector m_sequenceSelector = default;
[SerializeField]

{
int index = SequenceSelector.k_symbolCount - m_pendingSymbolPositions.Count;
Vector3 pendingPos = m_pendingSymbolPositions.Dequeue();
NetworkObject symbolObj = NetworkObject.Instantiate(m_symbolObjectPrefab);
symbolObj.Spawn();
var symbolObj = Instantiate(m_symbolObjectPrefab);
symbolObj.NetworkObject.Spawn();
symbolObj.TrySetParent(m_symbolContainerInstance, false);
symbolObj.transform.localPosition = pendingPos;
symbolObj.NetworkObject.TrySetParent(m_symbolContainerInstance, false);
symbolObj.SetPosition_Server(pendingPos);
symbolObj.GetComponent<SymbolObject>().symbolIndex.Value = m_sequenceSelector.GetNextSymbol(index);
m_remainingSymbolCount++;
}

4
Assets/Scripts/GameLobby/Lobby/LobbyContentHeartbeat.cs


if (!m_localUser.IsApproved && m_lifetime > k_approvalMaxTime)
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.DisplayErrorPopup, "Connection attempt timed out!");
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeGameState, GameState.JoinMenu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeMenuState, GameState.JoinMenu);
}
if (m_shouldPushData)

}
Locator.Get.Messenger.OnReceiveMessage(MessageType.DisplayErrorPopup, "Host left the lobby! Disconnecting...");
Locator.Get.Messenger.OnReceiveMessage(MessageType.EndGame, null);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeGameState, GameState.JoinMenu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeMenuState, GameState.JoinMenu);
}
}
}

8
Assets/Scripts/GameLobby/Lobby/LobbyAsyncRequests.cs


if (result != null)
m_lastKnownLobby = result; // Store the most up-to-date lobby now since we have it, instead of waiting for the next heartbeat.
onComplete?.Invoke();
}, null);
}, null, null);
public void UpdatePlayerRelayInfoAsync(string allocationId, Action onComplete)
public void UpdatePlayerRelayInfoAsync(string allocationId, string connectionInfo, Action onComplete)
if (!ShouldUpdateData(() => { UpdatePlayerRelayInfoAsync(allocationId, onComplete); }, onComplete, true)) // Do retry here since the RelayUtpSetup that called this might be destroyed right after this.
if (!ShouldUpdateData(() => { UpdatePlayerRelayInfoAsync(allocationId, connectionInfo, onComplete); }, onComplete, true)) // Do retry here since the RelayUtpSetup that called this might be destroyed right after this.
LobbyAPIInterface.UpdatePlayerAsync(m_lastKnownLobby.Id, playerId, new Dictionary<string, PlayerDataObject>(), (r) => { onComplete?.Invoke(); }, allocationId);
LobbyAPIInterface.UpdatePlayerAsync(m_lastKnownLobby.Id, playerId, new Dictionary<string, PlayerDataObject>(), (r) => { onComplete?.Invoke(); }, allocationId, connectionInfo);
}
/// <param name="data">Key-value pairs, which will overwrite any existing data for these keys. Presumed to be available to all lobby members but not publicly.</param>

9
Assets/Scripts/GameLobby/Lobby/LobbyAPIInterface.cs


AsyncRequestLobby.Instance.DoRequest(task, onComplete);
}
/// <summary>
/// Uupdates custom data to the lobby, for all to see.
/// </summary>
public static void UpdateLobbyAsync(string lobbyId, Dictionary<string, DataObject> data, bool shouldLock, Action<Lobby> onComplete)
{
UpdateLobbyOptions updateOptions = new UpdateLobbyOptions { Data = data , IsLocked = shouldLock};

public static void UpdatePlayerAsync(string lobbyId, string playerId, Dictionary<string, PlayerDataObject> data, Action<Lobby> onComplete, string allocationId)
public static void UpdatePlayerAsync(string lobbyId, string playerId, Dictionary<string, PlayerDataObject> data, Action<Lobby> onComplete, string allocationId, string connectionInfo)
AllocationId = allocationId
AllocationId = allocationId,
ConnectionInfo = connectionInfo
};
var task = Lobbies.Instance.UpdatePlayerAsync(lobbyId, playerId, updateOptions);
AsyncRequestLobby.Instance.DoRequest(task, onComplete);

4
Assets/Scripts/GameLobby/Relay/RelayUtpSetup.cs


RelayUtpHost host = gameObject.AddComponent<RelayUtpHost>();
host.Initialize(m_networkDriver, m_connections, m_localUser, m_localLobby);
m_onJoinComplete(true, host);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), null);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), m_localLobby.RelayCode, null);
}
}
}

RelayUtpClient client = gameObject.AddComponent<RelayUtpClient>();
client.Initialize(m_networkDriver, m_connections, m_localUser, m_localLobby);
m_onJoinComplete(true, client);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), null);
LobbyAsyncRequests.Instance.UpdatePlayerRelayInfoAsync(m_allocation.AllocationId.ToString(), m_localLobby.RelayCode, null);
}
}
}

1
Assets/Scripts/GameLobby/Relay/RelayUtpHost.cs


/// <summary>
/// In addition to maintaining a heartbeat with the Relay server to keep it from timing out, the host player must pass network events
/// from clients to all other clients, since they don't connect to each other.
/// If you are using the Unity Networking Package, you can use their Relay instead of building your own packets.
/// </summary>
public class RelayUtpHost : RelayUtpClient, IReceiveMessages
{

3
Assets/Scripts/GameLobby/Relay/RelayUtpClient.cs


/// <summary>
/// This observes the local player and updates remote players over Relay when there are local changes, demonstrating basic data transfer over the Unity Transport (UTP).
/// Created after the connection to Relay has been confirmed.
/// If you are using the Unity Networking Package, you can use their Relay instead of building your own packets.
/// </summary>
public class RelayUtpClient : MonoBehaviour, IDisposable // This is a MonoBehaviour merely to have access to Update.
{

Debug.LogError(msg);
Locator.Get.Messenger.OnReceiveMessage(MessageType.DisplayErrorPopup, msg);
Leave();
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeGameState, GameState.JoinMenu);
Locator.Get.Messenger.OnReceiveMessage(MessageType.ChangeMenuState, GameState.JoinMenu);
}
/// <summary>

8
Assets/Scripts/GameLobby/Relay/RelayAPIInterface.cs


Debug.LogError("Relay returned a null Allocation. This might occur if the Relay service has an outage, if your cloud project ID isn't linked, or if your Relay package version is outdated.");
else
onComplete?.Invoke(response);
};
}
;
}
/// <summary>

Debug.LogError("Could not join async with Relay join code " + joinCode);
else
onComplete?.Invoke(response);
};
}
;
}
}
}

/Assets/Prefabs/UI/LobbyGameCanvas.prefab.meta → /Assets/Prefabs/UI/LobbyCanvas.prefab.meta

/Assets/Prefabs/UI/LobbyGameCanvas.prefab → /Assets/Prefabs/UI/LobbyCanvas.prefab

/Assets/Scripts/Auth.meta → /Assets/Scripts/GameLobby/Auth.meta

/Assets/Scripts/Infrastructure.meta → /Assets/Scripts/GameLobby/Infrastructure.meta

/Assets/Scripts/Relay.meta → /Assets/Scripts/GameLobby/Relay.meta

/Assets/Scripts/Tests.meta → /Assets/Scripts/GameLobby/Tests.meta

/Assets/Scripts/UI.meta → /Assets/Scripts/GameLobby/UI.meta

/Assets/Scripts/LobbyRelaySample.asmdef.meta → /Assets/Scripts/GameLobby/LobbyRelaySample.asmdef.meta

/Assets/Scripts/Lobby.meta → /Assets/Scripts/GameLobby/Lobby.meta

/Assets/Scripts/Auth → /Assets/Scripts/GameLobby/Auth

/Assets/Scripts/LobbyRelaySample.asmdef → /Assets/Scripts/GameLobby/LobbyRelaySample.asmdef

/Assets/Scripts/Game.meta → /Assets/Scripts/GameLobby/Game.meta

/Assets/Scripts/Vivox.meta → /Assets/Scripts/GameLobby/Vivox.meta

/Assets/Scripts/Game → /Assets/Scripts/GameLobby/Game

/Assets/Scripts/GameLobby/Game/LocalGameStateObserver.cs.meta → /Assets/Scripts/GameLobby/Game/LocalMenuStateObserver.cs.meta

/Assets/Scripts/GameLobby/Game/LocalGameState.cs.meta → /Assets/Scripts/GameLobby/Game/LocalMenuState.cs.meta

/Assets/Scripts/GameLobby/Game/LocalGameState.cs → /Assets/Scripts/GameLobby/Game/LocalMenuState.cs

/Assets/Scripts/Infrastructure → /Assets/Scripts/GameLobby/Infrastructure

/Assets/Scripts/Tests → /Assets/Scripts/GameLobby/Tests

/Assets/Scripts/UI → /Assets/Scripts/GameLobby/UI

/Assets/Scripts/Vivox → /Assets/Scripts/GameLobby/Vivox

/Assets/Scripts/NGO.meta → /Assets/Scripts/GameLobby/NGO.meta

/Assets/Scripts/NGO → /Assets/Scripts/GameLobby/NGO

/Assets/Scripts/Lobby → /Assets/Scripts/GameLobby/Lobby

/Assets/Scripts/Relay → /Assets/Scripts/GameLobby/Relay

Loading…
Cancel
Save