diff --git a/Assets/Librairies/Websocket-sharp.meta b/Assets/Librairies/Websocket-sharp.meta new file mode 100644 index 0000000..d911278 --- /dev/null +++ b/Assets/Librairies/Websocket-sharp.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b2dad0152fc760f49b94fa73d696679e +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Librairies/Websocket-sharp/websocket-sharp.dll b/Assets/Librairies/Websocket-sharp/websocket-sharp.dll new file mode 100644 index 0000000..ad5411d Binary files /dev/null and b/Assets/Librairies/Websocket-sharp/websocket-sharp.dll differ diff --git a/Assets/Librairies/Websocket-sharp/websocket-sharp.dll.meta b/Assets/Librairies/Websocket-sharp/websocket-sharp.dll.meta new file mode 100644 index 0000000..c03047f --- /dev/null +++ b/Assets/Librairies/Websocket-sharp/websocket-sharp.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: 3178bdd1e1cebc1428c62682d1166a1d +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index ce1eace..72bd44b 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -43,7 +43,7 @@ RenderSettings: --- !u!157 &3 LightmapSettings: m_ObjectHideFlags: 0 - serializedVersion: 11 + serializedVersion: 12 m_GIWorkflowMode: 0 m_GISettings: serializedVersion: 2 @@ -98,7 +98,7 @@ LightmapSettings: m_TrainingDataDestination: TrainingData m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} - m_UseShadowmask: 1 + m_LightingSettings: {fileID: 46740476} --- !u!196 &4 NavMeshSettings: serializedVersion: 2 @@ -118,6 +118,8 @@ NavMeshSettings: manualTileSize: 0 tileSize: 256 accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 debug: m_Flags: 0 m_NavMeshData: {fileID: 0} @@ -173,6 +175,7 @@ MonoBehaviour: 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: @@ -338,6 +341,7 @@ MonoBehaviour: 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: @@ -360,6 +364,67 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 33820299} m_CullTransparentMesh: 0 +--- !u!850595691 &46740476 +LightingSettings: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Settings.lighting + serializedVersion: 2 + m_GIWorkflowMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_RealtimeEnvironmentLighting: 1 + m_BounceScale: 1 + m_AlbedoBoost: 1 + m_IndirectOutputScale: 1 + m_UsingShadowmask: 1 + m_BakeBackend: 1 + m_LightmapMaxSize: 1024 + m_BakeResolution: 10 + m_Padding: 2 + m_TextureCompression: 1 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAO: 0 + m_MixedBakeMode: 2 + m_LightmapsBakeMode: 1 + m_FilterMode: 1 + m_LightmapParameters: {fileID: 0} + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_RealtimeResolution: 2 + m_ForceWhiteAlbedo: 0 + m_ForceUpdates: 0 + m_FinalGather: 0 + m_FinalGatherRayCount: 256 + m_FinalGatherFiltering: 1 + m_PVRCulling: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 256 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_LightProbeSampleCountMultiplier: 4 + m_PVRBounces: 2 + m_PVRRussianRouletteStartBounce: 2 + m_PVREnvironmentMIS: 0 + m_PVRFilteringMode: 2 + m_PVRDenoiserTypeDirect: 0 + m_PVRDenoiserTypeIndirect: 0 + m_PVRDenoiserTypeAO: 0 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 --- !u!1 &135095402 GameObject: m_ObjectHideFlags: 0 @@ -401,7 +466,6 @@ GameObject: m_Component: - component: {fileID: 183710614} - component: {fileID: 183710616} - - component: {fileID: 183710615} m_Layer: 0 m_Name: TMP SubMeshUI [ARIAL SDF Material + LiberationSans SDF Atlas] m_TagString: Untagged @@ -428,34 +492,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &183710615 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 183710613} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 058cba836c1846c3aa1c5fd2e28aea77, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_spriteAsset: {fileID: 0} - m_material: {fileID: 0} - m_sharedMaterial: {fileID: 0} - m_isDefaultMaterial: 0 - m_padding: 0 - m_canvasRenderer: {fileID: 183710616} - m_TextComponent: {fileID: 505076114} - m_materialReferenceIndex: 1 --- !u!222 &183710616 CanvasRenderer: m_ObjectHideFlags: 0 @@ -608,6 +644,76 @@ Transform: m_Father: {fileID: 683008037} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} +--- !u!1 &295429781 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 295429782} + - component: {fileID: 295429783} + - component: {fileID: 295429784} + m_Layer: 0 + m_Name: WebsocketManager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &295429782 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295429781} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1144076143} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &295429783 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295429781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 528760bd39755ab46bcb069618f0d75a, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!114 &295429784 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 295429781} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: de034ba731ed6964794debd4fe9c0adb, type: 3} + m_Name: + m_EditorClassIdentifier: + TargetScript: {fileID: 295429783} + BarColor: {r: 0.7095246, g: 0.25943398, b: 1, a: 1} + id: + folder: + debug: 0 + targetDirectory: + sourceScene: + usePanel: 1 + usePresets: 1 + hasPresets: 0 + closePanelAtStart: 1 + currentPreset: + presetList: [] + wsServerPort: 0 --- !u!1 &386760238 GameObject: m_ObjectHideFlags: 0 @@ -855,6 +961,7 @@ MonoBehaviour: 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: @@ -932,6 +1039,7 @@ MonoBehaviour: 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: @@ -963,13 +1071,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 14 m_fontSizeBase: 14 m_fontWeight: 400 @@ -977,7 +1084,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 514 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 m_characterSpacing: 1 m_wordSpacing: 0 m_lineSpacing: 2 @@ -987,10 +1096,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 1 checkPaddingRequired: 0 @@ -998,40 +1105,18 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 505076114} - characterCount: 52 - spriteCount: 0 - spaceCount: 5 - wordCount: 8 - linkCount: 1 - lineCount: 4 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 183710615} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!114 &505076115 @@ -1241,6 +1326,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 4294967295 m_RendererPriority: 0 m_Materials: @@ -1265,6 +1351,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!64 &575826802 MeshCollider: m_ObjectHideFlags: 0 @@ -1376,6 +1463,7 @@ MonoBehaviour: 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: @@ -1445,6 +1533,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -1469,6 +1558,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &673221740 MeshFilter: m_ObjectHideFlags: 0 @@ -1587,6 +1677,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 936487853} + m_TargetAssemblyTypeName: m_MethodName: ToggleHelp m_Mode: 1 m_Arguments: @@ -1612,6 +1703,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -1691,6 +1783,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 683008038} + m_TargetAssemblyTypeName: m_MethodName: SwitchToPerspective m_Mode: 1 m_Arguments: @@ -1716,6 +1809,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -1796,6 +1890,7 @@ MonoBehaviour: 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: @@ -1875,6 +1970,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 683008038} + m_TargetAssemblyTypeName: m_MethodName: SwitchToOrthographic m_Mode: 1 m_Arguments: @@ -1900,6 +1996,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 1} m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -2110,6 +2207,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0, g: 0, b: 0, a: 0.98039216} m_RaycastTarget: 0 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: @@ -2183,6 +2281,7 @@ Transform: m_Children: - {fileID: 18100216} - {fileID: 393421888} + - {fileID: 295429782} m_Father: {fileID: 0} m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2310,6 +2409,7 @@ MonoBehaviour: 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: @@ -2338,13 +2438,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 18 m_fontSizeBase: 18 m_fontWeight: 400 @@ -2352,7 +2451,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 514 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -2362,10 +2463,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -2373,40 +2472,18 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1311473800} - characterCount: 8 - spriteCount: 0 - spaceCount: 1 - wordCount: 2 - linkCount: 0 - lineCount: 2 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!222 &1311473801 @@ -2435,6 +2512,7 @@ MonoBehaviour: m_PersistentCalls: m_Calls: - m_Target: {fileID: 1198292585} + m_TargetAssemblyTypeName: m_MethodName: ToggleVSync m_Mode: 1 m_Arguments: @@ -2530,6 +2608,7 @@ MeshRenderer: m_LightProbeUsage: 1 m_ReflectionProbeUsage: 1 m_RayTracingMode: 2 + m_RayTraceProcedural: 0 m_RenderingLayerMask: 1 m_RendererPriority: 0 m_Materials: @@ -2554,6 +2633,7 @@ MeshRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} --- !u!33 &1321598871 MeshFilter: m_ObjectHideFlags: 0 @@ -2900,6 +2980,7 @@ MonoBehaviour: 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: @@ -2928,13 +3009,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 18 m_fontSizeBase: 18 m_fontWeight: 400 @@ -2942,7 +3022,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 514 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 m_characterSpacing: 0 m_wordSpacing: 0 m_lineSpacing: 0 @@ -2952,10 +3034,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 0 checkPaddingRequired: 0 @@ -2963,40 +3043,18 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1823557313} - characterCount: 6 - spriteCount: 0 - spaceCount: 1 - wordCount: 2 - linkCount: 0 - lineCount: 2 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!222 &1823557314 @@ -3112,6 +3170,7 @@ MonoBehaviour: 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: @@ -3145,13 +3204,12 @@ MonoBehaviour: m_fontColorGradientPreset: {fileID: 0} m_spriteAsset: {fileID: 0} m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 m_overrideHtmlColors: 0 m_faceColor: serializedVersion: 2 rgba: 4294967295 - m_outlineColor: - serializedVersion: 2 - rgba: 4278190080 m_fontSize: 14 m_fontSizeBase: 14 m_fontWeight: 400 @@ -3159,7 +3217,9 @@ MonoBehaviour: m_fontSizeMin: 18 m_fontSizeMax: 72 m_fontStyle: 0 - m_textAlignment: 257 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 256 + m_textAlignment: 65535 m_characterSpacing: 1 m_wordSpacing: 0 m_lineSpacing: 2 @@ -3169,10 +3229,8 @@ MonoBehaviour: m_enableWordWrapping: 1 m_wordWrappingRatios: 0.4 m_overflowMode: 0 - m_firstOverflowCharacterIndex: -1 m_linkedTextComponent: {fileID: 0} - m_isLinkedTextComponent: 0 - m_isTextTruncated: 0 + parentLinkedComponent: {fileID: 0} m_enableKerning: 1 m_enableExtraPadding: 1 checkPaddingRequired: 0 @@ -3180,40 +3238,18 @@ MonoBehaviour: m_parseCtrlCharacters: 1 m_isOrthographic: 1 m_isCullingEnabled: 0 - m_ignoreRectMaskCulling: 0 - m_ignoreCulling: 1 m_horizontalMapping: 0 m_verticalMapping: 0 m_uvLineOffset: 0 m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 m_VertexBufferAutoSizeReduction: 1 - m_firstVisibleCharacter: 0 m_useMaxVisibleDescender: 1 m_pageToDisplay: 1 m_margin: {x: 0, y: 0, z: 0, w: 0} - m_textInfo: - textComponent: {fileID: 1846576922} - characterCount: 328 - spriteCount: 0 - spaceCount: 73 - wordCount: 46 - linkCount: 0 - lineCount: 21 - pageCount: 1 - materialCount: 1 m_isUsingLegacyAnimationComponent: 0 m_isVolumetricText: 0 - m_spriteAnimator: {fileID: 0} m_hasFontAssetChanged: 0 - m_subTextObjects: - - {fileID: 0} - - {fileID: 2071885446} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} - - {fileID: 0} m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!222 &1846576923 @@ -3296,7 +3332,6 @@ GameObject: m_Component: - component: {fileID: 2071885445} - component: {fileID: 2071885447} - - component: {fileID: 2071885446} m_Layer: 0 m_Name: TMP SubMeshUI [ARIAL SDF Material + LiberationSans SDF Atlas] m_TagString: Untagged @@ -3323,34 +3358,6 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &2071885446 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2071885444} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 058cba836c1846c3aa1c5fd2e28aea77, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_spriteAsset: {fileID: 0} - m_material: {fileID: 0} - m_sharedMaterial: {fileID: 0} - m_isDefaultMaterial: 0 - m_padding: 0 - m_canvasRenderer: {fileID: 2071885447} - m_TextComponent: {fileID: 1846576922} - m_materialReferenceIndex: 1 --- !u!222 &2071885447 CanvasRenderer: m_ObjectHideFlags: 0 @@ -3447,6 +3454,7 @@ MonoBehaviour: 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: diff --git a/Assets/Scripts/AugmentaSimulation/PointManager.cs b/Assets/Scripts/AugmentaSimulation/PointManager.cs index 58cdbdf..fae7f19 100644 --- a/Assets/Scripts/AugmentaSimulation/PointManager.cs +++ b/Assets/Scripts/AugmentaSimulation/PointManager.cs @@ -715,6 +715,9 @@ public void SendAugmentaMessage(AugmentaMessageType messageType, GameObject obj if (mute) return; + // Craft and send a message that contains the event + extra info + WebsocketManager.activeManager.SendAugmentaMessage(CreateAugmentaMessageJSON(messageType,obj)); + switch (ProtocolVersionManager.protocolVersion) { case ProtocolVersionManager.AugmentaProtocolVersion.V1: OSCManager.activeManager.SendAugmentaMessage(CreateAugmentaMessageV1(messageType, obj)); @@ -1018,4 +1021,49 @@ private float ClampAngle(float angle) { return angle % 360.0f; } + + #region Websocket + + public String CreateAugmentaMessageJSON(AugmentaMessageType messageType, GameObject obj = null) { + + switch (messageType) { + case AugmentaMessageType.AugmentaObjectEnter: + return "{\n\"object\": {\n\"enter\": " + CreateAugmentaMessageJSONData(obj) + "\n}\n}"; + case AugmentaMessageType.AugmentaObjectUpdate: + return "{\n\"object\": {\n\"update\": " + CreateAugmentaMessageJSONData(obj) + "\n}\n}"; + case AugmentaMessageType.AugmentaObjectLeave: + return "{\n\"object\": {\n\"leave\": " + CreateAugmentaMessageJSONData(obj) + "\n}\n}"; + case AugmentaMessageType.SceneUpdated: + return CreateAugmentaMessageJSONScene(); + default: + Debug.Log("Unsupported message type " + messageType.ToString()); + return String.Empty; + } + } + + private String CreateAugmentaMessageJSONData(GameObject obj = null) { + var behaviour = obj.GetComponent(); + float pointX = 0.5f + behaviour.transform.position.x / width; + float pointY = 0.5f - behaviour.transform.position.z / height; + float rotation = behaviour.point.transform.localRotation.eulerAngles.z >= 0 ? behaviour.point.transform.localRotation.eulerAngles.z : behaviour.point.transform.localRotation.eulerAngles.z + 360.0f; + + return "{\n\"frame\":" + _frameCounter + ",\n\"id\":" + behaviour.id + + ",\n\"oid\":" + behaviour.oid + ",\n\"age\":" + behaviour.ageInSeconds + + ",\n\"centroid\": {\n\"x\":" + pointX + ",\n\"y\":" + pointY + "\n}" + + ",\n\"velocity\": {\n\"x\":" + (-behaviour.normalizedVelocity.x) + ",\n\"y\":" + (-behaviour.normalizedVelocity.z) + "\n}" + + ",\n\"orientation\":" + behaviour.orientation + + ",\n\"boundingRect\": {\n\"x\":" + pointX + ",\n\"y\":" + pointY + + ",\n\"width\":" + (behaviour.size.x / width) + ",\n\"height\":" + (behaviour.size.y / height) + ",\n\"rotation\": " + rotation + + "\n},\n\"height\" :" + behaviour.size.z + + ",\n\"extra\": {\n\"frame\": " + _frameCounter + ",\"id\": " + behaviour.id + ",\"oid\": " + behaviour.oid + + ",\n\"highest\": {\n\"x\": " + pointX + ",\n\"y\": " + pointY + "\n}" + + ",\n\"distance\": " + Vector3.Distance(camera.transform.position, behaviour.transform.position) + ",\"reflectivity\": " + behaviour.pointColor.grayscale + "\n}\n}"; + } + + private String CreateAugmentaMessageJSONScene() { + return "{\n\"scene\" : {\n\"frame\": " + _frameCounter + ",\n\"objectCount\" : " + _pointsCount + + ",\n\"scene\" : {\n\"width\" : " + width + ",\n\"height\" : " + height + "\n}\n}\n}"; + } + + #endregion } diff --git a/Assets/Scripts/AugmentaSimulation/VideoOutputManager.cs b/Assets/Scripts/AugmentaSimulation/VideoOutputManager.cs index d2a99c8..e2525a4 100644 --- a/Assets/Scripts/AugmentaSimulation/VideoOutputManager.cs +++ b/Assets/Scripts/AugmentaSimulation/VideoOutputManager.cs @@ -85,6 +85,12 @@ void SendFusionMessage() { fusionMessage.Append(resolution.y); OSCManager.activeManager.SendAugmentaMessage(fusionMessage); + + WebsocketManager.activeManager.SendAugmentaMessage( + "{\n\"fusion\": {\n\"textureOffset\": {\n\"x\": " + offset.x + ",\n\"y\": " + offset.y + + "\n},\n\"textureBounds\": {\n\"x\": " + size.x + ",\n\"y\": " + size.y + + "\n},\n\"targetOutSize\": {\n\"x\": " + resolution.x + ",\n\"y\": " + resolution.y + "\n}\n}\n}" + ); } public void UpdateVideoOutput() { diff --git a/Assets/Scripts/Controllables/WebsocketManagerControllable.cs b/Assets/Scripts/Controllables/WebsocketManagerControllable.cs new file mode 100644 index 0000000..4ff8af8 --- /dev/null +++ b/Assets/Scripts/Controllables/WebsocketManagerControllable.cs @@ -0,0 +1,12 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class WebsocketManagerControllable : Controllable +{ + + [Header("WEBSOCKET SETTINGS")] + [OSCProperty] + public int wsServerPort; + +} diff --git a/Assets/Scripts/Controllables/WebsocketManagerControllable.cs.meta b/Assets/Scripts/Controllables/WebsocketManagerControllable.cs.meta new file mode 100644 index 0000000..53083fd --- /dev/null +++ b/Assets/Scripts/Controllables/WebsocketManagerControllable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: de034ba731ed6964794debd4fe9c0adb +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Network/WebsocketManager.cs b/Assets/Scripts/Network/WebsocketManager.cs new file mode 100644 index 0000000..98d5c33 --- /dev/null +++ b/Assets/Scripts/Network/WebsocketManager.cs @@ -0,0 +1,100 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using System; +using System.Threading; +using WebSocketSharp; +using WebSocketSharp.Server; + +public class WebsocketManager : MonoBehaviour +{ + #region Augmenta Service + + // Declare Augmenta service for the websocket-sharp library + public class AugmentaService : WebSocketBehavior + { + protected override void OnMessage (MessageEventArgs e) { + //if we receive a message with the server prefix it will be broadcasted to all connected clients + if (e.IsText && e.Data.StartsWith(serverPrefix)) { + Sessions.Broadcast(e.Data.Substring(serverPrefix.Length)); + } + } + } + #endregion + + #region Websocket Manager + + public static WebsocketManager activeManager; + + [Header("Output settings")] + private int _wsServerPort = 8080; + public int wsServerPort { + get { return _wsServerPort; } + set { + _wsServerPort = value; + CreateWebsocketServer(); + } + } + + private bool _isInitialized = false; + + private WebSocketServer websocketServer; + + private WebSocket _websocketClient; // client used in this class to publish the augmenta data + + private static String _serverPrefix = "{\"_server_data_\":{}},"; // used to distinguish messages comming from the server, should not break json data + public static String serverPrefix { + get { return _serverPrefix; } + } + + + private void Awake() { + if (!_isInitialized) { + Initialize(); + } + } + + private void OnDestroy() { + websocketServer.Stop(); + } + + void Initialize() { + activeManager = this; + + CreateWebsocketServer(); + _isInitialized = true; + } + + // Start is called before the first frame update + void Start() + { + + + } + + // Update is called once per frame + void Update() + { + + } + + private void CreateWebsocketServer() { + + if(_isInitialized) websocketServer.Stop(); + + websocketServer = new WebSocketServer(_wsServerPort); + + websocketServer.AddWebSocketService("/"); + + websocketServer.Start(); + + _websocketClient = new WebSocket("ws://127.0.0.1:"+_wsServerPort); + _websocketClient.Connect(); + } + + public void SendAugmentaMessage(String msg) { + _websocketClient.Send(_serverPrefix + msg); + } + + #endregion +} diff --git a/Assets/Scripts/Network/WebsocketManager.cs.meta b/Assets/Scripts/Network/WebsocketManager.cs.meta new file mode 100644 index 0000000..ed019a2 --- /dev/null +++ b/Assets/Scripts/Network/WebsocketManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 528760bd39755ab46bcb069618f0d75a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 01931ef..4bc9367 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -125,7 +125,7 @@ PlayerSettings: 16:10: 1 16:9: 1 Others: 1 - bundleVersion: 3.4 + bundleVersion: 3.5 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0