浏览代码

Brought in latest Bug fixes and Updates

/main/staging/closed_beta_package_update
当前提交
ebefab4b
共有 21 个文件被更改,包括 222 次插入146 次删除
  1. 19
      Assets/Prefabs/UI/CreateContent.prefab
  2. 24
      Assets/Prefabs/UI/JoinContent.prefab
  3. 42
      Assets/Prefabs/UI/JoinCreateCanvas.prefab
  4. 14
      Assets/Prefabs/UI/LobbyGameCanvas.prefab
  5. 12
      Assets/Prefabs/UI/RenamePopup.prefab
  6. 105
      Assets/Scenes/mainScene.unity
  7. 40
      Assets/Scripts/Game/GameManager.cs
  8. 1
      Assets/Scripts/Lobby/LobbyAsyncRequests.cs
  9. 1
      Assets/Scripts/Relay/RelayUtpClient.cs
  10. 13
      Assets/Scripts/Relay/RelayUtpSetup.cs
  11. 7
      Assets/Scripts/Tests/PlayMode/LobbyRoundtripTests.cs
  12. 2
      Assets/Scripts/Tests/PlayMode/RelayRoundTripTests.cs
  13. 1
      Assets/Scripts/UI/JoinCreateLobbyUI.cs
  14. 18
      Assets/Scripts/UI/JoinMenuUI.cs
  15. 11
      Assets/Scripts/UI/SpinnerUI.cs
  16. 2
      Assets/Scripts/UI/UIPanelBase.cs
  17. 4
      Packages/manifest.json
  18. 4
      Packages/packages-lock.json
  19. 4
      ProjectSettings/ProjectVersion.txt
  20. 33
      Assets/Scripts/Lobby/LobbyListHeartbeat.cs
  21. 11
      Assets/Scripts/Lobby/LobbyListHeartbeat.cs.meta

19
Assets/Prefabs/UI/CreateContent.prefab


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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3939988936382120653}
m_RootOrder: 1

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3939988936382120653}
m_RootOrder: 0

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3818918250242346738}
m_Father: {fileID: 0}

m_onVisibilityChange:
m_PersistentCalls:
m_Calls: []
showing: 0
--- !u!1 &4576592091429739648
GameObject:
m_ObjectHideFlags: 0

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4388255649222666380}
m_RootOrder: 0

m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 18
m_fontSize: 29.35
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 1

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4903988224507325461}
m_Father: {fileID: 8663650026319491498}

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3818918250242346738}
m_RootOrder: 3

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8533460643281418118}
- {fileID: 5962604622760643426}

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 8663650026319491498}
m_RootOrder: 1

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4702713106716681505}
- {fileID: 8866965904304086500}

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 3818918250242346738}
m_RootOrder: 0

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8677466241086514681}
- {fileID: 7623034069078291411}

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2914824860568159748}
m_Father: {fileID: 3818918250242346738}

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 3939988936382120653}
m_Father: {fileID: 3818918250242346738}

m_CharacterValidation: 0
m_RegexValue:
m_GlobalPointSize: 35
m_CharacterLimit: 0
m_CharacterLimit: 20
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4702713106716681505}
m_RootOrder: 0

24
Assets/Prefabs/UI/JoinContent.prefab


- component: {fileID: 3931324176504405867}
- component: {fileID: 1462126939442648229}
- component: {fileID: 7550446569341709048}
- component: {fileID: 7645291363343340383}
m_Layer: 5
m_Name: JoinContent
m_TagString: Untagged

m_onVisibilityChange:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7645291363343340383}
m_TargetAssemblyTypeName: LobbyRooms.RoomsListHeartbeat, LobbyRooms
m_MethodName: SetActive
- m_Target: {fileID: 1462126939442648229}
m_TargetAssemblyTypeName: LobbyRelaySample.UI.JoinMenuUI, LobbyRelaySample
m_MethodName: JoinMenuChangedVisibility
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}

