浏览代码

merge in latest Vivox and UI Fixes

/main/staging/UI_Marketing_Assets
当前提交
87f68c15
共有 7 个文件被更改,包括 321 次插入285 次删除
  1. 264
      Assets/Prefabs/UI/LobbyUserList.prefab
  2. 165
      Assets/Prefabs/UI/UserCardPanel.prefab
  3. 63
      Assets/Scripts/Game/GameManager.cs
  4. 9
      Assets/Scripts/UI/InLobbyUserUI.cs
  5. 49
      Assets/Scripts/UI/LobbyUserVolumeUI.cs
  6. 39
      Assets/Scripts/Vivox/VivoxSetup.cs
  7. 17
      Assets/Scripts/Vivox/VivoxUserHandler.cs

264
Assets/Prefabs/UI/LobbyUserList.prefab


m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Type: 1
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 25
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3968770772770051327
GameObject:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Type: 1
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 25
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4463750083940306589
GameObject:
m_ObjectHideFlags: 0

m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.14320946, g: 1, b: 0, a: 0.392}
m_RaycastTarget: 1
m_RaycastTarget: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:

m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 25
m_PixelsPerUnitMultiplier: 1
--- !u!225 &633533396086944350
CanvasGroup:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Type: 1
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 25
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5545711432599127081
GameObject:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Type: 1
m_Sprite: {fileID: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 25
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6990331669219684648
GameObject:
m_ObjectHideFlags: 0

m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 0}
m_Type: 0
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 25
m_PixelsPerUnitMultiplier: 1
--- !u!1001 &2300164376451760337
PrefabInstance:
m_ObjectHideFlags: 0

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3540056819003737500, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 3667934756810823183, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 5235189765028238254, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: showing
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5804120253616419419, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
- target: {fileID: 6727759267638039682, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_Alpha
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7147564553318460541, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
--- !u!224 &3685075291402800769 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3229036008637484624, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
m_PrefabInstance: {fileID: 2300164376451760337}
m_PrefabAsset: {fileID: 0}
--- !u!114 &6290668908104815487 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5235189765028238254, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}

m_Script: {fileID: 11500000, guid: 9557a5d232068a149987bc0753800f26, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!224 &3685075291402800769 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3229036008637484624, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
m_PrefabInstance: {fileID: 2300164376451760337}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &4128781293466929275
PrefabInstance:
m_ObjectHideFlags: 0

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3540056819003737500, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 3667934756810823183, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 5804120253616419419, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
- target: {fileID: 6496917371405060994, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_IsActive
value: 1
objectReference: {fileID: 0}
- target: {fileID: 7147564553318460541, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y

objectReference: {fileID: 0}
- target: {fileID: 7147564553318460541, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3540056819003737500, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 3667934756810823183, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 5235189765028238254, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: showing
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5804120253616419419, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
- target: {fileID: 6727759267638039682, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_Alpha
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7147564553318460541, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
--- !u!224 &8268348179057556550 stripped

propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3540056819003737500, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 3667934756810823183, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_fontSize
value: 26.15
objectReference: {fileID: 0}
- target: {fileID: 5235189765028238254, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: showing
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5804120253616419419, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0

propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5951250847120169819, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6125340877524701612, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
- target: {fileID: 6727759267638039682, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_Alpha
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7147564553318460541, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}

objectReference: {fileID: 0}
- target: {fileID: 7147564553318460541, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7829259871691718144, guid: 9c09208dc6d58f54aabb57c12071b660, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []

165
Assets/Prefabs/UI/UserCardPanel.prefab


m_Component:
- component: {fileID: 5804120253616419419}
- component: {fileID: 2300860716923514497}
- component: {fileID: 2223479915085606041}
- component: {fileID: 77300716038833936}
m_Layer: 5
m_Name: NameArea

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 2130654709780603783}
- {fileID: 994818836925869738}
- {fileID: 2263383039778102024}
m_Father: {fileID: 3229036008637484624}
m_RootOrder: 1

m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 48478561380765136}
m_CullTransparentMesh: 1
--- !u!114 &2223479915085606041
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 48478561380765136}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &77300716038833936
MonoBehaviour:
m_ObjectHideFlags: 0

m_FlexibleWidth: -1
m_FlexibleHeight: -1
m_LayoutPriority: 1
--- !u!1 &595092683638337859
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 994818836925869738}
- component: {fileID: 541474041131233823}
- component: {fileID: 8897601036511813883}
m_Layer: 5
m_Name: Icon
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &994818836925869738
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 595092683638337859}
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: 5804120253616419419}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: -10, y: -10}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &541474041131233823
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 595092683638337859}
m_CullTransparentMesh: 1
--- !u!114 &8897601036511813883
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 595092683638337859}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!1 &1014963910132780244
GameObject:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 8
m_PixelsPerUnitMultiplier: 1
--- !u!114 &4091003447092978106
MonoBehaviour:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_IgnoreLayout: 0
m_MinWidth: 30
m_MinWidth: -1
m_PreferredWidth: 40
m_PreferredWidth: 50
m_PreferredHeight: -1
m_FlexibleWidth: -1
m_FlexibleHeight: -1

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.509434, g: 0.509434, b: 0.509434, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 12
m_PixelsPerUnitMultiplier: 1
--- !u!1 &3518057056990530202
GameObject:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 15
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4359492793504584915
GameObject:
m_ObjectHideFlags: 0

