Browse Source

添加MQTT

胡佳骏 1 year ago
parent
commit
84cef25473

+ 1 - 1
Assets/HttpActionLang.cs

@@ -12,5 +12,5 @@ public class HttpActionLang : Singleton<HttpActionLang>
     public const string signal_contact = "/signal/contact";
 
     public const string rtc_CreateRoom = "/rtc/createRoom";
-
+    public string mqttSocket ="";
 }

+ 796 - 0
Assets/New Scene.unity

@@ -0,0 +1,796 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!29 &1
+OcclusionCullingSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_OcclusionBakeSettings:
+    smallestOccluder: 5
+    smallestHole: 0.25
+    backfaceThreshold: 100
+  m_SceneGUID: 00000000000000000000000000000000
+  m_OcclusionCullingData: {fileID: 0}
+--- !u!104 &2
+RenderSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 9
+  m_Fog: 0
+  m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+  m_FogMode: 3
+  m_FogDensity: 0.01
+  m_LinearFogStart: 0
+  m_LinearFogEnd: 300
+  m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
+  m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
+  m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
+  m_AmbientIntensity: 1
+  m_AmbientMode: 0
+  m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
+  m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
+  m_HaloStrength: 0.5
+  m_FlareStrength: 1
+  m_FlareFadeSpeed: 3
+  m_HaloTexture: {fileID: 0}
+  m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
+  m_DefaultReflectionMode: 0
+  m_DefaultReflectionResolution: 128
+  m_ReflectionBounces: 1
+  m_ReflectionIntensity: 1
+  m_CustomReflection: {fileID: 0}
+  m_Sun: {fileID: 0}
+  m_IndirectSpecularColor: {r: 0.44402242, g: 0.49316543, b: 0.5722324, a: 1}
+  m_UseRadianceAmbientProbe: 0
+--- !u!157 &3
+LightmapSettings:
+  m_ObjectHideFlags: 0
+  serializedVersion: 12
+  m_GIWorkflowMode: 1
+  m_GISettings:
+    serializedVersion: 2
+    m_BounceScale: 1
+    m_IndirectOutputScale: 1
+    m_AlbedoBoost: 1
+    m_EnvironmentLightingMode: 0
+    m_EnableBakedLightmaps: 1
+    m_EnableRealtimeLightmaps: 0
+  m_LightmapEditorSettings:
+    serializedVersion: 12
+    m_Resolution: 2
+    m_BakeResolution: 40
+    m_AtlasSize: 1024
+    m_AO: 0
+    m_AOMaxDistance: 1
+    m_CompAOExponent: 1
+    m_CompAOExponentDirect: 0
+    m_ExtractAmbientOcclusion: 0
+    m_Padding: 2
+    m_LightmapParameters: {fileID: 0}
+    m_LightmapsBakeMode: 1
+    m_TextureCompression: 1
+    m_FinalGather: 0
+    m_FinalGatherFiltering: 1
+    m_FinalGatherRayCount: 256
+    m_ReflectionCompression: 2
+    m_MixedBakeMode: 2
+    m_BakeBackend: 1
+    m_PVRSampling: 1
+    m_PVRDirectSampleCount: 32
+    m_PVRSampleCount: 512
+    m_PVRBounces: 2
+    m_PVREnvironmentSampleCount: 256
+    m_PVREnvironmentReferencePointCount: 2048
+    m_PVRFilteringMode: 1
+    m_PVRDenoiserTypeDirect: 1
+    m_PVRDenoiserTypeIndirect: 1
+    m_PVRDenoiserTypeAO: 1
+    m_PVRFilterTypeDirect: 0
+    m_PVRFilterTypeIndirect: 0
+    m_PVRFilterTypeAO: 0
+    m_PVREnvironmentMIS: 1
+    m_PVRCulling: 1
+    m_PVRFilteringGaussRadiusDirect: 1
+    m_PVRFilteringGaussRadiusIndirect: 5
+    m_PVRFilteringGaussRadiusAO: 2
+    m_PVRFilteringAtrousPositionSigmaDirect: 0.5
+    m_PVRFilteringAtrousPositionSigmaIndirect: 2
+    m_PVRFilteringAtrousPositionSigmaAO: 1
+    m_ExportTrainingData: 0
+    m_TrainingDataDestination: TrainingData
+    m_LightProbeSampleCountMultiplier: 4
+  m_LightingDataAsset: {fileID: 0}
+  m_LightingSettings: {fileID: 0}
+--- !u!196 &4
+NavMeshSettings:
+  serializedVersion: 2
+  m_ObjectHideFlags: 0
+  m_BuildSettings:
+    serializedVersion: 2
+    agentTypeID: 0
+    agentRadius: 0.5
+    agentHeight: 2
+    agentSlope: 45
+    agentClimb: 0.4
+    ledgeDropHeight: 0
+    maxJumpAcrossDistance: 0
+    minRegionArea: 2
+    manualCellSize: 0
+    cellSize: 0.16666667
+    manualTileSize: 0
+    tileSize: 256
+    accuratePlacement: 0
+    maxJobWorkers: 0
+    preserveTilesOutsideBounds: 0
+    debug:
+      m_Flags: 0
+  m_NavMeshData: {fileID: 0}
+--- !u!1 &7014902
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 7014905}
+  - component: {fileID: 7014904}
+  - component: {fileID: 7014903}
+  m_Layer: 0
+  m_Name: EventSystem
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &7014903
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7014902}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_SendPointerHoverToParent: 1
+  m_HorizontalAxis: Horizontal
+  m_VerticalAxis: Vertical
+  m_SubmitButton: Submit
+  m_CancelButton: Cancel
+  m_InputActionsPerSecond: 10
+  m_RepeatDelay: 0.5
+  m_ForceModuleActive: 0
+--- !u!114 &7014904
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7014902}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_FirstSelected: {fileID: 0}
+  m_sendNavigationEvents: 1
+  m_DragThreshold: 10
+--- !u!4 &7014905
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 7014902}
+  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: 0}
+  m_RootOrder: 3
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!1 &511717031
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 511717032}
+  - component: {fileID: 511717034}
+  - component: {fileID: 511717033}
+  - component: {fileID: 511717035}
+  m_Layer: 5
+  m_Name: 0
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &511717032
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 511717031}
+  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: 1922655130}
+  m_RootOrder: 0
+  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: -161, y: 0}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &511717033
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 511717031}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 0}
+  m_UVRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+--- !u!222 &511717034
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 511717031}
+  m_CullTransparentMesh: 1
+--- !u!114 &511717035
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 511717031}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: db51e953d4e6fca4ab7f0d2d9e3f7f3a, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  index: 4
+--- !u!1 &658275333
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 658275334}
+  - component: {fileID: 658275336}
+  - component: {fileID: 658275335}
+  - component: {fileID: 658275337}
+  m_Layer: 5
+  m_Name: 1
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &658275334
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 658275333}
+  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: 1922655130}
+  m_RootOrder: 1
+  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: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &658275335
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 658275333}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 0}
+  m_UVRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+--- !u!222 &658275336
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 658275333}
+  m_CullTransparentMesh: 1
+--- !u!114 &658275337
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 658275333}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: db51e953d4e6fca4ab7f0d2d9e3f7f3a, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  index: 5
+--- !u!1 &1132962877
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1132962879}
+  - component: {fileID: 1132962878}
+  m_Layer: 0
+  m_Name: Directional Light
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!108 &1132962878
+Light:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1132962877}
+  m_Enabled: 1
+  serializedVersion: 10
+  m_Type: 1
+  m_Shape: 0
+  m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1}
+  m_Intensity: 1
+  m_Range: 10
+  m_SpotAngle: 30
+  m_InnerSpotAngle: 21.80208
+  m_CookieSize: 10
+  m_Shadows:
+    m_Type: 2
+    m_Resolution: -1
+    m_CustomResolution: -1
+    m_Strength: 1
+    m_Bias: 0.05
+    m_NormalBias: 0.4
+    m_NearPlane: 0.2
+    m_CullingMatrixOverride:
+      e00: 1
+      e01: 0
+      e02: 0
+      e03: 0
+      e10: 0
+      e11: 1
+      e12: 0
+      e13: 0
+      e20: 0
+      e21: 0
+      e22: 1
+      e23: 0
+      e30: 0
+      e31: 0
+      e32: 0
+      e33: 1
+    m_UseCullingMatrixOverride: 0
+  m_Cookie: {fileID: 0}
+  m_DrawHalo: 0
+  m_Flare: {fileID: 0}
+  m_RenderMode: 0
+  m_CullingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_RenderingLayerMask: 1
+  m_Lightmapping: 4
+  m_LightShadowCasterMode: 0
+  m_AreaSize: {x: 1, y: 1}
+  m_BounceIntensity: 1
+  m_ColorTemperature: 6570
+  m_UseColorTemperature: 0
+  m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
+  m_UseBoundingSphereOverride: 0
+  m_UseViewFrustumForShadowCasterCull: 1
+  m_ShadowRadius: 0
+  m_ShadowAngle: 0
+--- !u!4 &1132962879
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1132962877}
+  m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
+  m_LocalPosition: {x: 0, y: 3, z: 0}
+  m_LocalScale: {x: 1, y: 1, z: 1}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_RootOrder: 0
+  m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
+--- !u!1 &1246179301
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1246179302}
+  - component: {fileID: 1246179304}
+  - component: {fileID: 1246179303}
+  - component: {fileID: 1246179305}
+  m_Layer: 5
+  m_Name: 3
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1246179302
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1246179301}
+  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: 1922655130}
+  m_RootOrder: 3
+  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: 302, y: 0}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &1246179303
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1246179301}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 0}
+  m_UVRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+--- !u!222 &1246179304
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1246179301}
+  m_CullTransparentMesh: 1
+--- !u!114 &1246179305
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1246179301}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: db51e953d4e6fca4ab7f0d2d9e3f7f3a, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  index: 3
+--- !u!1001 &1845269026
+PrefabInstance:
+  m_ObjectHideFlags: 0
+  serializedVersion: 2
+  m_Modification:
+    m_TransformParent: {fileID: 0}
+    m_Modifications:
+    - target: {fileID: 6007065485426161915, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_Name
+      value: SDKSystem
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_RootOrder
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalPosition.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalPosition.y
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalPosition.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalRotation.w
+      value: 1
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalRotation.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalRotation.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalRotation.z
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.x
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.y
+      value: 0
+      objectReference: {fileID: 0}
+    - target: {fileID: 6007065485426162334, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+      propertyPath: m_LocalEulerAnglesHint.z
+      value: 0
+      objectReference: {fileID: 0}
+    m_RemovedComponents: []
+  m_SourcePrefab: {fileID: 100100000, guid: 7cd0ceba7525bdc42a36be841a8aad16, type: 3}
+--- !u!1 &1922655126
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1922655130}
+  - component: {fileID: 1922655129}
+  - component: {fileID: 1922655128}
+  - component: {fileID: 1922655127}
+  m_Layer: 5
+  m_Name: Canvas
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!114 &1922655127
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1922655126}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_IgnoreReversedGraphics: 1
+  m_BlockingObjects: 0
+  m_BlockingMask:
+    serializedVersion: 2
+    m_Bits: 4294967295
+--- !u!114 &1922655128
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1922655126}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_UiScaleMode: 0
+  m_ReferencePixelsPerUnit: 100
+  m_ScaleFactor: 1
+  m_ReferenceResolution: {x: 800, y: 600}
+  m_ScreenMatchMode: 0
+  m_MatchWidthOrHeight: 0
+  m_PhysicalUnit: 3
+  m_FallbackScreenDPI: 96
+  m_DefaultSpriteDPI: 96
+  m_DynamicPixelsPerUnit: 1
+  m_PresetInfoIsWorld: 1
+--- !u!223 &1922655129
+Canvas:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1922655126}
+  m_Enabled: 1
+  serializedVersion: 3
+  m_RenderMode: 2
+  m_Camera: {fileID: 0}
+  m_PlaneDistance: 100
+  m_PixelPerfect: 0
+  m_ReceivesEvents: 1
+  m_OverrideSorting: 0
+  m_OverridePixelPerfect: 0
+  m_SortingBucketNormalizedSize: 0
+  m_AdditionalShaderChannelsFlag: 0
+  m_SortingLayerID: 0
+  m_SortingOrder: 0
+  m_TargetDisplay: 0
+--- !u!224 &1922655130
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1922655126}
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: 0, y: 0, z: 0.33}
+  m_LocalScale: {x: 0.001, y: 0.001, z: 0.001}
+  m_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 511717032}
+  - {fileID: 658275334}
+  - {fileID: 2143354547}
+  - {fileID: 1246179302}
+  m_Father: {fileID: 0}
+  m_RootOrder: 2
+  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: 1.6}
+  m_SizeDelta: {x: 1009.5, y: 1166}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!1 &2143354546
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 2143354547}
+  - component: {fileID: 2143354549}
+  - component: {fileID: 2143354548}
+  - component: {fileID: 2143354550}
+  m_Layer: 5
+  m_Name: 2
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &2143354547
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2143354546}
+  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: 1922655130}
+  m_RootOrder: 2
+  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: 144, y: 0}
+  m_SizeDelta: {x: 100, y: 100}
+  m_Pivot: {x: 0.5, y: 0.5}
+--- !u!114 &2143354548
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2143354546}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 1344c3c82d62a2a41a3576d8abb8e3ea, 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_Texture: {fileID: 0}
+  m_UVRect:
+    serializedVersion: 2
+    x: 0
+    y: 0
+    width: 1
+    height: 1
+--- !u!222 &2143354549
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2143354546}
+  m_CullTransparentMesh: 1
+--- !u!114 &2143354550
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2143354546}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: db51e953d4e6fca4ab7f0d2d9e3f7f3a, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  index: 2