m_BoolArgument: 0
m_CallState: 2
m_LobbyButtonPrefab: {fileID: 7018369548608736188, guid: f6d35a456ba76a24587dce83bd088b7d, type: 3}
m_LobbyCodeField: {fileID: 8659642538454988273}
m_LobbyButtonParent: {fileID: 7824921818678239159}
--- !u!114 &7550446569341709048
MonoBehaviour:

m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &7645291363343340383
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 785260762106121644}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 48ec34a3875818e4690f1bf0be69ccd9, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &891284586109156510
GameObject:
m_ObjectHideFlags: 0

- target: {fileID: 7144088886657378797, guid: c9b04951bd45e154b8096955d9bc8a0b, type: 3}
propertyPath: m_Name
value: Spinner
objectReference: {fileID: 0}
- target: {fileID: 7859013680193933450, guid: c9b04951bd45e154b8096955d9bc8a0b, type: 3}
propertyPath: m_text
value: 'Error: Check the console log.'
objectReference: {fileID: 0}
- target: {fileID: 8141644855275361747, guid: c9b04951bd45e154b8096955d9bc8a0b, type: 3}
propertyPath: m_Pivot.x

42
Assets/Prefabs/UI/JoinCreateCanvas.prefab


m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 22.8
m_fontSize: 30.2
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 1

m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 22.8
m_fontSize: 30.2
m_fontSizeBase: 24
m_fontWeight: 400
m_enableAutoSizing: 1

m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
m_PresetInfoIsWorld: 1
--- !u!114 &5836614391142406752
MonoBehaviour:
m_ObjectHideFlags: 0

m_TransformParent: {fileID: 1119140321553661053}
m_Modifications:
- target: {fileID: 1079176168591545865, guid: 328b912adedf1bc41a44f60a12723cc0, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 1079176168591545865, guid: 328b912adedf1bc41a44f60a12723cc0, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
value: 1
objectReference: {fileID: 0}

m_TransformParent: {fileID: 1119140321553661053}
m_Modifications:
- target: {fileID: 433211913614645534, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.size
value: 2
objectReference: {fileID: 0}
- target: {fileID: 433211913614645534, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[1].m_Mode
value: 1
objectReference: {fileID: 0}

value: 0
objectReference: {fileID: 0}
- target: {fileID: 8242294458145102565, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9032799187230319547, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_Size
value: 0.99999994
objectReference: {fileID: 0}
- target: {fileID: 9095321446247494771, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9095321446247494771, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9095321446247494771, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9095321446247494771, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9095321446247494771, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9095321446247494771, guid: c308ffc2a02e5ab4bbe70a8b2e8108c6, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}

14
Assets/Prefabs/UI/LobbyGameCanvas.prefab


m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 1, y: 5}
m_SizeDelta: {x: 300, y: 50}
m_SizeDelta: {x: 500, y: 50}
m_Pivot: {x: 0, y: 1}
--- !u!222 &2177115228008557851
CanvasRenderer:

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 'ServerName
m_text: 'LobbyName
'
m_isRightToLeft: 0

m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 36
m_fontSize: 35.8
m_enableAutoSizing: 0
m_fontSizeMin: 18
m_fontSizeMax: 72
m_enableAutoSizing: 1
m_fontSizeMin: 20
m_fontSizeMax: 36
m_VerticalAlignment: 256
m_VerticalAlignment: 512
m_textAlignment: 65535
m_characterSpacing: 0
m_wordSpacing: 0

12
Assets/Prefabs/UI/RenamePopup.prefab


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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4299827590990313863}
m_RootOrder: 0

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 754765198059719065}
- {fileID: 4300767933049215827}

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 4582680168689072900}
m_Father: {fileID: 1113109783147550039}

m_CharacterValidation: 0
m_RegexValue:
m_GlobalPointSize: 30
m_CharacterLimit: 32
m_CharacterLimit: 24
m_OnEndEdit:
m_PersistentCalls:
m_Calls:

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1205332528783832187}
- {fileID: 4299827590990313863}

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4582680168689072900}
m_RootOrder: 0

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_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 4582680168689072900}
m_RootOrder: 1

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 8624457953407905706}
m_Father: {fileID: 0}