m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5804120253616419419}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 8
m_PixelsPerUnitMultiplier: 1
--- !u!1 &4432222175381684398
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.084905684, g: 0.084905684, b: 0.084905684, a: 0.392}
m_Color: {r: 0.047169805, g: 0.047169805, b: 0.047169805, a: 0.392}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 8
m_PixelsPerUnitMultiplier: 1
--- !u!114 &6751323253702406882
MonoBehaviour:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_volumeSliderContainer: {fileID: 6299655602247130973}
m_muteButtonContainer: {fileID: 6569968321909521185}
m_muteToggleContainer: {fileID: 6569968321909521185}
m_volumeSlider: {fileID: 774196503220678520}
m_muteToggle: {fileID: 6442186483341508885}
--- !u!114 &6299655602247130973
MonoBehaviour:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Type: 1
m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 0
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4

m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 15
m_PixelsPerUnitMultiplier: 1
--- !u!1 &5814127278131131629
GameObject:
m_ObjectHideFlags: 0

m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.9245283, g: 0.9245283, b: 0.9245283, a: 1}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1

m_Sprite: {fileID: 21300000, guid: df079b79a31b7ee458df2e5bbe02299a, type: 3}
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1

m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 12
m_PixelsPerUnitMultiplier: 1
--- !u!1 &6163925503969852289
GameObject:
m_ObjectHideFlags: 0

m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: :(
m_text:
m_sharedMaterial: {fileID: 2100000, guid: 79459efec17a4d00a321bdcc27bbc385, type: 2}
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
m_fontSharedMaterials: []
m_fontMaterial: {fileID: 0}
m_fontMaterials: []

m_faceColor:
serializedVersion: 2
rgba: 4294967295
m_fontSize: 25
m_fontSizeBase: 25
m_fontSize: 36
m_fontSizeBase: 36
m_enableAutoSizing: 0
m_enableAutoSizing: 1
m_fontSizeMin: 18
m_fontSizeMax: 72
m_fontStyle: 0

m_VertexBufferAutoSizeReduction: 0
m_useMaxVisibleDescender: 1
m_pageToDisplay: 1
m_margin: {x: 0, y: 0, z: 0, w: 3}
m_margin: {x: 5, y: 5, z: 5, w: 5}
m_isUsingLegacyAnimationComponent: 0
m_isVolumetricText: 0
m_hasFontAssetChanged: 0

63
Assets/Scripts/Game/GameManager.cs


using LobbyRelaySample.relay;
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

Debug.Log("Signed in.");
m_localUser.ID = Locator.Get.Identity.GetSubIdentity(Auth.IIdentityType.Auth).GetContent("id");
m_localUser.DisplayName = NameGenerator.GetName(m_localUser.ID);
m_vivoxSetup.Initialize(m_vivoxUserHandlers); // Should be before AddPlayer, since that will attempt to set the Vivox ID based on the Auth ID.
StartVivoxLogin();
}
private void BeginObservers()

m_lobbyContentHeartbeat.BeginTracking(m_localLobby, m_localUser);
SetUserLobbyState();
StartRelayConnection();
m_vivoxSetup.JoinLobbyChannel(m_localLobby.LobbyID, null); // TODO: Retry on failure?
StartVivoxJoin();
}
private void OnLeftLobby()

