From b759f86368914b5e2e4762b3a5dd38517648803b Mon Sep 17 00:00:00 2001 From: tudor <7089284+tudddorrr@users.noreply.github.com> Date: Wed, 1 Jan 2025 21:28:46 +0000 Subject: [PATCH] talo socket, channels api and chat demo --- .../Settings/Panel Settings.asset | 8 + Assets/Samples/ChatDemo.meta | 8 + Assets/Samples/ChatDemo/Scenes.meta | 8 + Assets/Samples/ChatDemo/Scenes/ChatDemo.unity | 285 ++++++++++++++++++ .../ChatDemo/Scenes/ChatDemo.unity.meta | 7 + Assets/Samples/ChatDemo/Scripts.meta | 8 + .../ChatDemo/Scripts/ChatUIController.cs | 145 +++++++++ .../ChatDemo/Scripts/ChatUIController.cs.meta | 2 + Assets/Samples/ChatDemo/Settings.meta | 8 + .../ChatDemo/Settings/Panel Settings.asset | 46 +++ .../Settings/Panel Settings.asset.meta | 8 + .../Settings/UnityDefaultRuntimeTheme.tss | 1 + .../UnityDefaultRuntimeTheme.tss.meta | 11 + Assets/Samples/ChatDemo/UI.meta | 8 + Assets/Samples/ChatDemo/UI/ChatUI.uss | 47 +++ Assets/Samples/ChatDemo/UI/ChatUI.uss.meta | 11 + Assets/Samples/ChatDemo/UI/ChatUI.uxml | 23 ++ Assets/Samples/ChatDemo/UI/ChatUI.uxml.meta | 10 + .../Settings/Panel Settings.asset | 9 + .../Samples/SavesDemo/Scenes/SavesDemo.unity | 177 +++++++++-- .../Runtime/APIs/ChannelsAPI.cs | 100 ++++++ .../Runtime/APIs/ChannelsAPI.cs.meta | 2 + .../Runtime/APIs/PlayersAPI.cs | 1 + .../Runtime/APIs/SocketTicketsAPI.cs | 20 ++ .../Runtime/APIs/SocketTicketsAPI.cs.meta | 2 + .../Runtime/Entities/Channel.cs | 16 + .../Runtime/Entities/Channel.cs.meta | 2 + .../Runtime/Requests/ChannelsCreateRequest.cs | 11 + .../Requests/ChannelsCreateRequest.cs.meta | 2 + .../Runtime/Requests/ChannelsUpdateRequest.cs | 10 + .../Requests/ChannelsUpdateRequest.cs.meta | 2 + .../Runtime/Responses/ChannelResponse.cs | 8 + .../Runtime/Responses/ChannelResponse.cs.meta | 2 + .../Responses/ChannelsIndexResponse.cs | 8 + .../Responses/ChannelsIndexResponse.cs.meta | 2 + .../Responses/PlayerAuthSessionResponse.cs | 1 + .../Responses/PlayersIdentifyResponse.cs | 1 + .../Responses/SocketTicketsCreateResponse.cs | 8 + .../SocketTicketsCreateResponse.cs.meta | 2 + .../Runtime/SocketRequests.meta | 8 + .../SocketRequests/ChannelMessageRequest.cs | 15 + .../ChannelMessageRequest.cs.meta | 2 + .../Runtime/SocketRequests/IdentifyPlayer.cs | 11 + .../SocketRequests/IdentifyPlayer.cs.meta | 2 + .../Runtime/SocketRequests/SocketRequest.cs | 13 + .../SocketRequests/SocketRequest.cs.meta | 2 + .../Runtime/SocketResponses.meta | 8 + .../SocketResponses/ChannelMessageResponse.cs | 11 + .../ChannelMessageResponse.cs.meta | 2 + .../Runtime/SocketResponses/SocketError.cs | 11 + .../SocketResponses/SocketError.cs.meta | 2 + .../Runtime/SocketResponses/SocketResponse.cs | 29 ++ .../SocketResponses/SocketResponse.cs.meta | 2 + .../Runtime/Talo.GameServices.Runtime.asmdef | 19 +- Packages/com.trytalo.talo/Runtime/Talo.cs | 18 ++ .../com.trytalo.talo/Runtime/TaloSettings.cs | 3 + .../com.trytalo.talo/Runtime/TaloSocket.cs | 119 ++++++++ .../Runtime/TaloSocket.cs.meta | 2 + .../Runtime/Utils/SessionManager.cs | 1 + Packages/manifest.json | 1 + Packages/packages-lock.json | 7 + ProjectSettings/MultiplayerManager.asset | 7 + ProjectSettings/SceneTemplateSettings.json | 97 ++---- 63 files changed, 1317 insertions(+), 105 deletions(-) create mode 100644 Assets/Samples/ChatDemo.meta create mode 100644 Assets/Samples/ChatDemo/Scenes.meta create mode 100644 Assets/Samples/ChatDemo/Scenes/ChatDemo.unity create mode 100644 Assets/Samples/ChatDemo/Scenes/ChatDemo.unity.meta create mode 100644 Assets/Samples/ChatDemo/Scripts.meta create mode 100644 Assets/Samples/ChatDemo/Scripts/ChatUIController.cs create mode 100644 Assets/Samples/ChatDemo/Scripts/ChatUIController.cs.meta create mode 100644 Assets/Samples/ChatDemo/Settings.meta create mode 100644 Assets/Samples/ChatDemo/Settings/Panel Settings.asset create mode 100644 Assets/Samples/ChatDemo/Settings/Panel Settings.asset.meta create mode 100644 Assets/Samples/ChatDemo/Settings/UnityDefaultRuntimeTheme.tss create mode 100644 Assets/Samples/ChatDemo/Settings/UnityDefaultRuntimeTheme.tss.meta create mode 100644 Assets/Samples/ChatDemo/UI.meta create mode 100644 Assets/Samples/ChatDemo/UI/ChatUI.uss create mode 100644 Assets/Samples/ChatDemo/UI/ChatUI.uss.meta create mode 100644 Assets/Samples/ChatDemo/UI/ChatUI.uxml create mode 100644 Assets/Samples/ChatDemo/UI/ChatUI.uxml.meta create mode 100644 Packages/com.trytalo.talo/Runtime/APIs/ChannelsAPI.cs create mode 100644 Packages/com.trytalo.talo/Runtime/APIs/ChannelsAPI.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/APIs/SocketTicketsAPI.cs create mode 100644 Packages/com.trytalo.talo/Runtime/APIs/SocketTicketsAPI.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/Entities/Channel.cs create mode 100644 Packages/com.trytalo.talo/Runtime/Entities/Channel.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/Requests/ChannelsCreateRequest.cs create mode 100644 Packages/com.trytalo.talo/Runtime/Requests/ChannelsCreateRequest.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/Requests/ChannelsUpdateRequest.cs create mode 100644 Packages/com.trytalo.talo/Runtime/Requests/ChannelsUpdateRequest.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/Responses/ChannelResponse.cs create mode 100644 Packages/com.trytalo.talo/Runtime/Responses/ChannelResponse.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/Responses/ChannelsIndexResponse.cs create mode 100644 Packages/com.trytalo.talo/Runtime/Responses/ChannelsIndexResponse.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/Responses/SocketTicketsCreateResponse.cs create mode 100644 Packages/com.trytalo.talo/Runtime/Responses/SocketTicketsCreateResponse.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests/ChannelMessageRequest.cs create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests/ChannelMessageRequest.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests/IdentifyPlayer.cs create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests/IdentifyPlayer.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests/SocketRequest.cs create mode 100644 Packages/com.trytalo.talo/Runtime/SocketRequests/SocketRequest.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses/ChannelMessageResponse.cs create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses/ChannelMessageResponse.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses/SocketError.cs create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses/SocketError.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses/SocketResponse.cs create mode 100644 Packages/com.trytalo.talo/Runtime/SocketResponses/SocketResponse.cs.meta create mode 100644 Packages/com.trytalo.talo/Runtime/TaloSocket.cs create mode 100644 Packages/com.trytalo.talo/Runtime/TaloSocket.cs.meta create mode 100644 ProjectSettings/MultiplayerManager.asset diff --git a/Assets/Samples/AuthenticationDemo/Settings/Panel Settings.asset b/Assets/Samples/AuthenticationDemo/Settings/Panel Settings.asset index f13743f..f0f27ab 100644 --- a/Assets/Samples/AuthenticationDemo/Settings/Panel Settings.asset +++ b/Assets/Samples/AuthenticationDemo/Settings/Panel Settings.asset @@ -13,9 +13,13 @@ MonoBehaviour: m_Name: Panel Settings m_EditorClassIdentifier: themeUss: {fileID: -4733365628477956816, guid: b27dadcd5eb8c42f3b806871f7248fb2, type: 3} + m_DisableNoThemeWarning: 0 m_TargetTexture: {fileID: 0} + m_RenderMode: 0 + m_WorldSpaceLayer: 0 m_ScaleMode: 2 m_ReferenceSpritePixelsPerUnit: 100 + m_PixelsPerUnit: 100 m_Scale: 1 m_ReferenceDpi: 96 m_FallbackDpi: 96 @@ -24,9 +28,11 @@ MonoBehaviour: m_Match: 0 m_SortingOrder: 0 m_TargetDisplay: 0 + m_BindingLogLevel: 0 m_ClearDepthStencil: 1 m_ClearColor: 0 m_ColorClearValue: {r: 0, g: 0, b: 0, a: 0} + m_VertexBudget: 0 m_DynamicAtlasSettings: m_MinAtlasSize: 64 m_MaxAtlasSize: 4096 @@ -35,4 +41,6 @@ MonoBehaviour: m_AtlasBlitShader: {fileID: 9101, guid: 0000000000000000f000000000000000, type: 0} m_RuntimeShader: {fileID: 9100, guid: 0000000000000000f000000000000000, type: 0} m_RuntimeWorldShader: {fileID: 9102, guid: 0000000000000000f000000000000000, type: 0} + m_ICUDataAsset: {fileID: 0} + forceGammaRendering: 0 textSettings: {fileID: 0} diff --git a/Assets/Samples/ChatDemo.meta b/Assets/Samples/ChatDemo.meta new file mode 100644 index 0000000..e120625 --- /dev/null +++ b/Assets/Samples/ChatDemo.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 49b9e28c207324630aa3615f4dc9207d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/ChatDemo/Scenes.meta b/Assets/Samples/ChatDemo/Scenes.meta new file mode 100644 index 0000000..615d74c --- /dev/null +++ b/Assets/Samples/ChatDemo/Scenes.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 6fc172a4ee3b5445185cf2367163daa3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/ChatDemo/Scenes/ChatDemo.unity b/Assets/Samples/ChatDemo/Scenes/ChatDemo.unity new file mode 100644 index 0000000..b94fd33 --- /dev/null +++ b/Assets/Samples/ChatDemo/Scenes/ChatDemo.unity @@ -0,0 +1,285 @@ +%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: 10 + 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: 3 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 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_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 13 + m_BakeOnSceneLoad: 0 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 0 + 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_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: 1 + m_PVRFilteringGaussRadiusAO: 1 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 3 + 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 + buildHeightMesh: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &1109763076 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1109763078} + - component: {fileID: 1109763077} + - component: {fileID: 1109763079} + m_Layer: 0 + m_Name: UI + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &1109763077 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1109763076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 19102, guid: 0000000000000000e000000000000000, type: 0} + m_Name: + m_EditorClassIdentifier: + m_PanelSettings: {fileID: 11400000, guid: c2e8d45d57e604cc78799650d215a02e, type: 2} + m_ParentUI: {fileID: 0} + sourceAsset: {fileID: 9197481963319205126, guid: d64908c7074e542a99b96c8605858371, type: 3} + m_SortingOrder: 0 + m_WorldSpaceSizeMode: 1 + m_WorldSpaceWidth: 1920 + m_WorldSpaceHeight: 1080 +--- !u!4 &1109763078 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1109763076} + serializedVersion: 2 + 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_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1109763079 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1109763076} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 45b976c638ac54836bdc684992ef7fa0, type: 3} + m_Name: + m_EditorClassIdentifier: + playerUsername: tudor + channelId: 5 +--- !u!1 &1446344620 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1446344623} + - component: {fileID: 1446344622} + - component: {fileID: 1446344621} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &1446344621 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1446344620} + m_Enabled: 1 +--- !u!20 &1446344622 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1446344620} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 1 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_Iso: 200 + m_ShutterSpeed: 0.005 + m_Aperture: 16 + m_FocusDistance: 10 + m_FocalLength: 50 + m_BladeCount: 5 + m_Curvature: {x: 2, y: 11} + m_BarrelClipping: 0.25 + m_Anamorphism: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 1 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &1446344623 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1446344620} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1660057539 &9223372036854775807 +SceneRoots: + m_ObjectHideFlags: 0 + m_Roots: + - {fileID: 1446344623} + - {fileID: 1109763078} diff --git a/Assets/Samples/ChatDemo/Scenes/ChatDemo.unity.meta b/Assets/Samples/ChatDemo/Scenes/ChatDemo.unity.meta new file mode 100644 index 0000000..7c915ce --- /dev/null +++ b/Assets/Samples/ChatDemo/Scenes/ChatDemo.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b0c0e97dc605b452b91e0d6fa5e99afa +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/ChatDemo/Scripts.meta b/Assets/Samples/ChatDemo/Scripts.meta new file mode 100644 index 0000000..f66f2bd --- /dev/null +++ b/Assets/Samples/ChatDemo/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c982089f6971f45d8be77f0c201095db +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/ChatDemo/Scripts/ChatUIController.cs b/Assets/Samples/ChatDemo/Scripts/ChatUIController.cs new file mode 100644 index 0000000..9b56702 --- /dev/null +++ b/Assets/Samples/ChatDemo/Scripts/ChatUIController.cs @@ -0,0 +1,145 @@ +using UnityEngine; +using TaloGameServices; +using UnityEngine.UIElements; +using System.Collections.Generic; + +public class ChatUIController : MonoBehaviour +{ + public string playerUsername; + private int activeChannelId; + + private List messages = new List(); + private VisualElement root; + private ListView messagesList; + private VisualElement channelsList; + private TextField messageField; + private Button sendButton; + private TextField channelNameField; + private Button createButton; + + private async void Start() + { + root = GetComponent().rootVisualElement; + + InitMessagesList(); + messageField = root.Q("message"); + sendButton = root.Q