m_onVisibilityChange:
m_PersistentCalls:
m_Calls: []
showing: 0
--- !u!1 &8624457953407905705
GameObject:
m_ObjectHideFlags: 0

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1113109783147550039}
m_Father: {fileID: 8624457953394683849}

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_ConstrainProportionsScale: 0
m_Children:
- {fileID: 557953118367534400}
m_Father: {fileID: 1113109783147550039}

105
Assets/Scenes/mainScene.unity


propertyPath: onValueChanged.m_PersistentCalls.m_Calls.Array.data[0].m_Arguments.m_IntArgument
value: 3
objectReference: {fileID: 0}
- target: {fileID: 302677088753936851, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 302677088753936851, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 302677088753936851, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 302677088753936851, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 302677088753936851, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 302677088753936851, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 326167899787007624, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_fontColor32.rgba
value: 4291809231
objectReference: {fileID: 0}
- target: {fileID: 2491863691556184441, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2491863691556184441, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2491863691556184441, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2491863691556184441, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2491863691556184441, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2491863691556184441, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2545639037669962845, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0

objectReference: {fileID: 0}
- target: {fileID: 2637199316291327119, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: -12.500015
value: -12.5
objectReference: {fileID: 0}
- target: {fileID: 2637199316850714327, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_PresetInfoIsWorld

objectReference: {fileID: 0}
- target: {fileID: 4822032080772604407, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: -0.00006490946
value: 0
value: -0.2306938
value: -0.000015258789
objectReference: {fileID: 0}
- target: {fileID: 4824240073023402834, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y

value: 0
objectReference: {fileID: 0}
- target: {fileID: 5164090239530900493, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5451244976481318432, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5451244976481318432, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5451244976481318432, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5451244976481318432, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5451244976481318432, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5451244976481318432, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7138194943800857534, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7138194943800857534, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7138194943800857534, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7138194943800857534, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7138194943800857534, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7138194943800857534, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7198558056629795013, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
propertyPath: m_fontSize
value: 35.8

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedComponents:
- {fileID: 4928485776352161055, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
m_SourcePrefab: {fileID: 100100000, guid: f1d618bdc6f1813449d428126e640aa5, type: 3}
--- !u!114 &2637199315837045694 stripped
MonoBehaviour:

40
Assets/Scripts/Game/GameManager.cs


using System;
using LobbyRelaySample.Relay;
using System.Collections;
using System.Collections.Generic;

private LobbyContentHeartbeat m_lobbyContentHeartbeat = new LobbyContentHeartbeat();
private RelayUtpSetup m_relaySetup;
private RelayUtpClient m_relayClient;
// The Lobby API rate limits query requests to one every 1.5s, and it will return a 429 "Too Many Requests" error otherwise.
private const float k_lobbyAssignmentCoolingSeconds = 1.5f;
private bool m_coolingDown;
/// <summary>Rather than a setter, this is usable in-editor. It won't accept an enum, however.</summary>
public void SetLobbyColorFilter(int color) { m_lobbyColorFilter = (LobbyColor)color; }

}
else if (type == MessageType.CreateLobbyRequest)
{
if (!LobbyRequestCooledDown())
return;
OnCreatedLobby();
},
OnFailedJoin);
OnCreatedLobby();
},
OnFailedJoin);
if (!LobbyRequestCooledDown())
return;
OnJoinedLobby();
},
OnFailedJoin);
OnJoinedLobby();
},
OnFailedJoin);
if (!LobbyRequestCooledDown())
return;
m_lobbyServiceData.State = LobbyQueryState.Fetching;
LobbyAsyncRequests.Instance.RetrieveLobbyListAsync(
qr => {

{ Component.Destroy(m_relayClient);
m_relayClient = null;
}
}
private bool LobbyRequestCooledDown()
{
if (m_coolingDown)
return false;
StartCoroutine(RequestCoolDown());
return true;
}
private IEnumerator RequestCoolDown()
{
m_coolingDown = true;
yield return new WaitForSeconds(k_lobbyAssignmentCoolingSeconds);
m_coolingDown = false;
}
/// <summary>

1
Assets/Scripts/Lobby/LobbyAsyncRequests.cs


{
m_currentLobbyId = null;
m_lastKnownLobby = null;
m_heartbeatTime = 0;
}
private void UpdateLobby(float unused)

1
Assets/Scripts/Relay/RelayUtpClient.cs


m_localUser.onChanged -= OnLocalChange;
Leave();
Locator.Get.UpdateSlow.Unsubscribe(UpdateSlow);
m_networkDriver.Dispose();
}
public void OnDestroy()
{

13
Assets/Scripts/Relay/RelayUtpSetup.cs


}
}
#endregion
private void OnDestroy()
{
if (!m_isRelayConnected && m_networkDriver.IsCreated)
m_networkDriver.Dispose();
}
}
/// <summary>

}
else
{
RelayUtpClient watcher = gameObject.AddComponent<RelayUtpClient>();
watcher.Initialize(m_networkDriver, m_connections, m_localUser, m_localLobby);
m_onJoinComplete(true, watcher);
m_isRelayConnected = true;
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(), m_localLobby.RelayCode, null);
}
}