SetGameState(GameState.JoinMenu);
}
private void StartVivoxLogin()
{
m_vivoxSetup.Initialize(m_vivoxUserHandlers, OnVivoxLoginComplete);
void OnVivoxLoginComplete(bool didSucceed)
{
if (!didSucceed)
{ Debug.LogError("Vivox login failed! Retrying in 5s...");
StartCoroutine(RetryConnection(StartVivoxLogin, m_localLobby.LobbyID));
return;
}
}
}
private void StartVivoxJoin()
{
m_vivoxSetup.JoinLobbyChannel(m_localLobby.LobbyID, OnVivoxJoinComplete);
void OnVivoxJoinComplete(bool didSucceed)
{
if (!didSucceed)
{ Debug.LogError("Vivox connection failed! Retrying in 5s...");
StartCoroutine(RetryConnection(StartVivoxJoin, m_localLobby.LobbyID));
return;
}
}
}
private void StartRelayConnection()
{
if (m_localUser.IsHost)

OnReceiveMessage(MessageType.LobbyUserStatus, UserStatus.Connecting);
m_relaySetup.BeginRelayJoin(m_localLobby, m_localUser, OnRelayConnected);
}
private void OnRelayConnected(bool didSucceed, RelayUtpClient client)
{
Component.Destroy(m_relaySetup);
m_relaySetup = null;
void OnRelayConnected(bool didSucceed, RelayUtpClient client)
{
Component.Destroy(m_relaySetup);
m_relaySetup = null;
if (!didSucceed)
{ Debug.LogError("Relay connection failed! Retrying in 5s...");
StartCoroutine(RetryConnection(StartRelayConnection, m_localLobby.LobbyID));
return;
}
if (!didSucceed)
{
Debug.LogError("Relay connection failed! Retrying in 5s...");
StartCoroutine(RetryRelayConnection());
return;
m_relayClient = client;
OnReceiveMessage(MessageType.LobbyUserStatus, UserStatus.Lobby);
m_relayClient = client;
OnReceiveMessage(MessageType.LobbyUserStatus, UserStatus.Lobby);
private IEnumerator RetryRelayConnection()
private IEnumerator RetryConnection(Action doConnection, string lobbyId)
StartRelayConnection();
if (m_localLobby != null && m_localLobby.LobbyID == lobbyId && !string.IsNullOrEmpty(lobbyId)) // Ensure we didn't leave the lobby during this waiting period.
doConnection?.Invoke();
}
private void BeginCountDown()

9
Assets/Scripts/UI/InLobbyUserUI.cs


m_StatusText.SetText(SetStatusFancy(observed.UserStatus));
m_EmoteText.SetText(observed.Emote.GetString());
m_HostIcon.enabled = observed.IsHost;
SetAudioState(true);
}
/// <summary>
/// Disable or show the Volume Icons in sync with the package.
/// </summary>
void SetAudioState(bool hasVoice)
{
// TODO: Disable if vivox is not available, per-user.
}
string SetStatusFancy(UserStatus status)

49
Assets/Scripts/UI/LobbyUserVolumeUI.cs


using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI;
namespace LobbyRelaySample.UI
{

private UIPanelBase m_volumeSliderContainer;
[SerializeField]
private UIPanelBase m_muteButtonContainer;
private UIPanelBase m_muteToggleContainer;
[SerializeField]
[Tooltip("This is shown for other players, to mute them.")]
private GameObject m_muteIcon;

public bool IsLocalPlayer { private get; set; }
public void EnableVoice()
[SerializeField]
private Slider m_volumeSlider;
[SerializeField]
private Toggle m_muteToggle;
/// <param name="shouldResetUi">
/// When the user is being added, we want the UI to reset to the default values.
/// (We don't do this if the user is already in the lobby so that the previous values are retained. E.g. If they're too loud and volume was lowered, keep it lowered on reenable.)
/// </param>
public void EnableVoice(bool shouldResetUi)
if (shouldResetUi)
{ m_volumeSlider.SetValueWithoutNotify(vivox.VivoxUserHandler.NormalizedVolumeDefault);
m_muteToggle.SetIsOnWithoutNotify(false);
}
m_muteButtonContainer.Show();
m_muteToggleContainer.Show();
m_muteIcon.SetActive(false);
m_micMuteIcon.SetActive(true);
}

m_muteButtonContainer.Show();
m_muteToggleContainer.Show();
public void DisableVoice()
/// <param name="shouldResetUi">
/// When the user leaves the lobby (but not if they just lose voice access for some reason, e.g. device disconnect), reset state to the default values.
/// (We can't just do this during Enable since it could cause Vivox to have a state conflict during participant add.)
/// </param>
public void DisableVoice(bool shouldResetUi)
if (shouldResetUi)
{ m_volumeSlider.value = vivox.VivoxUserHandler.NormalizedVolumeDefault;
m_muteToggle.isOn = false;
}
m_muteButtonContainer.Hide(0.4f);
m_muteToggleContainer.Hide(0.4f);
/* TODO : If we can hook in the volume from a user, we can plug it in here.
/// <summary>
/// Controls the visibility of the volume rings to show activity levels of the voice channel on this user.
/// </summary>
/// <param name="normalizedVolume"></param>
public void OnSoundDetected(float normalizedVolume)
{
m_voiceRings.alpha = normalizedVolume;
}
*/
}
}

39
Assets/Scripts/Vivox/VivoxSetup.cs