+ 7 - 0
Assets/New Scene.unity.meta

@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 64ec962a6bb8d9d459d621a2ce2a16b7
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 76 - 65
Assets/Scripts/MQTT/MQTTClient.cs

@@ -11,14 +11,17 @@ using static QTTManager;
 
 public class MQTTClient : MonoSingleton<MQTTClient>
 {
-    string front = "client/";
-    string id = ""; 
-    string username = "u@unity3";// 需要根据服务器设置
-    string password = null;// 需要根据服务器设置
-    string rid = "mqttx_b4c02ddc"; //其他人的ID
+    public string front = "client/";
+    public string id = "";
+    public string username = "u@unity3";// 需要根据服务器设置
+    public string password = null;// 需要根据服务器设置
+    public string rid = "mqttx_b4c02ddc"; //其他人的ID
+    public string account;
+    public string roomId;
     public event Action<JsonData> OnCoordinate;
     public static byte[] bytes;
-   // public static byt ta;
+    public static string certification;
+    // public static byt ta;
     QTTManager qt;
     // Start is called before the first frame update
     void Start()
@@ -31,8 +34,8 @@ public class MQTTClient : MonoSingleton<MQTTClient>
             Permission.RequestUserPermission(Permission.ExternalStorageWrite);
         }
         bytes = (Resources.Load("emqxsl-ca") as TextAsset).bytes;