7
Assets/Scripts/Tests/PlayMode/LobbyRoundtripTests.cs


using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Unity.Services.Lobbies;
using Unity.Services.Lobbies.Models;
using UnityEngine;

public void Teardown()
{
m_auth?.Dispose();
LogAssert.ignoreFailingMessages = false;
}
/// <summary>

public IEnumerator DoRoundtrip()
{
#region Setup
LogAssert.ignoreFailingMessages = true; // Not sure why, but when auth logs in, it sometimes generates an error: "A Native Collection has not been disposed[...]." We don't want this to cause test failures, since in practice it *seems* to not negatively impact behavior.
// Wait a reasonable amount of time for sign-in to complete.
if (!m_didSigninComplete)
yield return new WaitForSeconds(3);

// Some error messages might be asynchronous, so to reduce spillover into other tests, just wait here for a bit before proceeding.
yield return new WaitForSeconds(3);
LogAssert.ignoreFailingMessages = false;
}
/// <summary>

public IEnumerator OnCompletesOnFailure()
{
LogAssert.ignoreFailingMessages = true;
LogAssert.Expect(LogType.Exception, new Regex(".*400 Bad Request.*"));
if (!m_didSigninComplete)
yield return new WaitForSeconds(3);
if (!m_didSigninComplete)

2
Assets/Scripts/Tests/PlayMode/RelayRoundTripTests.cs


public void Teardown()
{
m_auth?.Dispose();
LogAssert.ignoreFailingMessages = false;
}
/// <summary>

[UnityTest]
public IEnumerator DoBaseRoundTrip()
{
LogAssert.ignoreFailingMessages = true;
if (!m_didSigninComplete)
yield return new WaitForSeconds(3);
if (!m_didSigninComplete)

1
Assets/Scripts/UI/JoinCreateLobbyUI.cs


if (observed.State == GameState.JoinMenu)
{
Show();
Locator.Get.Messenger.OnReceiveMessage(MessageType.QueryLobbies, null);
}
else
{

18
Assets/Scripts/UI/JoinMenuUI.cs


using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

{
[SerializeField]
LobbyButtonUI m_LobbyButtonPrefab;
[SerializeField]
TMP_InputField m_LobbyCodeField;
[SerializeField]
RectTransform m_LobbyButtonParent;

RemoveLobbyButton(m_LocalLobby[key]);
}
bool CanDisplay(LocalLobby lobby)
public void JoinMenuChangedVisibility(bool show)
{
if (show)
OnRefresh();
}
private bool CanDisplay(LocalLobby lobby)
{
return lobby.Data.State == LobbyState.Lobby && !lobby.Private;
}

/// </summary>
void AddNewLobbyButton(string lobbyCode, LocalLobby lobby)
private void AddNewLobbyButton(string lobbyCode, LocalLobby lobby)
{
var lobbyButtonInstance = Instantiate(m_LobbyButtonPrefab, m_LobbyButtonParent);
lobbyButtonInstance.GetComponent<LocalLobbyObserver>().BeginObserving(lobby);

m_LocalLobby.Add(lobbyCode, lobby);
}
void UpdateLobbyButton(string lobbyCode, LocalLobby lobby)
private void UpdateLobbyButton(string lobbyCode, LocalLobby lobby)
void RemoveLobbyButton(LocalLobby lobby)
private void RemoveLobbyButton(LocalLobby lobby)
{
var lobbyID = lobby.LobbyID;
var lobbyButton = m_LobbyButtons[lobbyID];

11
Assets/Scripts/UI/SpinnerUI.cs


errorTextVisibility.Show();
var errorString = new StringBuilder();
errorString.Append("Error");
var codeString = ": " + observed.lastErrorCode;
if (observed.lastErrorCode < 1)
codeString = ".";
errorString.Append(": ");
if (observed.lastErrorCode > 0)
{
errorString.Append(observed.lastErrorCode);
errorString.Append(", ");
}
errorString.Append("Check Unity Console Log for Details.");
errorString.Append(codeString);
errorText.SetText(errorString.ToString());
}
else if (observed.State == LobbyQueryState.Fetched)

2
Assets/Scripts/UI/UIPanelBase.cs


public class UIPanelBase : MonoBehaviour
{
[SerializeField]
private UnityEvent<bool> m_onVisibilityChange;
protected UnityEvent<bool> m_onVisibilityChange;
bool showing;
CanvasGroup m_canvasGroup;

4
Packages/manifest.json


{
"dependencies": {
"com.unity.collab-proxy": "1.5.7",
"com.unity.collab-proxy": "1.7.1",
"com.unity.test-framework": "1.1.26",
"com.unity.test-framework": "1.1.27",
"com.unity.textmeshpro": "3.0.6",
"com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.20-preview",
"com.unity.ugui": "1.0.0",

4
Packages/packages-lock.json


"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.5.7",
"version": "1.7.1",
"depth": 0,
"source": "registry",
"dependencies": {

"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.26",
"version": "1.1.27",
"depth": 0,
"source": "registry",
"dependencies": {

4
ProjectSettings/ProjectVersion.txt


m_EditorVersion: 2020.3.14f1
m_EditorVersionWithRevision: 2020.3.14f1 (d0d1bb862f9d)
m_EditorVersion: 2020.3.15f2
m_EditorVersionWithRevision: 2020.3.15f2 (6cf78cb77498)

33
Assets/Scripts/Lobby/LobbyListHeartbeat.cs


using UnityEngine;
namespace LobbyRelaySample
{
/// <summary>
/// Keeps the lobby list updated automatically.
/// </summary>
public class LobbyListHeartbeat : MonoBehaviour
{
private const float k_refreshRate = 5;
private float m_refreshTimer = 0;
// This is called in-editor via events.
public void SetActive(bool isActive)
{
if (isActive)
Locator.Get.UpdateSlow.Subscribe(OnUpdate);
else
Locator.Get.UpdateSlow.Unsubscribe(OnUpdate);
m_refreshTimer = 0;
}
private void OnUpdate(float dt)
{
m_refreshTimer += dt;
if (m_refreshTimer > k_refreshRate)
{
Locator.Get.Messenger.OnReceiveMessage(MessageType.QueryLobbies, null);
m_refreshTimer = 0;
}
}
}
}

11
Assets/Scripts/Lobby/LobbyListHeartbeat.cs.meta


fileFormatVersion: 2
guid: 48ec34a3875818e4690f1bf0be69ccd9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存