/// <summary>
/// Initialize the Vivox service, before actually joining any audio channels.
/// </summary>
public void Initialize(List<VivoxUserHandler> userHandlers)
/// <param name="onComplete">Called whether the login succeeds or not.</param>
public void Initialize(List<VivoxUserHandler> userHandlers, Action<bool> onComplete)
{
if (m_isMidInitialize)
return;

m_loginSession = VivoxService.Instance.Client.GetLoginSession(account);
string token = m_loginSession.GetLoginToken();
m_loginSession.BeginLogin(m_loginSession.GetLoginToken(), SubscriptionMode.Accept, null, null, null, result =>
m_loginSession.BeginLogin(token, SubscriptionMode.Accept, null, null, null, result =>
onComplete?.Invoke(true);
}
catch (Exception ex)
{ UnityEngine.Debug.LogWarning("Vivox failed to login: " + ex.Message);
onComplete?.Invoke(false);
}
finally
{

m_channelSession = m_loginSession.GetChannelSession(channel);
string token = m_channelSession.GetConnectToken();
m_channelSession.BeginConnect(true, false, true, m_channelSession.GetConnectToken(), result =>
m_channelSession.BeginConnect(true, false, true, token, result =>
m_channelSession.EndConnect(result); // TODO: Error handling?
onComplete?.Invoke(true);
foreach (VivoxUserHandler userHandler in m_userHandlers)
userHandler.OnChannelJoined(m_channelSession);
try
{ m_channelSession.EndConnect(result);
onComplete?.Invoke(true);
foreach (VivoxUserHandler userHandler in m_userHandlers)
userHandler.OnChannelJoined(m_channelSession);
}
catch (Exception ex)
{ UnityEngine.Debug.LogWarning("Vivox failed to connect: " + ex.Message);
onComplete?.Invoke(false);
}
// TODO: Reset slider and mute UI on lobby enter
/// <summary>
/// To be called when leaving a lobby.

ChannelId id = m_channelSession.Channel;
m_channelSession?.Disconnect(
(result) => { m_loginSession.DeleteChannelSession(id); }); // TODO: What about if this is called while also trying to connect?
if (m_channelSession != null)
{
ChannelId id = m_channelSession.Channel;
m_channelSession?.Disconnect(
(result) => { m_loginSession.DeleteChannelSession(id); m_channelSession = null; });
}
foreach (VivoxUserHandler userHandler in m_userHandlers)
userHandler.OnChannelLeft();
}

/// </summary>
public void Uninitialize()
{
// TODO: Also call LeaveLobbyChannel?
if (!m_hasInitialized)
return;
m_loginSession.Logout();

17
Assets/Scripts/Vivox/VivoxUserHandler.cs


private string m_vivoxId;
private const int k_volumeMin = -50, k_volumeMax = 20; // From the Vivox docs, the valid range is [-50, 50] but anything above 25 risks being painfully loud.
public static float NormalizedVolumeDefault { get { return (0f - k_volumeMin) / (k_volumeMax - k_volumeMin); } }
m_lobbyUserVolumeUI.DisableVoice();
m_lobbyUserVolumeUI.DisableVoice(true);
}
public void SetId(string id)

{
m_vivoxId = participant.Key;
m_lobbyUserVolumeUI.IsLocalPlayer = participant.IsSelf;
m_lobbyUserVolumeUI.EnableVoice();
m_lobbyUserVolumeUI.EnableVoice(true);
break;
}
}

if (isThisUser)
{ m_vivoxId = keyEventArg.Key; // Since we couldn't construct the Vivox ID earlier, retrieve it here.
m_lobbyUserVolumeUI.IsLocalPlayer = participant.IsSelf;
m_lobbyUserVolumeUI.EnableVoice();
m_lobbyUserVolumeUI.EnableVoice(true);
}
}
private void BeforeParticipantRemoved(object sender, KeyEventArg<string> keyEventArg)

bool isThisUser = username == m_id;
if (isThisUser)
{ m_lobbyUserVolumeUI.DisableVoice();
{ m_lobbyUserVolumeUI.DisableVoice(true);
}
}
private void OnParticipantValueUpdated(object sender, ValueEventArg<string, IParticipant> valueEventArg)

if (property == "UnavailableCaptureDevice")
{
if (participant.UnavailableCaptureDevice)
{ m_lobbyUserVolumeUI.DisableVoice();
{ m_lobbyUserVolumeUI.DisableVoice(false);
{ m_lobbyUserVolumeUI.EnableVoice();
{ m_lobbyUserVolumeUI.EnableVoice(false);
participant.SetIsMuteForAll(m_vivoxId, false, null);
}
}

m_lobbyUserVolumeUI.DisableVoice();
m_lobbyUserVolumeUI.DisableVoice(false);
m_lobbyUserVolumeUI.EnableVoice();
m_lobbyUserVolumeUI.EnableVoice(false);
}
}
}

正在加载...
取消
保存