增加自定义不是房间的消息发送
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &321580708899152978
|
||||
--- !u!1 &1425903841360638226
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -8,50 +8,126 @@ GameObject:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2543137441482474711}
|
||||
- component: {fileID: 5877551654343345026}
|
||||
- component: {fileID: 3550301002973458608}
|
||||
- component: {fileID: 5300805363140968968}
|
||||
- component: {fileID: 5191451345274992524}
|
||||
- component: {fileID: 9222681599068246393}
|
||||
m_Layer: 5
|
||||
m_Name: Checkmark
|
||||
m_Name: timebg
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2543137441482474711
|
||||
--- !u!224 &5300805363140968968
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 321580708899152978}
|
||||
m_GameObject: {fileID: 1425903841360638226}
|
||||
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: 2837844887724566989}
|
||||
m_Children:
|
||||
- {fileID: 7705585518263831630}
|
||||
m_Father: {fileID: 6369277911403696094}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 201, y: 90}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5877551654343345026
|
||||
--- !u!222 &5191451345274992524
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 321580708899152978}
|
||||
m_GameObject: {fileID: 1425903841360638226}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3550301002973458608
|
||||
--- !u!114 &9222681599068246393
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 321580708899152978}
|
||||
m_GameObject: {fileID: 1425903841360638226}
|
||||
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: 1}
|
||||
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: 21300000, guid: 8391008d8c962434eb1ae3fe2235ee2a, type: 3}
|
||||
m_Type: 0
|
||||
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 &1726600591133129369
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7387296074118930468}
|
||||
- component: {fileID: 7772809519243248131}
|
||||
- component: {fileID: 2023298079534305092}
|
||||
m_Layer: 5
|
||||
m_Name: host
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7387296074118930468
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1726600591133129369}
|
||||
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: 7859885464769952169}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 55.4833, y: 31.5242}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7772809519243248131
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1726600591133129369}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2023298079534305092
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1726600591133129369}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
@@ -65,7 +141,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 5c840ef367dbb4145b5b21940ad9b42a, type: 3}
|
||||
m_Sprite: {fileID: 21300000, guid: fd41c7c6d497f1140852d29cf8277f46, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -233,6 +309,81 @@ MonoBehaviour:
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!1 &3933354920261553534
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8108507969616965938}
|
||||
- component: {fileID: 2687212554259357246}
|
||||
- component: {fileID: 7926081192790531253}
|
||||
m_Layer: 5
|
||||
m_Name: participant
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8108507969616965938
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3933354920261553534}
|
||||
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: 7859885464769952169}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 55.4833, y: 31.5242}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2687212554259357246
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3933354920261553534}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7926081192790531253
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3933354920261553534}
|
||||
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: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 2a26bf668c86c4043bfb8fd8d492c940, type: 3}
|
||||
m_Type: 0
|
||||
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 &4649353543116731419
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -245,7 +396,7 @@ GameObject:
|
||||
- component: {fileID: 2902496937966524777}
|
||||
- component: {fileID: 1097787652342676154}
|
||||
m_Layer: 5
|
||||
m_Name: head
|
||||
m_Name: headBackground
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -318,7 +469,7 @@ GameObject:
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6369277911403696094}
|
||||
- component: {fileID: 6034827061626817409}
|
||||
- component: {fileID: 7237326272110727671}
|
||||
m_Layer: 5
|
||||
m_Name: callBtn
|
||||
m_TagString: Untagged
|
||||
@@ -339,6 +490,7 @@ RectTransform:
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2837844887724566989}
|
||||
- {fileID: 5300805363140968968}
|
||||
m_Father: {fileID: 4417104378771520476}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
@@ -346,7 +498,7 @@ RectTransform:
|
||||
m_AnchoredPosition: {x: 372.6, y: -4.9}
|
||||
m_SizeDelta: {x: 201, y: 90}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &6034827061626817409
|
||||
--- !u!114 &7237326272110727671
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -355,7 +507,7 @@ MonoBehaviour:
|
||||
m_GameObject: {fileID: 6014281566611695282}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3}
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
@@ -387,13 +539,84 @@ MonoBehaviour:
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 1186836703211952946}
|
||||
toggleTransition: 1
|
||||
graphic: {fileID: 3550301002973458608}
|
||||
m_Group: {fileID: 0}
|
||||
onValueChanged:
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_IsOn: 1
|
||||
--- !u!1 &6359125062023468125
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3905107273573178942}
|
||||
- component: {fileID: 5922978560593592377}
|
||||
- component: {fileID: 2825669493021167576}
|
||||
m_Layer: 5
|
||||
m_Name: idle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3905107273573178942
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6359125062023468125}
|
||||
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: 7859885464769952169}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 55.4833, y: 31.5242}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5922978560593592377
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6359125062023468125}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2825669493021167576
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6359125062023468125}
|
||||
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: 1}
|
||||
m_RaycastTarget: 0
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 21300000, guid: 265c317f817ccff49a4bf89b8f440710, type: 3}
|
||||
m_Type: 0
|
||||
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 &6987273281231925432
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -423,8 +646,7 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2543137441482474711}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 6369277911403696094}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
@@ -549,6 +771,123 @@ MonoBehaviour:
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u6B63\u5728"
|
||||
--- !u!1 &8664299722846729420
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7859885464769952169}
|
||||
m_Layer: 5
|
||||
m_Name: state
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7859885464769952169
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8664299722846729420}
|
||||
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: 3905107273573178942}
|
||||
- {fileID: 7387296074118930468}
|
||||
- {fileID: 8108507969616965938}
|
||||
m_Father: {fileID: 6974172065006321590}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0.5}
|
||||
m_AnchorMax: {x: 1, y: 0.5}
|
||||
m_AnchoredPosition: {x: 69.64163, y: 3.5999756}
|
||||
m_SizeDelta: {x: 55.483307, y: 31.5242}
|
||||
m_Pivot: {x: 1, y: 0.5}
|
||||
--- !u!1 &8722102304089687023
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7705585518263831630}
|
||||
- component: {fileID: 5919733504650662226}
|
||||
- component: {fileID: 3620743404301417476}
|
||||
m_Layer: 5
|
||||
m_Name: Text
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7705585518263831630
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8722102304089687023}
|
||||
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: 5300805363140968968}
|
||||
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: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5919733504650662226
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8722102304089687023}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3620743404301417476
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8722102304089687023}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 28
|
||||
m_FontStyle: 1
|
||||
m_BestFit: 0
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: New Text
|
||||
--- !u!1 &8898328606210663701
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -560,6 +899,7 @@ GameObject:
|
||||
- component: {fileID: 6974172065006321590}
|
||||
- component: {fileID: 5439603828178883627}
|
||||
- component: {fileID: 2337725424442361236}
|
||||
- component: {fileID: 244640206536078914}
|
||||
m_Layer: 5
|
||||
m_Name: Name
|
||||
m_TagString: Untagged
|
||||
@@ -578,14 +918,15 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Children:
|
||||
- {fileID: 7859885464769952169}
|
||||
m_Father: {fileID: 4417104378771520476}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: -36.026123, y: 24.44}
|
||||
m_SizeDelta: {x: 542.9478, y: 48.88}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
m_AnchorMin: {x: 0, y: 0.5}
|
||||
m_AnchorMax: {x: 0, y: 0.5}
|
||||
m_AnchoredPosition: {x: 218.99103, y: 24.439972}
|
||||
m_SizeDelta: {x: 0, y: 48}
|
||||
m_Pivot: {x: 0, y: 0.5}
|
||||
--- !u!222 &5439603828178883627
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -628,3 +969,17 @@ MonoBehaviour:
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u5218\u601D\u8FDC"
|
||||
--- !u!114 &244640206536078914
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8898328606210663701}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_HorizontalFit: 2
|
||||
m_VerticalFit: 0
|
||||
@@ -1280,10 +1280,10 @@ RectTransform:
|
||||
- {fileID: 7887748350863980599}
|
||||
m_Father: {fileID: 7783388917141737424}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 354, y: -164.105}
|
||||
m_SizeDelta: {x: 156, y: 210}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &381078819278503650
|
||||
MonoBehaviour:
|
||||
@@ -1421,7 +1421,7 @@ GameObject:
|
||||
- component: {fileID: 158814623560279589}
|
||||
- component: {fileID: 8482446793258355340}
|
||||
m_Layer: 5
|
||||
m_Name: 'leaveMessage '
|
||||
m_Name: leaveMessage
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -2130,10 +2130,10 @@ RectTransform:
|
||||
- {fileID: 7567076343149667870}
|
||||
m_Father: {fileID: 7783388917141737424}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 128, y: -164.105}
|
||||
m_SizeDelta: {x: 156, y: 210}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &6771289154184075696
|
||||
MonoBehaviour:
|
||||
@@ -2215,10 +2215,10 @@ RectTransform:
|
||||
- {fileID: 7569461943991417744}
|
||||
m_Father: {fileID: 7783388917141737424}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 1032, y: -164.105}
|
||||
m_SizeDelta: {x: 156, y: 210}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &4643204486437404849
|
||||
MonoBehaviour:
|
||||
@@ -2589,7 +2589,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1900594475489427402
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2916,7 +2916,7 @@ GameObject:
|
||||
m_Component:
|
||||
- component: {fileID: 8597690529000886331}
|
||||
m_Layer: 5
|
||||
m_Name: Herder
|
||||
m_Name: Header
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -3467,10 +3467,10 @@ RectTransform:
|
||||
- {fileID: 7618716810264438359}
|
||||
m_Father: {fileID: 7783388917141737424}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 580, y: -164.105}
|
||||
m_SizeDelta: {x: 156, y: 210}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &5735189789950188702
|
||||
MonoBehaviour:
|
||||
@@ -4266,7 +4266,7 @@ MonoBehaviour:
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_Interactable: 0
|
||||
m_TargetGraphic: {fileID: 4495399438647591392}
|
||||
toggleTransition: 1
|
||||
graphic: {fileID: 2442429801191807688}
|
||||
@@ -4407,7 +4407,7 @@ GameObject:
|
||||
- component: {fileID: 8077382565652814747}
|
||||
- component: {fileID: 767182732603053429}
|
||||
m_Layer: 5
|
||||
m_Name: 'numberOfPeople '
|
||||
m_Name: numberOfPeople
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
@@ -4830,10 +4830,10 @@ RectTransform:
|
||||
- {fileID: 9013449464081928509}
|
||||
m_Father: {fileID: 7783388917141737424}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 806, y: -164.105}
|
||||
m_SizeDelta: {x: 156, y: 210}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &992032984322259916
|
||||
MonoBehaviour:
|
||||
@@ -5802,14 +5802,13 @@ RectTransform:
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 5745363551227600454}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7736829478231073769}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 204}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &824012486064602147
|
||||
MonoBehaviour:
|
||||
@@ -6508,7 +6507,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!224 &6596158407599272745
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -8462,7 +8461,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 204}
|
||||
m_Pivot: {x: 0, y: 1}
|
||||
--- !u!114 &4242186254026826357
|
||||
MonoBehaviour:
|
||||
@@ -8686,7 +8685,7 @@ PrefabInstance:
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
@@ -8696,17 +8695,17 @@ PrefabInstance:
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 1050
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 204
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
@@ -8746,12 +8745,12 @@ PrefabInstance:
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 585
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -102
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3264101774741044826, guid: ac2316fabaf14dc409bee0e9c34cae94,
|
||||
type: 3}
|
||||
@@ -9052,127 +9051,3 @@ RectTransform:
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 7636200732893311030}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1001 &8284112795115087258
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 2
|
||||
m_Modification:
|
||||
serializedVersion: 3
|
||||
m_TransformParent: {fileID: 6975938451169501548}
|
||||
m_Modifications:
|
||||
- target: {fileID: 3634656016516224787, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: ContactEntry
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.x
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_Pivot.y
|
||||
value: 0.5
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 1050
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 204
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalPosition.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.w
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalRotation.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 585
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -102
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
propertyPath: m_LocalEulerAnglesHint.z
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_RemovedGameObjects: []
|
||||
m_AddedGameObjects: []
|
||||
m_AddedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: ad69af7e0b1064245a47eab7445ace67, type: 3}
|
||||
--- !u!224 &5745363551227600454 stripped
|
||||
RectTransform:
|
||||
m_CorrespondingSourceObject: {fileID: 4417104378771520476, guid: ad69af7e0b1064245a47eab7445ace67,
|
||||
type: 3}
|
||||
m_PrefabInstance: {fileID: 8284112795115087258}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
|
||||
@@ -5712,36 +5712,66 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
- target: {fileID: 554749590477148033, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
- target: {fileID: 554749590477148033, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
- target: {fileID: 554749590477148033, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
- target: {fileID: 554749590477148033, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
- target: {fileID: 554749590477148033, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
- target: {fileID: 554749590477148033, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 156
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 210
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 354
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 674764666495542323, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -164.105
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 979448543686126123, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
@@ -5752,6 +5782,21 @@ PrefabInstance:
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1275723802016005422, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: id
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1314532366135138860, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 1715958553176323171, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_Name
|
||||
value: leaveMessage
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2137318455400373245, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
@@ -5782,35 +5827,50 @@ PrefabInstance:
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2392396435560639756, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_Interactable
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2574769142839816776, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2828042130342588004, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2828042130342588004, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2828042130342588004, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
value: 156
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2828042130342588004, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
value: 210
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2828042130342588004, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 1032
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2828042130342588004, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
value: -164.105
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 2899577293863285940, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 3608820285885576044, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
@@ -6005,66 +6065,116 @@ PrefabInstance:
|
||||
- target: {fileID: 4595042593999019917, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4595042593999019917, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4595042593999019917, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
value: 156
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4595042593999019917, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
value: 210
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4595042593999019917, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 806
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4595042593999019917, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
value: -164.105
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 4649949924903219849, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5467042597978700984, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 204
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5745363551227600454, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5745363551227600454, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5745363551227600454, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5745363551227600454, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5745363551227600454, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 5745363551227600454, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6289408088348100223, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6289408088348100223, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6289408088348100223, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
value: 156
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6289408088348100223, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
value: 210
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6289408088348100223, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 128
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6289408088348100223, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -164.105
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6500757347537243115, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 6975938451169501548, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7059412103549008782, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7500051454580514407, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
@@ -6100,33 +6210,43 @@ PrefabInstance:
|
||||
- target: {fileID: 7853531429736316437, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7853531429736316437, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMin.y
|
||||
value: 0
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7853531429736316437, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.x
|
||||
value: 0
|
||||
value: 156
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7853531429736316437, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_SizeDelta.y
|
||||
value: 0
|
||||
value: 210
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7853531429736316437, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.x
|
||||
value: 0
|
||||
value: 580
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 7853531429736316437, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchoredPosition.y
|
||||
value: -164.105
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8196966834453392309, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_Enabled
|
||||
value: 0
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8423585343164055005, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_IsActive
|
||||
value: 1
|
||||
objectReference: {fileID: 0}
|
||||
- target: {fileID: 8664609903398085411, guid: 11ac2a591441d5940b0b146f6dd3025e,
|
||||
type: 3}
|
||||
propertyPath: m_AnchorMax.y
|
||||
|
||||
@@ -5,6 +5,7 @@ using UnityEngine;
|
||||
|
||||
public interface IGlobalConfigSystem : ISystem
|
||||
{
|
||||
public string IP { get; }
|
||||
public string GetConnectionId();
|
||||
public void SetConnectionId(string connectionId);
|
||||
|
||||
@@ -21,6 +22,9 @@ public interface IGlobalConfigSystem : ISystem
|
||||
|
||||
public Texture2D GetConnectionTexture();
|
||||
public void SetConnectionTexture(Texture2D connectionTexture);
|
||||
|
||||
public string GetUserId();
|
||||
public void SetUserId(string userId);
|
||||
}
|
||||
|
||||
public class GlobalConfigSystem : AbstractSystem, IGlobalConfigSystem
|
||||
@@ -53,11 +57,19 @@ public class GlobalConfigSystem : AbstractSystem, IGlobalConfigSystem
|
||||
private CancellationTokenSource _cts;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 连接ID
|
||||
/// </summary>
|
||||
private string _userId;
|
||||
|
||||
|
||||
public override void Dispose()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public string IP => "http://127.0.0.1:8080";
|
||||
|
||||
public string GetConnectionId()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_connectionId))
|
||||
@@ -143,6 +155,22 @@ public class GlobalConfigSystem : AbstractSystem, IGlobalConfigSystem
|
||||
_connectionTexture = connectionTexture;
|
||||
}
|
||||
|
||||
public string GetUserId()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_userId))
|
||||
{
|
||||
Debug.LogWarning("GlobalConfigSystem: GetUserId not set");
|
||||
return "";
|
||||
}
|
||||
|
||||
return _userId;
|
||||
}
|
||||
|
||||
public void SetUserId(string userId)
|
||||
{
|
||||
_userId = userId;
|
||||
}
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using System.Net;
|
||||
using RenderStreaming;
|
||||
using Stary.Evo;
|
||||
using Stary.Evo.UIFarme;
|
||||
@@ -8,6 +9,11 @@ public class Main : MonoBehaviour, IController
|
||||
{
|
||||
private void Start()
|
||||
{
|
||||
ServicePointManager.ServerCertificateValidationCallback =
|
||||
(sender, certificate, chain, sslPolicyErrors) =>
|
||||
{
|
||||
return true; // 信任所有证书,仅开发环境使用
|
||||
};
|
||||
this.GetSystem<IPanelSystem>().PushQueue<StartPanel>();
|
||||
}
|
||||
|
||||
|
||||
3
Assets/Script/MainPanel.meta
Normal file
3
Assets/Script/MainPanel.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1645e864f3c440ea9e6155be8f97d045
|
||||
timeCreated: 1779019467
|
||||
201
Assets/Script/MainPanel/ContactEntryController.cs
Normal file
201
Assets/Script/MainPanel/ContactEntryController.cs
Normal file
@@ -0,0 +1,201 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using RenderStreaming;
|
||||
using Stary.Evo;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace Script
|
||||
{
|
||||
public class ContactEntryController : MonoBehaviour, IController
|
||||
{
|
||||
private Transform _background;
|
||||
private Transform _backgroundName;
|
||||
private GameObject _confirmBtnTime;
|
||||
private Text _confirmBtnTimeText;
|
||||
private Button _confirmButton;
|
||||
private bool _isCountingDown;
|
||||
private MeetingContacts _meetingContacts;
|
||||
private Transform _messageText;
|
||||
private Transform _nameText;
|
||||
private MeetingContacts.UsersItem _usersItem;
|
||||
|
||||
private void OnDestroy()
|
||||
{
|
||||
StopAllCoroutines();
|
||||
_isCountingDown = false;
|
||||
}
|
||||
|
||||
public IArchitecture GetArchitecture()
|
||||
{
|
||||
return MainArchitecture.Interface;
|
||||
}
|
||||
|
||||
public void SetData(MeetingContacts.UsersItem item, MeetingContacts meetingContactsController)
|
||||
{
|
||||
_usersItem = item;
|
||||
_meetingContacts = meetingContactsController;
|
||||
///头像赋值
|
||||
if (string.IsNullOrEmpty(item.avatar))
|
||||
{
|
||||
var randomColor = GetRandomColor();
|
||||
_background = transform.Find("headBackground");
|
||||
if (_background != null)
|
||||
{
|
||||
var image = _background.GetComponent<Image>();
|
||||
if (image != null) image.color = randomColor;
|
||||
}
|
||||
|
||||
_backgroundName = _background.transform.Find("Name");
|
||||
if (_backgroundName != null)
|
||||
{
|
||||
var textComponent = _backgroundName.GetComponent<Text>();
|
||||
if (textComponent != null && !string.IsNullOrEmpty(item.name))
|
||||
textComponent.text = item.name.Substring(0, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_background = transform.Find("headBackground");
|
||||
if (_background != null)
|
||||
{
|
||||
var imageComponent = _background.GetComponent<Image>();
|
||||
if (imageComponent != null) DownloadAndSetAvatar(item.avatar, imageComponent);
|
||||
}
|
||||
|
||||
_backgroundName = _background.transform.Find("Name");
|
||||
if (_backgroundName != null) _backgroundName.GetComponent<Text>().text = "";
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.name))
|
||||
_nameText = transform.Find("Name");
|
||||
if (_nameText != null)
|
||||
{
|
||||
var textComponent = _nameText.GetComponent<Text>();
|
||||
if (textComponent != null) textComponent.text = item.name;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.userId))
|
||||
{
|
||||
_messageText = transform.Find("Message");
|
||||
if (_messageText != null)
|
||||
{
|
||||
var textComponent = _messageText.GetComponent<Text>();
|
||||
if (textComponent != null) textComponent.text = item.userId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(item.role))
|
||||
{
|
||||
var role = item.role;
|
||||
var idle = transform.Find("Name/state/idle");
|
||||
var participant = transform.Find("Name/state/participant");
|
||||
var host = transform.Find("Name/state/host");
|
||||
|
||||
if (role.Equals("host"))
|
||||
{
|
||||
host.gameObject.SetActive(true);
|
||||
participant.gameObject.SetActive(false);
|
||||
idle.gameObject.SetActive(false);
|
||||
}
|
||||
else if (role.Equals("participant"))
|
||||
{
|
||||
participant.gameObject.SetActive(true);
|
||||
host.gameObject.SetActive(false);
|
||||
idle.gameObject.SetActive(false);
|
||||
}
|
||||
else if (role.Equals("idle"))
|
||||
{
|
||||
idle.gameObject.SetActive(true);
|
||||
host.gameObject.SetActive(false);
|
||||
participant.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
_confirmButton = transform.Find("callBtn").GetComponent<Button>();
|
||||
_confirmButton.onClick.AddListener(OnClickEntry);
|
||||
_confirmBtnTime = _confirmButton.transform.Find("timebg").gameObject;
|
||||
_confirmBtnTimeText = _confirmBtnTime.transform.Find("Text").GetComponent<Text>();
|
||||
_confirmBtnTime.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private void OnClickEntry()
|
||||
{
|
||||
if (_isCountingDown)
|
||||
{
|
||||
Debug.Log("倒计时进行中,无法点击");
|
||||
return;
|
||||
}
|
||||
|
||||
Debug.Log($"点击了联系人: {_usersItem.name}");
|
||||
// 这里可以添加点击联系人后的逻辑,比如打开聊天窗口
|
||||
// 或者发送邀请请求等
|
||||
_meetingContacts.ClickContactEntry(_background.GetComponent<Image>().sprite,
|
||||
_backgroundName.GetComponent<Text>().text, _usersItem);
|
||||
_meetingContacts.CurrentEntry = this;
|
||||
}
|
||||
|
||||
public void StartCountdown()
|
||||
{
|
||||
if (_isCountingDown) return;
|
||||
_isCountingDown = true;
|
||||
_confirmButton.interactable = false;
|
||||
_confirmBtnTime.gameObject.SetActive(true);
|
||||
StartCoroutine(CountdownCoroutine(50));
|
||||
}
|
||||
|
||||
private IEnumerator CountdownCoroutine(int seconds)
|
||||
{
|
||||
Debug.Log($"开始{seconds}秒倒计时");
|
||||
for (var i = seconds; i >= 0; i--)
|
||||
{
|
||||
_confirmBtnTimeText.text = i.ToString();
|
||||
Debug.Log($"倒计时: {i}秒");
|
||||
yield return new WaitForSeconds(1);
|
||||
}
|
||||
|
||||
Debug.Log("倒计时结束");
|
||||
_isCountingDown = false;
|
||||
_confirmButton.interactable = true;
|
||||
_confirmBtnTime.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
private Color GetRandomColor()
|
||||
{
|
||||
return new Color(
|
||||
Random.Range(0.2f, 0.8f),
|
||||
Random.Range(0.2f, 0.8f),
|
||||
Random.Range(0.2f, 0.8f),
|
||||
1f
|
||||
);
|
||||
}
|
||||
|
||||
private async void DownloadAndSetAvatar(string avatarUrl, Image targetImage)
|
||||
{
|
||||
try
|
||||
{
|
||||
var tempPath = Path.Combine(Application.temporaryCachePath, $"avatar_{Guid.NewGuid()}.png");
|
||||
var result = await WebRequestSystem.GetFile(avatarUrl, tempPath);
|
||||
|
||||
if (result.code == 200)
|
||||
{
|
||||
var bytes = File.ReadAllBytes(tempPath);
|
||||
var texture = new Texture2D(2, 2);
|
||||
texture.LoadImage(bytes);
|
||||
|
||||
var sprite = Sprite.Create(texture, new Rect(0, 0, texture.width, texture.height),
|
||||
Vector2.one * 0.5f);
|
||||
targetImage.sprite = sprite;
|
||||
|
||||
File.Delete(tempPath);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"下载头像失败: {e.Message}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Script/MainPanel/ContactEntryController.cs.meta
Normal file
3
Assets/Script/MainPanel/ContactEntryController.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c16475152291466fa053f892d1ec0c8b
|
||||
timeCreated: 1779100629
|
||||
@@ -17,6 +17,8 @@ namespace Script
|
||||
/// </summary>
|
||||
private Text _idText;
|
||||
|
||||
private MeetingContacts _meetingContacts;
|
||||
|
||||
/// <summary>
|
||||
/// 房间人数
|
||||
/// </summary>
|
||||
@@ -36,7 +38,6 @@ namespace Script
|
||||
|
||||
public override string UIPath => "Canvas";
|
||||
|
||||
|
||||
public override void Initialize(GameObject panelGo)
|
||||
{
|
||||
base.Initialize(panelGo);
|
||||
@@ -45,11 +46,14 @@ namespace Script
|
||||
_arrowLeft = panelGo.transform.Find("Header/arrow-left").GetComponent<Button>();
|
||||
_idText = panelGo.transform.Find("MeetingInfoCard/meeting/id").GetComponent<Text>();
|
||||
_roomPeopleNumText = panelGo.transform.Find("MeetingInfoCard/numberOfPeople/number").GetComponent<Text>();
|
||||
_meetingContacts = new MeetingContacts();
|
||||
_meetingContacts.Initialize(panelGo.transform.Find("MeetingContacts").gameObject);
|
||||
}
|
||||
|
||||
public override void OnEnter(Action complete = null)
|
||||
{
|
||||
base.OnEnter(complete);
|
||||
_meetingContacts.OnEnter();
|
||||
_arrowLeft.onClick.AddListener(OnArrowLeftClick);
|
||||
}
|
||||
|
||||
@@ -57,6 +61,7 @@ namespace Script
|
||||
public override void OnExit(float delay = 0)
|
||||
{
|
||||
base.OnExit(delay);
|
||||
_meetingContacts.OnExit();
|
||||
_arrowLeft.onClick.RemoveListener(OnArrowLeftClick);
|
||||
}
|
||||
|
||||
188
Assets/Script/MainPanel/MeetingContacts.cs
Normal file
188
Assets/Script/MainPanel/MeetingContacts.cs
Normal file
@@ -0,0 +1,188 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using RenderStreaming;
|
||||
using Stary.Evo;
|
||||
using Unity.RenderStreaming;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Script
|
||||
{
|
||||
public class MeetingContacts : IController
|
||||
{
|
||||
/// <summary>
|
||||
/// 联系人列表项字典
|
||||
/// Key: 参与者ID
|
||||
/// Value: 联系人列表项实例
|
||||
/// </summary>
|
||||
private readonly Dictionary<GameObject, ContactEntryController> _contactEntries = new();
|
||||
|
||||
private Image _avatarImage;
|
||||
private Button _cancelButton;
|
||||
private Button _confirmButton;
|
||||
|
||||
private GameObject _confirmingPop;
|
||||
|
||||
/// <summary>
|
||||
/// 联系人列表项预制体
|
||||
/// </summary>
|
||||
private GameObject _contactEntryPrefab;
|
||||
|
||||
/// <summary>
|
||||
/// 全部联系人列表容器
|
||||
/// </summary>
|
||||
private Transform _content;
|
||||
|
||||
private Text _idText;
|
||||
private InputField _leaveMessage;
|
||||
private Text _messageText;
|
||||
private Text _nameText;
|
||||
|
||||
private GameObject _panelGo;
|
||||
|
||||
public ContactEntryController CurrentEntry { get; set; }
|
||||
|
||||
public IArchitecture GetArchitecture()
|
||||
{
|
||||
return MainArchitecture.Interface;
|
||||
}
|
||||
|
||||
public void Initialize(GameObject panelGo)
|
||||
{
|
||||
_panelGo = panelGo;
|
||||
_contactEntryPrefab = Resources.Load<GameObject>("ContactEntry");
|
||||
_content = _panelGo.transform.Find("MeetingGrid/Viewport/Content");
|
||||
|
||||
//邀请界面
|
||||
_confirmingPop = _panelGo.transform.Find("MeetingGrid/ConfirmingPop").gameObject;
|
||||
_confirmingPop.SetActive(false);
|
||||
//确认邀请
|
||||
_idText = _confirmingPop.transform.Find("bg/id").GetComponent<Text>();
|
||||
_leaveMessage = _confirmingPop.transform.Find("bg/leaveMessage").GetComponent<InputField>();
|
||||
_confirmButton = _confirmingPop.transform.Find("bg/invite").GetComponent<Button>();
|
||||
_cancelButton = _confirmingPop.transform.Find("bg/cancel").GetComponent<Button>();
|
||||
|
||||
_avatarImage = _confirmingPop.transform.Find("ParticipantEntry/head").GetComponent<Image>();
|
||||
_nameText = _confirmingPop.transform.Find("ParticipantEntry/Name").GetComponent<Text>();
|
||||
_messageText = _confirmingPop.transform.Find("ParticipantEntry/Message").GetComponent<Text>();
|
||||
}
|
||||
|
||||
public async void OnEnter()
|
||||
{
|
||||
var response =
|
||||
await WebRequestSystem.Get<ResponseUsers>(this.GetSystem<IGlobalConfigSystem>().IP, "/signaling/users");
|
||||
if (response != null && response.totalCount > 0)
|
||||
for (var i = 0; i < response.totalCount; i++)
|
||||
{
|
||||
var item = response.users[i];
|
||||
if (string.IsNullOrEmpty(item.name) ||
|
||||
string.IsNullOrEmpty(item.userId)) continue;
|
||||
var entry = GameObject.Instantiate(_contactEntryPrefab, _content);
|
||||
var contactEntryController = entry.GetOrAddComponent<ContactEntryController>();
|
||||
contactEntryController.SetData(item, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void OnExit()
|
||||
{
|
||||
}
|
||||
|
||||
public void ClickContactEntry(Sprite avatarImage, string name, UsersItem item)
|
||||
{
|
||||
_confirmingPop.SetActive(true);
|
||||
|
||||
|
||||
_idText.text = this.GetSystem<IGlobalConfigSystem>().GetConnectionId();
|
||||
|
||||
_avatarImage.sprite = avatarImage;
|
||||
var avatarName = _avatarImage.transform.Find("Name").GetComponent<Text>();
|
||||
avatarName.text = name;
|
||||
_nameText.text = item.name;
|
||||
_messageText.text = item.userId;
|
||||
|
||||
_confirmButton.onClick.AddListener(() =>
|
||||
{
|
||||
_confirmingPop.SetActive(false);
|
||||
CurrentEntry.StartCountdown();
|
||||
// var avatar = _profileImage.sprite.name.Replace("(Clone)", "");
|
||||
var userInfo = new
|
||||
{
|
||||
type = "invite-call",
|
||||
data = new
|
||||
{
|
||||
connectionId = this.GetSystem<IGlobalConfigSystem>().GetConnectionId(),
|
||||
targetSocketId = item.socketId,
|
||||
targetUserId = item.userId,
|
||||
inviterUserId = this.GetSystem<IGlobalConfigSystem>().GetUserId(),
|
||||
inviterName = this.GetSystem<IGlobalConfigSystem>().GetConnectionName(),
|
||||
inviterAvatar =
|
||||
$"{this.GetSystem<IGlobalConfigSystem>().IP}/images/head/" +
|
||||
$"{this.GetSystem<IGlobalConfigSystem>().GetConnectionTexture().name}.png"
|
||||
}
|
||||
};
|
||||
SignalingMessageHelper.SendMessage(JsonConvert.SerializeObject(userInfo));
|
||||
});
|
||||
_cancelButton.onClick.AddListener(() =>
|
||||
{
|
||||
_confirmingPop.SetActive(false);
|
||||
CurrentEntry = null;
|
||||
});
|
||||
}
|
||||
|
||||
public class ContactEntryData
|
||||
{
|
||||
public string avatar;
|
||||
public GameObject entry;
|
||||
public Toggle invitationTog;
|
||||
public string name;
|
||||
public string participantId;
|
||||
public string role;
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class ResponseUsers
|
||||
{
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public List<UsersItem> users { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public int totalCount { get; set; }
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class UsersItem
|
||||
{
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string socketId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string connectionId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string participantId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string role { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string userId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string name { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// </summary>
|
||||
public string avatar { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Script/MainPanel/MeetingContacts.cs.meta
Normal file
3
Assets/Script/MainPanel/MeetingContacts.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 05ce391aaa7a4698941ba9f6b0157614
|
||||
timeCreated: 1779019493
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Script;
|
||||
using Stary.Evo;
|
||||
using Stary.Evo.UIFarme;
|
||||
@@ -91,6 +92,24 @@ namespace Unity.RenderStreaming
|
||||
public override void Initialize(GameObject panelGo)
|
||||
{
|
||||
base.Initialize(panelGo);
|
||||
_arrowLeft = panelGo.transform.Find("Herder/arrow-left").GetComponent<Button>();
|
||||
_profilePhoto = panelGo.transform.Find("HeadPortraits/MeetingInfoCard").GetComponent<Button>();
|
||||
_profileImage = _profilePhoto.transform.Find("mask/sprite").GetComponent<Image>();
|
||||
_meetingNameInput = panelGo.transform.Find("card/search/InputField").GetComponent<InputField>();
|
||||
_meetingId = panelGo.transform.Find("card/huiyiID/connectionId").GetComponent<Text>();
|
||||
_randomMeetingId = panelGo.transform.Find("card/huiyiID/Button").GetComponent<Button>();
|
||||
_timeDropdown = panelGo.transform.Find("card/time/Dropdown").GetComponent<Dropdown>();
|
||||
_startButton = panelGo.transform.Find("invite").GetComponent<Button>();
|
||||
_spriteAtlas = Resources.Load<SpriteAtlas>("SpriteAtlas");
|
||||
if (_spriteAtlas != null)
|
||||
{
|
||||
_profileSprites = new Sprite[_spriteAtlas.spriteCount];
|
||||
_spriteAtlas.GetSprites(_profileSprites);
|
||||
}
|
||||
|
||||
_profileSpriteIndex = 0;
|
||||
OnClickProfilePhoto();
|
||||
|
||||
renderStreaming = GameObject.FindObjectOfType<SignalingManager>();
|
||||
hostConnection = GameObject.FindObjectOfType<HostConnection>();
|
||||
videoStreamSender = hostConnection.GetComponent<VideoStreamSender>();
|
||||
@@ -110,23 +129,6 @@ namespace Unity.RenderStreaming
|
||||
if (settings?.SignalingSettings != null)
|
||||
renderStreaming.SetSignalingSettings(settings.SignalingSettings);
|
||||
renderStreaming.Run();
|
||||
_arrowLeft = panelGo.transform.Find("Herder/arrow-left").GetComponent<Button>();
|
||||
_profilePhoto = panelGo.transform.Find("HeadPortraits/MeetingInfoCard").GetComponent<Button>();
|
||||
_profileImage = _profilePhoto.transform.Find("mask/sprite").GetComponent<Image>();
|
||||
_meetingNameInput = panelGo.transform.Find("card/search/InputField").GetComponent<InputField>();
|
||||
_meetingId = panelGo.transform.Find("card/huiyiID/connectionId").GetComponent<Text>();
|
||||
_randomMeetingId = panelGo.transform.Find("card/huiyiID/Button").GetComponent<Button>();
|
||||
_timeDropdown = panelGo.transform.Find("card/time/Dropdown").GetComponent<Dropdown>();
|
||||
_startButton = panelGo.transform.Find("invite").GetComponent<Button>();
|
||||
_spriteAtlas = Resources.Load<SpriteAtlas>("SpriteAtlas");
|
||||
if (_spriteAtlas != null)
|
||||
{
|
||||
_profileSprites = new Sprite[_spriteAtlas.spriteCount];
|
||||
_spriteAtlas.GetSprites(_profileSprites);
|
||||
}
|
||||
|
||||
_profileSpriteIndex = 0;
|
||||
OnClickProfilePhoto();
|
||||
}
|
||||
|
||||
public override void OnEnter(Action complete = null)
|
||||
@@ -183,13 +185,38 @@ namespace Unity.RenderStreaming
|
||||
if (string.IsNullOrEmpty(_meetingNameInput.text)) _meetingNameInput.text = $"{meetingId}的房间";
|
||||
}
|
||||
|
||||
private string OnClickRandomUserId()
|
||||
{
|
||||
return $"user_{Random.Range(100, 999)}";
|
||||
}
|
||||
|
||||
private void OnClickStartButton()
|
||||
{
|
||||
this.GetSystem<IGlobalConfigSystem>().SetUserId(OnClickRandomUserId());
|
||||
this.GetSystem<IGlobalConfigSystem>().SetConnectionTimeType(_timeDropdown.value);
|
||||
this.GetSystem<IGlobalConfigSystem>().SetConnectionId(_meetingId.text);
|
||||
hostConnection.RoomConnectionId = this.GetSystem<IGlobalConfigSystem>().GetConnectionId();
|
||||
this.GetSystem<IGlobalConfigSystem>().SetConnectionName(_meetingNameInput.text);
|
||||
this.GetSystem<IGlobalConfigSystem>().SetConnectionTexture(Texture2D.whiteTexture);
|
||||
this.GetSystem<IGlobalConfigSystem>().SetConnectionTexture(_profileImage.sprite.texture);
|
||||
if (!SignalingMessageHelper.IsReady())
|
||||
{
|
||||
Debug.LogError("Signaling 未就绪");
|
||||
return;
|
||||
}
|
||||
|
||||
var avatar = _profileImage.sprite.name.Replace("(Clone)", "");
|
||||
var userInfo = new
|
||||
{
|
||||
type = "host-userInfo",
|
||||
data = new
|
||||
{
|
||||
connectionId = hostConnection.RoomConnectionId,
|
||||
id = this.GetSystem<IGlobalConfigSystem>().GetUserId(),
|
||||
name = _meetingNameInput.text,
|
||||
avatar = $"{this.GetSystem<IGlobalConfigSystem>().IP}/images/head/{avatar}.png"
|
||||
}
|
||||
};
|
||||
SignalingMessageHelper.SendMessage(JsonConvert.SerializeObject(userInfo));
|
||||
SetUp();
|
||||
PanelSystem.PopQueue<StartPanel>();
|
||||
PanelSystem.PushQueue<MainPanel>();
|
||||
|
||||
509
Assets/Script/WebRequestSystem.cs
Normal file
509
Assets/Script/WebRequestSystem.cs
Normal file
@@ -0,0 +1,509 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using Newtonsoft.Json;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
|
||||
namespace Stary.Evo
|
||||
{
|
||||
public static class WebRequestSystem
|
||||
{
|
||||
private static string authorization;
|
||||
|
||||
static WebRequestSystem()
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
authorization = CustomEditorPrefs.GetString("Authorization");
|
||||
#else
|
||||
authorization = CustomPlayerPrefs.GetString("Authorization");
|
||||
#endif
|
||||
}
|
||||
|
||||
public static async Task<bool> Login(string url, string username, string password)
|
||||
{
|
||||
var data = new
|
||||
{
|
||||
username,
|
||||
password,
|
||||
roleType = "client"
|
||||
};
|
||||
var postData = JsonConvert.SerializeObject(data);
|
||||
try
|
||||
{
|
||||
using var webRequest = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST);
|
||||
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
if (string.IsNullOrEmpty(postData))
|
||||
{
|
||||
Debug.LogError("WebRequestSystem.Login postData is null");
|
||||
return false;
|
||||
}
|
||||
|
||||
var postBytes = Encoding.UTF8.GetBytes(postData);
|
||||
webRequest.uploadHandler = new UploadHandlerRaw(postBytes);
|
||||
webRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
webRequest.timeout = 10;
|
||||
await webRequest.SendWebRequest();
|
||||
webRequest.uploadHandler?.Dispose();
|
||||
// 更新错误检查方式
|
||||
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||
|
||||
webRequest.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
Debug.LogError(webRequest.error);
|
||||
}
|
||||
else
|
||||
{
|
||||
var authResponse =
|
||||
JsonConvert.DeserializeObject<ResultMessageEntity>(webRequest.downloadHandler.text);
|
||||
Debug.Log("UnityEvo:ResultMessageEntity" + authResponse.data);
|
||||
if (authResponse.code == 200)
|
||||
{
|
||||
var authResponseData =
|
||||
JsonConvert.DeserializeObject<AuthenticationResponse>(authResponse.data.ToString());
|
||||
Debug.Log("UnityEvo:AuthenticationResponse" + authResponseData.Token);
|
||||
authorization = authResponseData.Token;
|
||||
#if UNITY_EDITOR
|
||||
CustomEditorPrefs.SetString("Authorization", authorization);
|
||||
#else
|
||||
CustomPlayerPrefs.SetString("Authorization",authorization);
|
||||
#endif
|
||||
|
||||
Debug.Log("UnityEvo:登录成功");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.Login" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET请求数据
|
||||
/// </summary>
|
||||
/// <param name="url">请求数据的URL地址</param>
|
||||
/// <param name="token">token验证的参数,此处为authorization</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<bool> GetValidateToken(string url)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
authorization = CustomEditorPrefs.GetString("Authorization");
|
||||
#else
|
||||
authorization = CustomPlayerPrefs.GetString("Authorization");
|
||||
#endif
|
||||
try
|
||||
{
|
||||
using var webRequest =
|
||||
new UnityWebRequest($"{url}?token={authorization}", UnityWebRequest.kHttpVerbGET);
|
||||
//using UnityWebRequest webRequest = UnityWebRequest.Get($"{url}?token={authorization}");
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
webRequest.timeout = 10;
|
||||
await webRequest.SendWebRequest();
|
||||
// 增强错误处理
|
||||
if (webRequest.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
var errorMsg = $"HTTP {webRequest.responseCode}\n" +
|
||||
$"URL: {url}\n" +
|
||||
$"Error: {webRequest.error}\n" +
|
||||
$"Response: {webRequest.downloadHandler.text}";
|
||||
|
||||
Debug.LogError(errorMsg);
|
||||
return false;
|
||||
}
|
||||
|
||||
var resultMessageEntity =
|
||||
JsonConvert.DeserializeObject<ResultMessageEntity>(webRequest.downloadHandler.text);
|
||||
if (resultMessageEntity.code == 200)
|
||||
return true; // 添加返回值
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.GetValidateToken" + e.Message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST请求数据
|
||||
/// </summary>
|
||||
/// <param name="url">获取Token值的服务URL地址(很重要)</param>
|
||||
/// <param name="postData">传入请求的参数,此处参数为JOSN格式</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ResultMessageEntity> PostFile(string url, string[] path,
|
||||
Dictionary<string, string> headers = null, Action<float> uploadProgress = null)
|
||||
{
|
||||
//UnityWebRequest[] files = new UnityWebRequest[3];
|
||||
var form = new WWWForm();
|
||||
|
||||
for (var i = 0; i < path.Length; i++)
|
||||
{
|
||||
var bytes = await File.ReadAllBytesAsync(path[i]);
|
||||
form.AddBinaryData("files[]", bytes, Path.GetFileName(path[i]));
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
using var webRequest = UnityWebRequest.Post(url, form);
|
||||
|
||||
webRequest.SetRequestHeader("Authorization", authorization);
|
||||
if (headers != null)
|
||||
foreach (var header in headers)
|
||||
webRequest.SetRequestHeader(header.Key, header.Value);
|
||||
|
||||
webRequest.disposeUploadHandlerOnDispose = true;
|
||||
webRequest.disposeDownloadHandlerOnDispose = true;
|
||||
webRequest.disposeCertificateHandlerOnDispose = true;
|
||||
webRequest.timeout = 60;
|
||||
|
||||
// 发送请求但不等待完成
|
||||
var operation = webRequest.SendWebRequest();
|
||||
// 轮询获取上传进度
|
||||
while (!operation.isDone)
|
||||
{
|
||||
// 调用进度回调函数
|
||||
uploadProgress?.Invoke(webRequest.uploadProgress);
|
||||
// 等待一帧,避免阻塞
|
||||
await UniTask.Yield();
|
||||
}
|
||||
|
||||
webRequest.uploadHandler?.Dispose();
|
||||
// 更新错误检查方式
|
||||
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||
|
||||
webRequest.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
Debug.LogError(webRequest.error);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = webRequest.error
|
||||
};
|
||||
}
|
||||
|
||||
var resultMessageEntity =
|
||||
JsonConvert.DeserializeObject<ResultMessageEntity>(webRequest.downloadHandler.text);
|
||||
if (resultMessageEntity.code != 200) Debug.LogError("上传异常,无文件数据返回!!");
|
||||
|
||||
return resultMessageEntity;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.PostFile" + e.Message);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = e.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET请求数据
|
||||
/// </summary>
|
||||
/// <param name="url">请求数据的URL地址</param>
|
||||
/// <param name="token">token验证的参数,此处为authorization</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ResultMessageEntity> GetFile(string url, string tempPath,
|
||||
Action<float> downloadProgress = null)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var webRequest = UnityWebRequest.Get(url);
|
||||
webRequest.downloadHandler = new DownloadHandlerFile(tempPath);
|
||||
if (authorization != null)
|
||||
webRequest.SetRequestHeader("Authorization", authorization); // 修正请求头名称规范
|
||||
|
||||
|
||||
var operation = webRequest.SendWebRequest();
|
||||
while (!operation.isDone)
|
||||
{
|
||||
downloadProgress?.Invoke(webRequest.downloadProgress);
|
||||
await UniTask.Yield();
|
||||
}
|
||||
|
||||
// 增强错误处理
|
||||
if (webRequest.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
var errorMsg = $"HTTP {webRequest.responseCode}\n" +
|
||||
$"URL: {url}\n" +
|
||||
$"Error: {webRequest.error}\n";
|
||||
|
||||
Debug.LogError(errorMsg);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = errorMsg
|
||||
};
|
||||
}
|
||||
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 200,
|
||||
message = "下载成功"
|
||||
};
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.GetFile" + e.Message);
|
||||
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = e.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// GET请求数据
|
||||
/// 携带数据:否
|
||||
/// 幂等性:是
|
||||
/// </summary>
|
||||
/// <param name="url">请求数据的URL地址</param>
|
||||
/// <param name="path">请求数据的路径</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<T> Get<T>(string url, string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var fullUrl = url.TrimEnd('/') + "/" + path.TrimStart('/');
|
||||
using var webRequest = new UnityWebRequest(fullUrl, UnityWebRequest.kHttpVerbGET);
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
if (authorization != null)
|
||||
webRequest.SetRequestHeader("Authorization", authorization); // 修正请求头名称规范
|
||||
|
||||
webRequest.timeout = 20;
|
||||
await webRequest.SendWebRequest();
|
||||
|
||||
// 增强错误处理
|
||||
if (webRequest.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
var errorMsg = $"HTTP {webRequest.responseCode}\n" +
|
||||
$"URL: {url}\n" +
|
||||
$"Error: {webRequest.error}\n" +
|
||||
$"Response: {webRequest.downloadHandler.text}";
|
||||
|
||||
Debug.LogError(errorMsg);
|
||||
}
|
||||
|
||||
var resultMessageEntity =
|
||||
JsonConvert.DeserializeObject<T>(webRequest.downloadHandler.text);
|
||||
|
||||
|
||||
return resultMessageEntity;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.Get" + e.Message);
|
||||
}
|
||||
|
||||
return default;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// POST请求数据
|
||||
/// 携带数据:是
|
||||
/// 幂等性:否
|
||||
/// </summary>
|
||||
/// <param name="url">获取Token值的服务URL地址(很重要)</param>
|
||||
/// <param name="postData">传入请求的参数,此处参数为JOSN格式</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ResultMessageEntity> Post(string url, string postData)
|
||||
{
|
||||
try
|
||||
{
|
||||
using var webRequest = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPOST);
|
||||
// #if UNITY_2021_3_OR_NEWER
|
||||
// using (UnityWebRequest webRequest = UnityWebRequest.PostWwwForm(url, postData)) //第二种写法此行注释
|
||||
// #else
|
||||
// using (UnityWebRequest webRequest = UnityWebRequest.PostWwwForm(url, postData)) //第二种写法此行注释
|
||||
// #endif
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
var postBytes = Encoding.UTF8.GetBytes(postData);
|
||||
webRequest.uploadHandler = new UploadHandlerRaw(postBytes);
|
||||
webRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
webRequest.SetRequestHeader("Authorization", authorization);
|
||||
webRequest.disposeUploadHandlerOnDispose = true;
|
||||
webRequest.disposeDownloadHandlerOnDispose = true;
|
||||
webRequest.disposeCertificateHandlerOnDispose = true;
|
||||
webRequest.timeout = 30;
|
||||
await webRequest.SendWebRequest();
|
||||
webRequest.uploadHandler?.Dispose();
|
||||
// 更新错误检查方式
|
||||
if (webRequest.result == UnityWebRequest.Result.ConnectionError ||
|
||||
webRequest.result == UnityWebRequest.Result.ProtocolError)
|
||||
{
|
||||
Debug.LogError(webRequest.error);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = webRequest.error
|
||||
};
|
||||
}
|
||||
|
||||
var resultMessageEntity =
|
||||
JsonConvert.DeserializeObject<ResultMessageEntity>(webRequest.downloadHandler.text);
|
||||
if (resultMessageEntity.code != 200) Debug.LogError(resultMessageEntity.message);
|
||||
|
||||
return resultMessageEntity;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.Post" + e.Message);
|
||||
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = e.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Delete请求数据
|
||||
/// 携带数据:否
|
||||
/// 幂等性:是
|
||||
/// </summary>
|
||||
/// <param name="url">请求数据的URL地址</param>
|
||||
/// <param name="path">请求数据的路径</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ResultMessageEntity> Delete(string url, string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 修复URL拼接
|
||||
var fullUrl = url.TrimEnd('/') + "/" + path.TrimStart('/');
|
||||
using var webRequest = new UnityWebRequest(fullUrl, UnityWebRequest.kHttpVerbDELETE);
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
if (authorization != null)
|
||||
webRequest.SetRequestHeader("Authorization", authorization); // 修正请求头名称规范
|
||||
|
||||
webRequest.timeout = 20;
|
||||
await webRequest.SendWebRequest();
|
||||
|
||||
// 增强错误处理
|
||||
if (webRequest.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
var errorMsg = $"HTTP {webRequest.responseCode}\n" +
|
||||
$"URL: {url}\n" +
|
||||
$"Error: {webRequest.error}\n" +
|
||||
$"Response: {webRequest.downloadHandler.text}";
|
||||
|
||||
Debug.LogError(errorMsg);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = errorMsg
|
||||
};
|
||||
}
|
||||
|
||||
// 修复空响应处理
|
||||
var responseText = webRequest.downloadHandler.text;
|
||||
if (string.IsNullOrEmpty(responseText))
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 200,
|
||||
message = "删除成功"
|
||||
};
|
||||
|
||||
var resultMessageEntity =
|
||||
JsonConvert.DeserializeObject<ResultMessageEntity>(webRequest.downloadHandler.text);
|
||||
if (resultMessageEntity.code != 200) Debug.LogError(resultMessageEntity.message);
|
||||
|
||||
return resultMessageEntity;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.Get" + e.Message);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = e.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// PUT请求数据
|
||||
/// 携带数据:是
|
||||
/// 幂等性:是
|
||||
/// </summary>
|
||||
/// <param name="url">请求数据的URL地址</param>
|
||||
/// <param name="path">请求数据的路径</param>
|
||||
/// <param name="putData">要更新的数据(JSON格式)</param>
|
||||
/// <returns></returns>
|
||||
public static async Task<ResultMessageEntity> Put(string url, string putData)
|
||||
{
|
||||
try
|
||||
{
|
||||
// 修复URL拼接
|
||||
|
||||
using var webRequest = new UnityWebRequest(url, UnityWebRequest.kHttpVerbPUT);
|
||||
|
||||
// 设置上传处理器
|
||||
var putBytes = Encoding.UTF8.GetBytes(putData);
|
||||
webRequest.uploadHandler = new UploadHandlerRaw(putBytes);
|
||||
webRequest.downloadHandler = new DownloadHandlerBuffer();
|
||||
|
||||
// 设置请求头
|
||||
webRequest.SetRequestHeader("Content-Type", "application/json");
|
||||
if (authorization != null)
|
||||
webRequest.SetRequestHeader("Authorization", authorization); // 修正请求头名称规范
|
||||
|
||||
webRequest.timeout = 20;
|
||||
await webRequest.SendWebRequest();
|
||||
|
||||
// 增强错误处理
|
||||
if (webRequest.result != UnityWebRequest.Result.Success)
|
||||
{
|
||||
var errorMsg = $"HTTP {webRequest.responseCode}\n" +
|
||||
$"URL: {url}\n" +
|
||||
$"Error: {webRequest.error}\n" +
|
||||
$"Response: {webRequest.downloadHandler.text}";
|
||||
|
||||
Debug.LogError(errorMsg);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = errorMsg
|
||||
};
|
||||
}
|
||||
|
||||
// 处理空响应
|
||||
var responseText = webRequest.downloadHandler.text;
|
||||
if (string.IsNullOrEmpty(responseText))
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 200,
|
||||
message = "更新成功"
|
||||
};
|
||||
|
||||
var resultMessageEntity =
|
||||
JsonConvert.DeserializeObject<ResultMessageEntity>(webRequest.downloadHandler.text);
|
||||
if (resultMessageEntity.code != 200) Debug.LogError(resultMessageEntity.message);
|
||||
|
||||
return resultMessageEntity;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError("UnityEvo:WebRequestSystem.Put" + e.Message);
|
||||
return new ResultMessageEntity
|
||||
{
|
||||
code = 5001,
|
||||
message = e.Message
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Assets/Script/WebRequestSystem.cs.meta
Normal file
3
Assets/Script/WebRequestSystem.cs.meta
Normal file
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1c54940c4eaf5c34c8b143ec9c131d53
|
||||
timeCreated: 1741230908
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using UnityEngine;
|
||||
@@ -11,17 +10,14 @@ namespace Unity.RenderStreaming
|
||||
{
|
||||
public class MessageChannel : DataChannelBase
|
||||
{
|
||||
public event Action<string, UserInfo> OnUserInfoMessageReceived;
|
||||
public event Action<string, MediaStateChange> OnMediaStateChangeReceived;
|
||||
private const int MAX_HISTORY = 100;
|
||||
|
||||
[Header("消息记录")] [SerializeField, TextArea(1, 3)]
|
||||
[Header("消息记录")] [SerializeField] [TextArea(1, 3)]
|
||||
private string lastReceivedMessage;
|
||||
|
||||
[SerializeField] private int receivedMessageCount;
|
||||
|
||||
[SerializeField] private List<MessageRecord> messageHistory = new List<MessageRecord>();
|
||||
|
||||
private const int MAX_HISTORY = 100;
|
||||
[SerializeField] private List<MessageRecord> messageHistory = new();
|
||||
|
||||
public IReadOnlyList<MessageRecord> MessageHistory => messageHistory;
|
||||
public int ReceivedMessageCount => receivedMessageCount;
|
||||
@@ -31,18 +27,18 @@ namespace Unity.RenderStreaming
|
||||
label = "on-message";
|
||||
}
|
||||
|
||||
public event Action<string, UserInfo> OnUserInfoMessageReceived;
|
||||
public event Action<string, MediaStateChange> OnMediaStateChangeReceived;
|
||||
|
||||
public override void OnMessage(string message)
|
||||
{
|
||||
try
|
||||
{
|
||||
Debug.Log($"[MessageChannel] Received: {message}");
|
||||
var record = JsonConvert.DeserializeObject<MessageRecord>(message);
|
||||
if (record == null)
|
||||
{
|
||||
record = new MessageRecord { type = "raw", data = message };
|
||||
}
|
||||
if (record == null) record = new MessageRecord { type = "raw", data = message };
|
||||
record.timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
ConnectionId=record.connectionId;
|
||||
ConnectionId = record.connectionId;
|
||||
JObject json = null;
|
||||
switch (record.type)
|
||||
{
|
||||
@@ -79,9 +75,9 @@ namespace Unity.RenderStreaming
|
||||
var record = new MessageRecord
|
||||
{
|
||||
type = type,
|
||||
data = JsonConvert.SerializeObject(data)
|
||||
data = data
|
||||
};
|
||||
string json = JsonConvert.SerializeObject(record);
|
||||
var json = JsonConvert.SerializeObject(record);
|
||||
Send(json);
|
||||
|
||||
record.isSent = true;
|
||||
@@ -90,14 +86,6 @@ namespace Unity.RenderStreaming
|
||||
messageHistory.RemoveAt(0);
|
||||
}
|
||||
|
||||
public void SendMessage(string message)
|
||||
{
|
||||
Send(message);
|
||||
var record = new MessageRecord { type = "raw", data = message, isSent = true };
|
||||
messageHistory.Add(record);
|
||||
if (messageHistory.Count > MAX_HISTORY)
|
||||
messageHistory.RemoveAt(0);
|
||||
}
|
||||
|
||||
public void ClearHistory()
|
||||
{
|
||||
@@ -110,11 +98,11 @@ namespace Unity.RenderStreaming
|
||||
public class MessageRecord
|
||||
{
|
||||
public string type;
|
||||
public object data;
|
||||
public bool isSent;
|
||||
public string timestamp = DateTime.Now.ToString();
|
||||
public string connectionId;
|
||||
public string participantId;
|
||||
public object data;
|
||||
}
|
||||
}
|
||||
}
|
||||
85
Assets/Script/WebRtc/SignalingMessageHelper.cs
Normal file
85
Assets/Script/WebRtc/SignalingMessageHelper.cs
Normal file
@@ -0,0 +1,85 @@
|
||||
// Assets/Script/WebRtc/SignalingMessageHelper.cs
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Unity.RenderStreaming
|
||||
{
|
||||
public static class SignalingMessageHelper
|
||||
{
|
||||
private static object _webSocketSignaling;
|
||||
private static MethodInfo _sendRawMessageMethod;
|
||||
|
||||
static SignalingMessageHelper()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
private static void Initialize()
|
||||
{
|
||||
try
|
||||
{
|
||||
var signalingManager = GameObject.FindObjectOfType<SignalingManager>();
|
||||
if (signalingManager == null)
|
||||
{
|
||||
Debug.LogWarning("SignalingMessageHelper: 找不到 SignalingManager");
|
||||
return;
|
||||
}
|
||||
|
||||
var managerInternalField = typeof(SignalingManager).GetField("m_instance",
|
||||
BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
var managerInternal = managerInternalField.GetValue(signalingManager);
|
||||
|
||||
if (managerInternal == null)
|
||||
{
|
||||
Debug.LogWarning("SignalingMessageHelper: SignalingManager 内部实例为空");
|
||||
return;
|
||||
}
|
||||
|
||||
var signalingField = managerInternal.GetType().GetField("_signaling",
|
||||
BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
_webSocketSignaling = signalingField.GetValue(managerInternal);
|
||||
|
||||
if (_webSocketSignaling == null)
|
||||
{
|
||||
Debug.LogWarning("SignalingMessageHelper: WebSocketSignaling 实例为空");
|
||||
return;
|
||||
}
|
||||
|
||||
_sendRawMessageMethod = _webSocketSignaling.GetType().GetMethod("SendMessage");
|
||||
if (_sendRawMessageMethod == null) Debug.LogWarning("SignalingMessageHelper: 找不到 SendRawMessage 方法");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"SignalingMessageHelper 初始化失败: {e.Message}");
|
||||
}
|
||||
}
|
||||
|
||||
public static bool SendMessage(string message)
|
||||
{
|
||||
if (_webSocketSignaling == null || _sendRawMessageMethod == null)
|
||||
{
|
||||
Debug.LogError("SignalingMessageHelper 未正确初始化,请确保 WebSocketSignaling 已启动");
|
||||
return false;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_sendRawMessageMethod.Invoke(_webSocketSignaling, new[] { message });
|
||||
Debug.Log("消息已发送到服务端");
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.LogError($"发送消息失败: {e.Message}");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static bool IsReady()
|
||||
{
|
||||
return _webSocketSignaling != null && _sendRawMessageMethod != null;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Script/WebRtc/SignalingMessageHelper.cs.meta
Normal file
11
Assets/Script/WebRtc/SignalingMessageHelper.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: cee7bdd2c1f4deb4f9abcfba0ec09ddd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sprite/Meeting - Contacts/容器 108@1x.png
Normal file
BIN
Assets/Sprite/Meeting - Contacts/容器 108@1x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.1 KiB |
140
Assets/Sprite/Meeting - Contacts/容器 108@1x.png.meta
Normal file
140
Assets/Sprite/Meeting - Contacts/容器 108@1x.png.meta
Normal file
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2a26bf668c86c4043bfb8fd8d492c940
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sprite/Meeting - Contacts/容器 109@1x 1.png
Normal file
BIN
Assets/Sprite/Meeting - Contacts/容器 109@1x 1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.0 KiB |
140
Assets/Sprite/Meeting - Contacts/容器 109@1x 1.png.meta
Normal file
140
Assets/Sprite/Meeting - Contacts/容器 109@1x 1.png.meta
Normal file
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: fd41c7c6d497f1140852d29cf8277f46
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sprite/Meeting - Contacts/容器 110@1x.png
Normal file
BIN
Assets/Sprite/Meeting - Contacts/容器 110@1x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
140
Assets/Sprite/Meeting - Contacts/容器 110@1x.png.meta
Normal file
140
Assets/Sprite/Meeting - Contacts/容器 110@1x.png.meta
Normal file
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 265c317f817ccff49a4bf89b8f440710
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/Sprite/Meeting - Contacts/容器 95@1x 1.png
Normal file
BIN
Assets/Sprite/Meeting - Contacts/容器 95@1x 1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
140
Assets/Sprite/Meeting - Contacts/容器 95@1x 1.png.meta
Normal file
140
Assets/Sprite/Meeting - Contacts/容器 95@1x 1.png.meta
Normal file
@@ -0,0 +1,140 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8391008d8c962434eb1ae3fe2235ee2a
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 0
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 3
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -14,14 +14,14 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
automaticStreaming: 0
|
||||
signalingSettings:
|
||||
rid: 9043491426209103878
|
||||
rid: 236153504754827269
|
||||
references:
|
||||
version: 2
|
||||
RefIds:
|
||||
- rid: 9043491426209103878
|
||||
- rid: 236153504754827269
|
||||
type: {class: WebSocketSignalingSettings, ns: Unity.RenderStreaming, asm: Unity.RenderStreaming}
|
||||
data:
|
||||
m_url: wss://192.168.31.16:8080
|
||||
m_url: ws://192.168.31.16:8080
|
||||
m_iceServers:
|
||||
- m_urls:
|
||||
- stun:stun.l.google.com:19302
|
||||
|
||||
@@ -12,34 +12,29 @@ namespace Unity.RenderStreaming.Signaling
|
||||
{
|
||||
public class WebSocketSignaling : ISignaling
|
||||
{
|
||||
private static HashSet<WebSocketSignaling> instances = new HashSet<WebSocketSignaling>();
|
||||
|
||||
private readonly string m_url;
|
||||
private readonly float m_timeout;
|
||||
private static readonly HashSet<WebSocketSignaling> instances = new();
|
||||
private readonly SynchronizationContext m_mainThreadContext;
|
||||
private bool m_running;
|
||||
private Thread m_signalingThread;
|
||||
private readonly AutoResetEvent m_wsCloseEvent;
|
||||
private WebSocket m_webSocket;
|
||||
public string participantId;
|
||||
public string Url { get { return m_url; } }
|
||||
|
||||
/// <summary>
|
||||
/// 当前客户端是否为Host角色(由服务器在connect响应中分配)
|
||||
/// 参与者连接ID到房间connectionId的映射
|
||||
/// Key: participantId, Value: roomConnectionId
|
||||
/// 用于Host向特定Participant发送消息时,将内部connectionId还原为服务器格式
|
||||
/// </summary>
|
||||
public bool isHost { get; private set; }
|
||||
private readonly Dictionary<string, string> m_participantToRoom = new();
|
||||
|
||||
private readonly float m_timeout;
|
||||
|
||||
private readonly AutoResetEvent m_wsCloseEvent;
|
||||
|
||||
/// <summary>
|
||||
/// Host连接时使用的房间connectionId
|
||||
/// Host连接时使用的房间connectionId
|
||||
/// </summary>
|
||||
private string m_roomConnectionId;
|
||||
|
||||
/// <summary>
|
||||
/// 参与者连接ID到房间connectionId的映射
|
||||
/// Key: participantId, Value: roomConnectionId
|
||||
/// 用于Host向特定Participant发送消息时,将内部connectionId还原为服务器格式
|
||||
/// </summary>
|
||||
private Dictionary<string, string> m_participantToRoom = new Dictionary<string, string>();
|
||||
private bool m_running;
|
||||
private Thread m_signalingThread;
|
||||
private WebSocket m_webSocket;
|
||||
public string participantId;
|
||||
|
||||
public WebSocketSignaling(SignalingSettings signalingSettings, SynchronizationContext mainThreadContext)
|
||||
{
|
||||
@@ -47,26 +42,24 @@ namespace Unity.RenderStreaming.Signaling
|
||||
throw new ArgumentNullException(nameof(signalingSettings));
|
||||
if (!(signalingSettings is WebSocketSignalingSettings settings))
|
||||
throw new ArgumentException("signalingSettings is not WebSocketSignalingSettings");
|
||||
m_url = settings.url;
|
||||
Url = settings.url;
|
||||
m_timeout = 5.0f;
|
||||
m_mainThreadContext = mainThreadContext;
|
||||
m_wsCloseEvent = new AutoResetEvent(false);
|
||||
|
||||
if (instances.Any(x => x.Url == m_url))
|
||||
{
|
||||
RenderStreaming.Logger.Log(LogType.Warning, $"Other {nameof(WebSocketSignaling)} exists with same URL:{m_url}. Signaling process may be in conflict.");
|
||||
}
|
||||
if (instances.Any(x => x.Url == Url))
|
||||
RenderStreaming.Logger.Log(LogType.Warning,
|
||||
$"Other {nameof(WebSocketSignaling)} exists with same URL:{Url}. Signaling process may be in conflict.");
|
||||
|
||||
instances.Add(this);
|
||||
}
|
||||
|
||||
~WebSocketSignaling()
|
||||
{
|
||||
if (m_running)
|
||||
Stop();
|
||||
/// <summary>
|
||||
/// 当前客户端是否为Host角色(由服务器在connect响应中分配)
|
||||
/// </summary>
|
||||
public bool isHost { get; private set; }
|
||||
|
||||
instances.Remove(this);
|
||||
}
|
||||
public string Url { get; }
|
||||
|
||||
public void Start()
|
||||
{
|
||||
@@ -86,13 +79,9 @@ namespace Unity.RenderStreaming.Signaling
|
||||
m_webSocket?.Close();
|
||||
|
||||
if (m_signalingThread.ThreadState == ThreadState.WaitSleepJoin)
|
||||
{
|
||||
m_signalingThread.Abort();
|
||||
}
|
||||
else
|
||||
{
|
||||
m_signalingThread.Join(1000);
|
||||
}
|
||||
m_signalingThread = null;
|
||||
}
|
||||
}
|
||||
@@ -111,32 +100,18 @@ namespace Unity.RenderStreaming.Signaling
|
||||
public event OnCallRequestHandler OnCallRequest;
|
||||
public event OnMessageHandler OnMessage;
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个connectionId是否为参与者连接ID(而非房间connectionId)
|
||||
/// </summary>
|
||||
private bool IsParticipantConnectionId(string connectionId)
|
||||
{
|
||||
return m_participantToRoom.ContainsKey(connectionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取参与者对应的房间connectionId
|
||||
/// </summary>
|
||||
private string GetRoomConnectionId(string participantConnectionId)
|
||||
{
|
||||
return m_participantToRoom.TryGetValue(participantConnectionId, out var roomId) ? roomId : participantConnectionId;
|
||||
}
|
||||
|
||||
public void SendOffer(string connectionId, RTCSessionDescription offer)
|
||||
{
|
||||
DescData data = new DescData();
|
||||
var data = new DescData();
|
||||
// data.connectionId必须使用房间connectionId(服务器用此查找连接组进行路由)
|
||||
// 而不是内部participantId(participantId仅通过routedMessage.participantId传递用于目标选择)
|
||||
data.connectionId = IsParticipantConnectionId(connectionId) ? GetRoomConnectionId(connectionId) : connectionId;
|
||||
data.connectionId = IsParticipantConnectionId(connectionId)
|
||||
? GetRoomConnectionId(connectionId)
|
||||
: connectionId;
|
||||
data.sdp = offer.sdp;
|
||||
data.dateTime = DateTime.Now;
|
||||
|
||||
RoutedMessage<DescData> routedMessage = new RoutedMessage<DescData>();
|
||||
var routedMessage = new RoutedMessage<DescData>();
|
||||
// 如果connectionId是参与者ID,使用房间connectionId作为from,并设置目标participantId
|
||||
if (IsParticipantConnectionId(connectionId))
|
||||
{
|
||||
@@ -148,6 +123,7 @@ namespace Unity.RenderStreaming.Signaling
|
||||
routedMessage.from = connectionId;
|
||||
routedMessage.participantId = participantId;
|
||||
}
|
||||
|
||||
routedMessage.data = data;
|
||||
routedMessage.type = "offer";
|
||||
WSSend(routedMessage);
|
||||
@@ -155,12 +131,14 @@ namespace Unity.RenderStreaming.Signaling
|
||||
|
||||
public void SendAnswer(string connectionId, RTCSessionDescription answer)
|
||||
{
|
||||
DescData data = new DescData();
|
||||
var data = new DescData();
|
||||
// data.connectionId必须使用房间connectionId(服务器用此查找连接组进行路由)
|
||||
data.connectionId = IsParticipantConnectionId(connectionId) ? GetRoomConnectionId(connectionId) : connectionId;
|
||||
data.connectionId = IsParticipantConnectionId(connectionId)
|
||||
? GetRoomConnectionId(connectionId)
|
||||
: connectionId;
|
||||
data.sdp = answer.sdp;
|
||||
|
||||
RoutedMessage<DescData> routedMessage = new RoutedMessage<DescData>();
|
||||
var routedMessage = new RoutedMessage<DescData>();
|
||||
// 如果connectionId是参与者ID,使用房间connectionId作为from,并设置目标participantId
|
||||
if (IsParticipantConnectionId(connectionId))
|
||||
{
|
||||
@@ -172,6 +150,7 @@ namespace Unity.RenderStreaming.Signaling
|
||||
routedMessage.from = connectionId;
|
||||
routedMessage.participantId = participantId;
|
||||
}
|
||||
|
||||
routedMessage.data = data;
|
||||
routedMessage.type = "answer";
|
||||
WSSend(routedMessage);
|
||||
@@ -179,14 +158,16 @@ namespace Unity.RenderStreaming.Signaling
|
||||
|
||||
public void SendCandidate(string connectionId, RTCIceCandidate candidate)
|
||||
{
|
||||
CandidateData data = new CandidateData();
|
||||
var data = new CandidateData();
|
||||
// data.connectionId必须使用房间connectionId(服务器用此查找连接组进行路由)
|
||||
data.connectionId = IsParticipantConnectionId(connectionId) ? GetRoomConnectionId(connectionId) : connectionId;
|
||||
data.connectionId = IsParticipantConnectionId(connectionId)
|
||||
? GetRoomConnectionId(connectionId)
|
||||
: connectionId;
|
||||
data.candidate = candidate.Candidate;
|
||||
data.sdpMLineIndex = candidate.SdpMLineIndex.GetValueOrDefault(0);
|
||||
data.sdpMid = candidate.SdpMid;
|
||||
|
||||
RoutedMessage<CandidateData> routedMessage = new RoutedMessage<CandidateData>();
|
||||
var routedMessage = new RoutedMessage<CandidateData>();
|
||||
// 如果connectionId是参与者ID,使用房间connectionId作为from,并设置目标participantId
|
||||
if (IsParticipantConnectionId(connectionId))
|
||||
{
|
||||
@@ -197,6 +178,7 @@ namespace Unity.RenderStreaming.Signaling
|
||||
{
|
||||
routedMessage.from = connectionId;
|
||||
}
|
||||
|
||||
routedMessage.data = data;
|
||||
routedMessage.type = "candidate";
|
||||
|
||||
@@ -206,15 +188,85 @@ namespace Unity.RenderStreaming.Signaling
|
||||
public void OpenConnection(string connectionId)
|
||||
{
|
||||
m_roomConnectionId = connectionId;
|
||||
this.WSSend($"{{\"type\":\"connect\", \"connectionId\":\"{connectionId}\"}}");
|
||||
WSSend($"{{\"type\":\"connect\", \"connectionId\":\"{connectionId}\"}}");
|
||||
}
|
||||
|
||||
public void CloseConnection(string connectionId)
|
||||
{
|
||||
// 如果关闭的是参与者连接,使用房间connectionId发送disconnect
|
||||
string actualConnectionId = IsParticipantConnectionId(connectionId) ? GetRoomConnectionId(connectionId) : connectionId;
|
||||
var actualConnectionId = IsParticipantConnectionId(connectionId)
|
||||
? GetRoomConnectionId(connectionId)
|
||||
: connectionId;
|
||||
m_participantToRoom.Remove(connectionId);
|
||||
this.WSSend($"{{\"type\":\"disconnect\", \"connectionId\":\"{actualConnectionId}\"}}");
|
||||
WSSend($"{{\"type\":\"disconnect\", \"connectionId\":\"{actualConnectionId}\"}}");
|
||||
}
|
||||
|
||||
~WebSocketSignaling()
|
||||
{
|
||||
if (m_running)
|
||||
Stop();
|
||||
|
||||
instances.Remove(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断一个connectionId是否为参与者连接ID(而非房间connectionId)
|
||||
/// </summary>
|
||||
private bool IsParticipantConnectionId(string connectionId)
|
||||
{
|
||||
return m_participantToRoom.ContainsKey(connectionId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取参与者对应的房间connectionId
|
||||
/// </summary>
|
||||
private string GetRoomConnectionId(string participantConnectionId)
|
||||
{
|
||||
return m_participantToRoom.TryGetValue(participantConnectionId, out var roomId)
|
||||
? roomId
|
||||
: participantConnectionId;
|
||||
}
|
||||
|
||||
// /// <summary>
|
||||
// /// 发送自定义消息
|
||||
// /// </summary>
|
||||
// /// <param name="connectionId">目标连接ID</param>
|
||||
// /// <param name="message">消息对象或字符串</param>
|
||||
// public void SendMessage(string connectionId, object message)
|
||||
// {
|
||||
// if (message == null)
|
||||
// {
|
||||
// RenderStreaming.Logger.Log(LogType.Warning, "Signaling: Cannot send null message");
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// var actualConnectionId = IsParticipantConnectionId(connectionId)
|
||||
// ? GetRoomConnectionId(connectionId)
|
||||
// : connectionId;
|
||||
//
|
||||
// var routedMessage = new RoutedMessage<object>();
|
||||
// routedMessage.from = actualConnectionId;
|
||||
// routedMessage.participantId = IsParticipantConnectionId(connectionId) ? connectionId : participantId;
|
||||
// routedMessage.data = message;
|
||||
// routedMessage.type = "message";
|
||||
//
|
||||
// WSSend(routedMessage);
|
||||
// }
|
||||
|
||||
/// <summary>
|
||||
/// 发送自定义消息
|
||||
/// </summary>
|
||||
/// <param name="connectionId">目标连接ID</param>
|
||||
/// <param name="message">消息对象或字符串</param>
|
||||
public void SendMessage(string message)
|
||||
{
|
||||
if (message == null)
|
||||
{
|
||||
RenderStreaming.Logger.Log(LogType.Warning, "Signaling: Cannot send null message");
|
||||
return;
|
||||
}
|
||||
|
||||
WSSend(message);
|
||||
}
|
||||
|
||||
private void WSManage()
|
||||
@@ -241,12 +293,10 @@ namespace Unity.RenderStreaming.Signaling
|
||||
|
||||
private void WSCreate()
|
||||
{
|
||||
m_webSocket = new WebSocket(m_url);
|
||||
if (m_url.StartsWith("wss"))
|
||||
{
|
||||
m_webSocket = new WebSocket(Url);
|
||||
if (Url.StartsWith("wss"))
|
||||
m_webSocket.SslConfiguration.EnabledSslProtocols =
|
||||
SslProtocols.Tls | SslProtocols.Tls11 | SslProtocols.Tls12;
|
||||
}
|
||||
|
||||
m_webSocket.OnOpen += WSConnected;
|
||||
m_webSocket.OnMessage += WSProcessMessage;
|
||||
@@ -255,7 +305,7 @@ namespace Unity.RenderStreaming.Signaling
|
||||
|
||||
Monitor.Enter(m_webSocket);
|
||||
|
||||
RenderStreaming.Logger.Log($"Signaling: Connecting WS {m_url}");
|
||||
RenderStreaming.Logger.Log($"Signaling: Connecting WS {Url}");
|
||||
m_webSocket.ConnectAsync();
|
||||
}
|
||||
|
||||
@@ -270,13 +320,9 @@ namespace Unity.RenderStreaming.Signaling
|
||||
|
||||
SignalingMessage msg;
|
||||
if (!string.IsNullOrEmpty(routedMessage.type))
|
||||
{
|
||||
msg = routedMessage.data;
|
||||
}
|
||||
else
|
||||
{
|
||||
msg = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(routedMessage.type))
|
||||
{
|
||||
@@ -285,23 +331,25 @@ namespace Unity.RenderStreaming.Signaling
|
||||
msg = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
isHost = msg.role == "host";
|
||||
participantId = msg.participantId;
|
||||
m_mainThreadContext.Post(d => OnCreateConnection?.Invoke(this, msg.connectionId, msg.polite), null);
|
||||
m_mainThreadContext.Post(d => OnCreateConnection?.Invoke(this, msg.connectionId, msg.polite),
|
||||
null);
|
||||
}
|
||||
else if (routedMessage.type == "disconnect")
|
||||
{
|
||||
msg = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
string disconnectConnectionId = msg.connectionId;
|
||||
var disconnectConnectionId = msg.connectionId;
|
||||
// 如果断开的是参与者连接,用participantId查找内部connectionId
|
||||
if (!string.IsNullOrEmpty(routedMessage.participantId) && isHost)
|
||||
{
|
||||
disconnectConnectionId = routedMessage.participantId;
|
||||
m_participantToRoom.Remove(routedMessage.participantId);
|
||||
}
|
||||
|
||||
m_mainThreadContext.Post(d => OnDestroyConnection?.Invoke(this, disconnectConnectionId), null);
|
||||
}
|
||||
else if (routedMessage.type == "offer")
|
||||
{
|
||||
DescData offer = new DescData();
|
||||
var offer = new DescData();
|
||||
// Host收到带participantId的offer时,使用participantId作为内部connectionId
|
||||
// 这样每个participant会创建独立的PeerConnection
|
||||
if (!string.IsNullOrEmpty(routedMessage.participantId) && isHost)
|
||||
@@ -313,6 +361,7 @@ namespace Unity.RenderStreaming.Signaling
|
||||
{
|
||||
offer.connectionId = routedMessage.from;
|
||||
}
|
||||
|
||||
offer.sdp = msg.sdp;
|
||||
offer.polite = msg.polite;
|
||||
offer.participantId = routedMessage.participantId;
|
||||
@@ -320,7 +369,7 @@ namespace Unity.RenderStreaming.Signaling
|
||||
}
|
||||
else if (routedMessage.type == "answer")
|
||||
{
|
||||
DescData answer = new DescData
|
||||
var answer = new DescData
|
||||
{
|
||||
// Host收到带participantId的answer时,使用participantId作为内部connectionId
|
||||
connectionId = !string.IsNullOrEmpty(routedMessage.participantId) && isHost
|
||||
@@ -333,12 +382,12 @@ namespace Unity.RenderStreaming.Signaling
|
||||
}
|
||||
else if (routedMessage.type == "candidate")
|
||||
{
|
||||
CandidateData candidate = new CandidateData
|
||||
var candidate = new CandidateData
|
||||
{
|
||||
// Host收到带participantId的candidate时,使用participantId作为内部connectionId
|
||||
connectionId = !string.IsNullOrEmpty(routedMessage.participantId) && isHost
|
||||
? routedMessage.participantId
|
||||
: routedMessage.@from,
|
||||
: routedMessage.from,
|
||||
candidate = msg.candidate,
|
||||
sdpMLineIndex = msg.sdpMLineIndex,
|
||||
sdpMid = msg.sdpMid,
|
||||
@@ -350,36 +399,36 @@ namespace Unity.RenderStreaming.Signaling
|
||||
{
|
||||
// Host收到新参与者加入通知
|
||||
msg = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
ParticipantEventData participantData = new ParticipantEventData
|
||||
var participantData = new ParticipantEventData
|
||||
{
|
||||
connectionId = msg.connectionId ?? routedMessage.from,
|
||||
participantId = msg.participantId ?? routedMessage.participantId
|
||||
};
|
||||
// 记录参与者映射
|
||||
if (!string.IsNullOrEmpty(participantData.participantId))
|
||||
{
|
||||
m_participantToRoom[participantData.participantId] = participantData.connectionId;
|
||||
}
|
||||
RenderStreaming.Logger.Log($"Signaling: Participant joined - connectionId: {participantData.connectionId}, participantId: {participantData.participantId}");
|
||||
RenderStreaming.Logger.Log(
|
||||
$"Signaling: Participant joined - connectionId: {participantData.connectionId}, participantId: {participantData.participantId}");
|
||||
m_mainThreadContext.Post(d => OnParticipantJoined?.Invoke(this, participantData), null);
|
||||
}
|
||||
else if (routedMessage.type == "participant-left")
|
||||
{
|
||||
// Host/Participant收到参与者离开通知
|
||||
msg = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
ParticipantEventData participantData = new ParticipantEventData
|
||||
var participantData = new ParticipantEventData
|
||||
{
|
||||
connectionId = msg.connectionId ?? routedMessage.from,
|
||||
participantId = msg.participantId ?? routedMessage.participantId
|
||||
};
|
||||
m_participantToRoom.Remove(participantData.participantId);
|
||||
RenderStreaming.Logger.Log($"Signaling: Participant left - connectionId: {participantData.connectionId}, participantId: {participantData.participantId}");
|
||||
RenderStreaming.Logger.Log(
|
||||
$"Signaling: Participant left - connectionId: {participantData.connectionId}, participantId: {participantData.participantId}");
|
||||
m_mainThreadContext.Post(d => OnParticipantLeft?.Invoke(this, participantData), null);
|
||||
}
|
||||
else if (routedMessage.type == "call-request")
|
||||
{
|
||||
msg = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
CallRequestData callData = new CallRequestData
|
||||
var callData = new CallRequestData
|
||||
{
|
||||
connectionId = routedMessage.from,
|
||||
data = msg.data
|
||||
@@ -389,12 +438,12 @@ namespace Unity.RenderStreaming.Signaling
|
||||
else if (routedMessage.type == "on-message")
|
||||
{
|
||||
var message = JsonUtility.FromJson<SignalingMessage>(content);
|
||||
OnMessageData messageData = new OnMessageData
|
||||
{
|
||||
connectionId = routedMessage.from,
|
||||
participantId = routedMessage.participantId,
|
||||
message = message.data
|
||||
};
|
||||
var messageData = new OnMessageData
|
||||
{
|
||||
connectionId = routedMessage.from,
|
||||
participantId = routedMessage.participantId,
|
||||
message = message.data
|
||||
};
|
||||
m_mainThreadContext.Post(d => OnMessage?.Invoke(this, messageData), null);
|
||||
}
|
||||
else if (routedMessage.type == "error")
|
||||
@@ -445,10 +494,10 @@ namespace Unity.RenderStreaming.Signaling
|
||||
}
|
||||
else
|
||||
{
|
||||
string str = JsonUtility.ToJson(data);
|
||||
var str = JsonUtility.ToJson(data);
|
||||
RenderStreaming.Logger.Log("Signaling: Sending WS data: " + str);
|
||||
m_webSocket.Send(str);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user