-        
-        Debug.Log(" DGJ  ===> emqxsl-ca.bytes "+ bytes.Length);
+
+        Debug.Log(" DGJ  ===> emqxsl-ca.bytes " + bytes.Length);
     }
     Queue<MqttMsgPublishEventArgs> rlist = new Queue<MqttMsgPublishEventArgs>();
     private void OnReceived(MqttMsgPublishEventArgs obj)
@@ -75,10 +78,12 @@ public class MQTTClient : MonoSingleton<MQTTClient>
     {
         string msg = Encoding.UTF8.GetString(obj.Message);
         Debug.Log("uid => " + obj.Topic + ":\n" + msg);
+        TestMQTT.Instance.text.text = "uid => " + obj.Topic + ":\n" + msg;
         try
         {
             JsonData data = JsonMapper.ToObject(msg);
             Debug.Log(" DGJ === > " + data["method"].ToString());
+
             switch (data["method"].ToString())
             {
                 //case "CamPos":
@@ -100,7 +105,7 @@ public class MQTTClient : MonoSingleton<MQTTClient>
 
                 case "coordinate":
 
-                  OnCoordinate?.Invoke(data);
+                    OnCoordinate?.Invoke(data);
 
                     break;
 
@@ -135,35 +140,37 @@ public class MQTTClient : MonoSingleton<MQTTClient>
     //连接
     public void Connect()
     {
-      
-        Debug.Log("DGJ ===> MQTT ");
-        if (DeviceType.type == "Phone")
-        {
-            id =UserInfo.Instance.name + "_Phone";
-            rid = front+UserInfo.Instance.name + "_Glasses";
 
-        }
-        else
-        {
-            id = UserInfo.Instance.name + "_Glasses";
-            rid = front+UserInfo.Instance.name + "_Phone";
-        }
+        Debug.Log("DGJ ===> MQTT " + HttpActionLang.Instance.mqttSocket + "   " + id + account);
+        //if (DeviceType.type == "Phone")
+        //{
+        //    id =UserInfo.Instance.name + "_Phone";
+        //    rid = front+UserInfo.Instance.name + "_Glasses";
+
+        //}
+        //else
+        //{
+        //    id = UserInfo.Instance.name + "_Glasses";
+        //    rid = front+UserInfo.Instance.name + "_Phone";
+        //}
         DisConnect();
-        qt = new QTTManager(front+id, username, password, "", "1883");
+        qt = new QTTManager(id + account, certification, password, HttpActionLang.Instance.mqttSocket, "1883");
         qt.Connect();
-        StartCoroutine(Reconnection());
+        //   StartCoroutine(Reconnection());
         qt.ConnectionFailed += onFaild;
         qt.ConnectionSucceeded += onSucceed;
         qt.OnConnecting += OnConnecting;
         qt.OnReceived += OnReceived;
         qt.OnClose += OnClose;
+
+        //  StartSendCameraPos();
     }
 
     private void OnClose(EventArgs obj)
     {
         Debug.Log("断开连接");
 
-        
+
     }
 
     private IEnumerator Reconnection()
@@ -171,11 +178,11 @@ public class MQTTClient : MonoSingleton<MQTTClient>
         while (true)
         {
             yield return new WaitForSeconds(5);
-            if(qt!=null&&!qt.IsConnect())
+            if (qt != null && !qt.IsConnect())
             {
                 Debug.Log(" DGJ ===>  Reconnection ");
                 Connect();
-            }         
+            }
         }
     }
 
@@ -191,54 +198,57 @@ public class MQTTClient : MonoSingleton<MQTTClient>
     //订阅
     public void Subscribe()
     {
-        Debug.Log(" DGJ   =====> Subscribe "+ id);
+        Debug.Log(" DGJ   =====> Subscribe " + front + "online/" + account + "     " + front + "room/" + roomId);
         ushort s = qt.Subscribe(
                         new string[]
                         {
-                              front+id
+                              front+"online/"+account,
+                              front+"room/"+roomId
 
                         },
                         new byte[]
                         {
-                                
+
+                                MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE,
                                 MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE
 
                         });
 
         Debug.Log(" DGJ   =====> Subscribe2");
-     
+
     }
 
-    //public void StartSendCameraPos()
-    //{
-    //    StartCoroutine(sendCameraPos());
-    //}
-
-    ////眼镜端像手机端发送实时位置
-    //IEnumerator sendCameraPos()
-    //{
-    //    Debug.Log("DGJ  =====>  sendCameraPos" + qt.IsConnect());
-    //    while (true)
-    //    {
-    //        if(qt!=null&& qt.IsConnect())
-    //        {
-    //            JsonData json = new JsonData();
-    //            json["type"] = "CamPos";
-    //            //  json["x"] = OpenXRCamera.Instance.head.position.x;
-    //            //json["y"] = OpenXRCamera.Instance.head.position.y;
-    //            //json["z"] = OpenXRCamera.Instance.head.position.z;
-    //            json["x"] = GameManager.Instance.Player.transform.localPosition.x;
-    //            json["y"] = GameManager.Instance.Player.transform.localPosition.y;
-    //            json["z"] = GameManager.Instance.Player.transform.localPosition.z;
-    //            json["Sid"] = "sid";//选择的场景id
-    //            publish(Encoding.UTF8.GetBytes(json.ToJson()));
-    //        }
-           
-    //        yield return new WaitForSeconds(0.1f);
-    //    }
-    //}
+    public void StartSendCameraPos()
+    {
+        StartCoroutine(sendCameraPos());
+    }
+
+    //眼镜端像手机端发送实时位置
+    IEnumerator sendCameraPos()
+    {
+        Debug.Log("DGJ  =====>  sendCameraPos" + qt.IsConnect());
+        while (true)
+        {
+            yield return new WaitForSeconds(1f);
+            if (qt != null && qt.IsConnect())
+            {
+                JsonData json = new JsonData();
+                json["type"] = "CamPos";
+                //  json["x"] = OpenXRCamera.Instance.head.position.x;
+                //json["y"] = OpenXRCamera.Instance.head.position.y;
+                //json["z"] = OpenXRCamera.Instance.head.position.z;
+                //json["x"] = GameManager.Instance.Player.transform.localPosition.x;
+                //json["y"] = GameManager.Instance.Player.transform.localPosition.y;
+                //json["z"] = GameManager.Instance.Player.transform.localPosition.z;
+                json["Sid"] = "sid";//选择的场景id
+                publish(Encoding.UTF8.GetBytes(json.ToJson()));
+            }
+
+
+        }
+    }
     //眼镜发送触发的景点
-    public void sendActiveSp(string spid,bool isOpen)
+    public void sendActiveSp(string spid, bool isOpen)
     {
         JsonData json = new JsonData();
         json["type"] = "ActiveSp";
@@ -251,7 +261,7 @@ public class MQTTClient : MonoSingleton<MQTTClient>
 
 
     //眼镜发送触发的视频
-    public void sendActiveVideo(string spid,string videoId, bool isplay,float jindu)
+    public void sendActiveVideo(string spid, string videoId, bool isplay, float jindu)
     {
         JsonData json = new JsonData();
         json["type"] = "ActiveVideo";
@@ -276,17 +286,18 @@ public class MQTTClient : MonoSingleton<MQTTClient>
     }
 
 
-    void publish(byte[] bs)
+
+    public void publish(byte[] bs)
     {
-        if(qt!=null&& qt.IsConnect())
+        if (qt != null && qt.IsConnect())
         {
-           // Debug.Log(id + "  DGJ  publish =====>  " + front+rid + "   " + bs.Length);
-            qt.Publish(rid, bs, MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, false);
+            Debug.Log(id + account + "  DGJ  publish =====>  " + front + "room/" + roomId + "   " + bs.Length);
+            qt.Publish(front + "room/" + roomId, bs, MqttMsgBase.QOS_LEVEL_EXACTLY_ONCE, false);
         }
         else
         {
             Debug.LogError(" MQTT  未连接 ");
         }
-     
+
     }
 }

+ 85 - 0
Assets/TestMQTT.cs

@@ -0,0 +1,85 @@
+using LitJson;
+using Newtonsoft.Json.Linq;
+using System.Collections;
+using System.Collections.Generic;
+using System.Text;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TestMQTT : MonoSingleton<TestMQTT>
+{
+    public Text text;
+    public InputField input;
+    public Button btn;
+
+    private void Start()
+    { 
+        btn.onClick.AddListener(PushMsg);
+    }
+
+    /// <summary>
+    ///  获取信令
+    /// </summary>
+    public void Signal()
+    {
+        GameStart.Instance.StartCoroutine(HttpTool.Instance.SendHttp(HttpActionLang.signal_certification, "", SignalCallBack));
+       // HttpTool.Instance.PostMqtt(HttpAction.signal_certification, "", SignalCallBack);
+    }
+
+
+    public void SetAccoutInfo(string account)
+    {
+        MQTTClient.Instance.account = account;
+       
+    }
+    private void SignalCallBack(string msg)
+    {
+        Debug.Log(msg);
+
+        JObject obj = JObject.Parse(msg);
+        if (obj["code"].ToString() == "200")
+        {
+            HttpActionLang.Instance.mqttSocket = obj["data"]["host"].ToString();
+            MQTTClient.certification = obj["data"]["certification"].ToString();
+            MQTTClient.Instance.front = obj["data"]["topicPrefix"].ToString();
+            MQTTClient.Instance.id = obj["data"]["clientId"].ToString();
+            SetRoomId("");
+            //  
+        }
+        else
+        {
+            Debug.LogError("MQTT 获取信令失败 !!!");
+        }
+    }
+
+    public void SetRoomId(string id)
+    {
+        MQTTClient.Instance.roomId = id;
+        MQTTClient.Instance.roomId = "9527";
+        MQTTClient.Instance.Connect();
+
+    }
+
+    public void PushMsg()
+    {
+        if(!string.IsNullOrEmpty(input.text))
+        {
+            JsonData json = new JsonData();
+            json["account"] = MQTTClient.Instance.account;
+            json["Sid"] = "sid";//选择的场景id
+            json["msg"] = input.text;
+            MQTTClient.Instance.publish(Encoding.UTF8.GetBytes(json.ToJson()));
+            input.text = null;
+        }
+
+        else
+        {
+            JsonData json = new JsonData();
+            json["account"] = MQTTClient.Instance.account;
+            json["Sid"] = "sid";//选择的场景id
+            json["msg"] = "NULL";
+            MQTTClient.Instance.publish(Encoding.UTF8.GetBytes(json.ToJson()));
+            input.text = null;
+        }
+    }
+}

+ 11 - 0
Assets/TestMQTT.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e619ad1e5dad862488e940a5741e906b
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 35 - 0
Assets/TestRGB.cs

@@ -0,0 +1,35 @@
+using System.Collections;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+public class TestRGB : MonoBehaviour
+{
+    public int index;
+    int w = 1280;
+    int h = 720;
+    WebCamTexture RGBCamTexture;
+    // Start is called before the first frame update
+    void Start()
+    {
+
+        WebCamDevice[] devices = WebCamTexture.devices;
+
+        if (devices.Length == 0)
+        {
+            Debug.Log("No webcam devices found.");
+            return;
+        }
+        // 使用第一个可用的摄像头设备(你可以根据需要选择其他设备)
+        RGBCamTexture = new WebCamTexture(devices[index].name, w, h, 30);
+        Debug.Log("开启摄像头" + devices[index].name);
+        // 开始摄像头捕捉
+        RGBCamTexture.Play();
+        if (this.GetComponent<RawImage>() != null)
+        {
+            this.GetComponent<RawImage>().texture = RGBCamTexture;
+            this.GetComponent<RawImage>().transform.localEulerAngles = new Vector3(0, 0, 0);
+        }
+    }
+
+}

+ 11 - 0
Assets/TestRGB.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: db51e953d4e6fca4ab7f0d2d9e3f7f3a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: