From 5177802b20d9fe37ade24ddc37294a6a3faab634 Mon Sep 17 00:00:00 2001 From: momintlh <77355191+momintlh@users.noreply.github.com> Date: Tue, 20 Aug 2024 14:57:08 +0500 Subject: [PATCH] feat: discord template fixed and example game --- .../Examples/discord-activity.meta | 8 + .../Examples/discord-activity/Models.meta | 8 + .../Examples/discord-activity/Models/Hat.fbx | Bin 0 -> 17180 bytes .../discord-activity/Models/Hat.fbx.meta | 109 +++++ .../discord-activity/discord-activity.unity} | 393 +++++++++++++++--- .../discord-activity.unity.meta} | 0 .../Examples/discord-activity/prefabs.meta | 8 + .../discord-activity/prefabs}/Bean.prefab | 297 ++++--------- .../prefabs}/Bean.prefab.meta | 0 .../discord-activity/prefabs/Ground.prefab | 107 +++++ .../prefabs/Ground.prefab.meta} | 2 +- .../Examples/discord-activity/scripts.meta | 8 + .../scripts}/IsometricManager.cs | 45 +- .../scripts}/IsometricManager.cs.meta | 0 .../scripts}/IsometricPlayerController.cs | 0 .../IsometricPlayerController.cs.meta | 0 Assets/PlayroomKit/package.json | 2 +- Assets/Prefabs/IsometricPlayer.prefab | 257 ------------ Assets/Sprites/player.mat | 2 +- .../DiscordTemplate/TemplateData/style.css | 23 +- .../WebGLTemplates/DiscordTemplate/index.html | 76 ++-- ProjectSettings/EditorBuildSettings.asset | 2 +- ProjectSettings/ProjectSettings.asset | 4 +- 23 files changed, 748 insertions(+), 603 deletions(-) create mode 100644 Assets/PlayroomKit/Examples/discord-activity.meta create mode 100644 Assets/PlayroomKit/Examples/discord-activity/Models.meta create mode 100644 Assets/PlayroomKit/Examples/discord-activity/Models/Hat.fbx create mode 100644 Assets/PlayroomKit/Examples/discord-activity/Models/Hat.fbx.meta rename Assets/{Scenes/3d-Isometric.unity => PlayroomKit/Examples/discord-activity/discord-activity.unity} (55%) rename Assets/{Scenes/3d-Isometric.unity.meta => PlayroomKit/Examples/discord-activity/discord-activity.unity.meta} (100%) create mode 100644 Assets/PlayroomKit/Examples/discord-activity/prefabs.meta rename Assets/{Prefabs => PlayroomKit/Examples/discord-activity/prefabs}/Bean.prefab (56%) rename Assets/{Prefabs => PlayroomKit/Examples/discord-activity/prefabs}/Bean.prefab.meta (100%) create mode 100644 Assets/PlayroomKit/Examples/discord-activity/prefabs/Ground.prefab rename Assets/{Prefabs/IsometricPlayer.prefab.meta => PlayroomKit/Examples/discord-activity/prefabs/Ground.prefab.meta} (74%) create mode 100644 Assets/PlayroomKit/Examples/discord-activity/scripts.meta rename Assets/{Scripts => PlayroomKit/Examples/discord-activity/scripts}/IsometricManager.cs (59%) rename Assets/{Scripts => PlayroomKit/Examples/discord-activity/scripts}/IsometricManager.cs.meta (100%) rename Assets/{Scripts => PlayroomKit/Examples/discord-activity/scripts}/IsometricPlayerController.cs (100%) rename Assets/{Scripts => PlayroomKit/Examples/discord-activity/scripts}/IsometricPlayerController.cs.meta (100%) delete mode 100644 Assets/Prefabs/IsometricPlayer.prefab diff --git a/Assets/PlayroomKit/Examples/discord-activity.meta b/Assets/PlayroomKit/Examples/discord-activity.meta new file mode 100644 index 0000000..1a62eba --- /dev/null +++ b/Assets/PlayroomKit/Examples/discord-activity.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a5e55cffd82607f4b86eedc0a33aeedd +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PlayroomKit/Examples/discord-activity/Models.meta b/Assets/PlayroomKit/Examples/discord-activity/Models.meta new file mode 100644 index 0000000..f9e53a2 --- /dev/null +++ b/Assets/PlayroomKit/Examples/discord-activity/Models.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bf7e88b10f4028341b4e253b778a057d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/PlayroomKit/Examples/discord-activity/Models/Hat.fbx b/Assets/PlayroomKit/Examples/discord-activity/Models/Hat.fbx new file mode 100644 index 0000000000000000000000000000000000000000..067014d272f87f48f9fb2a52097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dVh`_ zvK15#b@x6sG>S?C0Mt$}2Y?9;U!O5w-!P$`y@a7&93F0iJe~#BjlTn)6MC#lfIxOg zZ&AI+C$Kko0ICv>MkIazdXG=wbbvr@VCVw`Mnpw*rdIm+lQ0E&AtE{%AzGjjm~XO4 zz@@Q*(-y9ZKy1C?VkabFe^H#Q66-4kpqD>z0^_JEqW~OA2FwJYQb1cd0OK*hNHYq+ zOF&ec08DUqU&Fi@i-IWlr?vs8BJ{Ng zz&(WY0|L+%oT!!oXhI(mfQa_}zX(8pt!Q3oLDK9)7=?nX605fX0~n<(;Iax4)q#)b zXhSX)Nhqib)lTEfv4;8Ys-4CkzJ_V;z)aOe`K`e)jbEJolnDf|!JI)o3VN(yjNK|i zv?_cR#vbBEbVgrF_HVNL`_J=9JJL$Oaw+OKrD72O-w^*_?aj#9<8HjVJf+~F!(Hv% HF82Qe@xs PlayerDict = new(); - [SerializeField] private static bool playerJoined; - [SerializeField] private GameObject playerPrefab; @@ -24,12 +22,9 @@ private void Start() { maxPlayersPerRoom = 3, matchmaking = false, - gameId = "QlLX6m413MwtOjkdHKpi", + gameId = "", discord = true - }, () => { PlayroomKit.OnPlayerJoin(AddPlayer); }, () => Debug.Log("OnDisconnect callback")); - - - + }, () => { PlayroomKit.OnPlayerJoin(AddPlayer); }, () => { Debug.Log("OnDisconnect callback"); }); } private void Update() @@ -37,24 +32,30 @@ private void Update() if (playerJoined) { var myPlayer = PlayroomKit.MyPlayer(); - var i = players.IndexOf(myPlayer); + var index = players.IndexOf(myPlayer); - playerGameObjects[i].GetComponent().LookAround(); - players[i].SetState("angle", playerGameObjects[i].GetComponent().rotation); + playerGameObjects[index].GetComponent().LookAround(); + players[index].SetState("angle", playerGameObjects[index].GetComponent().rotation); - playerGameObjects[i].GetComponent().Move(); - players[i].SetState("move", playerGameObjects[i].GetComponent().position); - } + playerGameObjects[index].GetComponent().Move(); + players[index].SetState("move", playerGameObjects[index].GetComponent().position); - for (var i = 0; i < players.Count; i++) - if (players[i] != null) - { - var pos = players[i].GetState("move"); - var rotate = players[i].GetState("angle"); - if (playerGameObjects[i] != null) - playerGameObjects[i].GetComponent().SetPositionAndRotation(pos, rotate); - } + for (var i = 0; i < players.Count; i++) + if (players[i] != null) + { + var pos = players[i].GetState("move"); + var rotate = players[i].GetState("angle"); + var color = players[i].GetState("color"); + + if (playerGameObjects[i] != null) + { + playerGameObjects[i].GetComponent().SetPositionAndRotation(pos, rotate); + + playerGameObjects[i].GetComponent().material.color = color; + } + } + } } @@ -63,7 +64,7 @@ public void AddPlayer(PlayroomKit.Player player) var playerObj = Instantiate(playerPrefab, new Vector3(Random.Range(-5, 5), 2f, Random.Range(-5, 5)), Quaternion.identity); - playerObj.GetComponent().material.color = player.GetProfile().color; + player.SetState("color", player.GetProfile().color); PlayerDict.Add(player.id, playerObj); players.Add(player); diff --git a/Assets/Scripts/IsometricManager.cs.meta b/Assets/PlayroomKit/Examples/discord-activity/scripts/IsometricManager.cs.meta similarity index 100% rename from Assets/Scripts/IsometricManager.cs.meta rename to Assets/PlayroomKit/Examples/discord-activity/scripts/IsometricManager.cs.meta diff --git a/Assets/Scripts/IsometricPlayerController.cs b/Assets/PlayroomKit/Examples/discord-activity/scripts/IsometricPlayerController.cs similarity index 100% rename from Assets/Scripts/IsometricPlayerController.cs rename to Assets/PlayroomKit/Examples/discord-activity/scripts/IsometricPlayerController.cs diff --git a/Assets/Scripts/IsometricPlayerController.cs.meta b/Assets/PlayroomKit/Examples/discord-activity/scripts/IsometricPlayerController.cs.meta similarity index 100% rename from Assets/Scripts/IsometricPlayerController.cs.meta rename to Assets/PlayroomKit/Examples/discord-activity/scripts/IsometricPlayerController.cs.meta diff --git a/Assets/PlayroomKit/package.json b/Assets/PlayroomKit/package.json index ccef591..405e782 100644 --- a/Assets/PlayroomKit/package.json +++ b/Assets/PlayroomKit/package.json @@ -16,7 +16,7 @@ "author": "", "license": "ISC", "dependencies": { - "playroomkit": "latest", + "playroomkit": "0.0.81", "react": "^18.2.0", "react-dom": "^18.2.0" } diff --git a/Assets/Prefabs/IsometricPlayer.prefab b/Assets/Prefabs/IsometricPlayer.prefab deleted file mode 100644 index 93d5f51..0000000 --- a/Assets/Prefabs/IsometricPlayer.prefab +++ /dev/null @@ -1,257 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &2603315019977810228 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 8050795998415906310} - - component: {fileID: 2169756223537510908} - - component: {fileID: 2829385134996929394} - - component: {fileID: 6524546417377390673} - - component: {fileID: 5791266554322587629} - - component: {fileID: 7868697053123563144} - m_Layer: 0 - m_Name: IsometricPlayer - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &8050795998415906310 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2603315019977810228} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 2, z: 0} - m_LocalScale: {x: 0.6, y: 0.6, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 3511744816749012239} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &2169756223537510908 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2603315019977810228} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &2829385134996929394 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2603315019977810228} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 2100000, guid: 7aabbde4381f93240a8176e9281d8533, type: 2} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!114 &6524546417377390673 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2603315019977810228} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 04d8d418385e58d4689d3dcb9081ee41, type: 3} - m_Name: - m_EditorClassIdentifier: - _rb: {fileID: 5791266554322587629} - _speed: 5 - _turnSpeed: 360 ---- !u!54 &5791266554322587629 -Rigidbody: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2603315019977810228} - serializedVersion: 4 - m_Mass: 1 - m_Drag: 0 - m_AngularDrag: 0.05 - m_CenterOfMass: {x: 0, y: 0, z: 0} - m_InertiaTensor: {x: 1, y: 1, z: 1} - m_InertiaRotation: {x: 0, y: 0, z: 0, w: 1} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ImplicitCom: 1 - m_ImplicitTensor: 1 - m_UseGravity: 1 - m_IsKinematic: 0 - m_Interpolate: 0 - m_Constraints: 0 - m_CollisionDetection: 0 ---- !u!65 &7868697053123563144 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2603315019977810228} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 1, y: 0.99999994, z: 0.99999994} - m_Center: {x: 0, y: 0, z: 0} ---- !u!1 &4235077748483245160 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3511744816749012239} - - component: {fileID: 166124084730300124} - - component: {fileID: 4889690407840522861} - - component: {fileID: 2288407999267381681} - m_Layer: 0 - m_Name: Cube - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!4 &3511744816749012239 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4235077748483245160} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0.5} - m_LocalScale: {x: 0.5, y: 0.5, z: 0.5} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 8050795998415906310} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!33 &166124084730300124 -MeshFilter: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4235077748483245160} - m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} ---- !u!23 &4889690407840522861 -MeshRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4235077748483245160} - m_Enabled: 1 - m_CastShadows: 1 - m_ReceiveShadows: 1 - m_DynamicOccludee: 1 - m_StaticShadowCaster: 0 - m_MotionVectors: 1 - m_LightProbeUsage: 1 - m_ReflectionProbeUsage: 1 - m_RayTracingMode: 2 - m_RayTraceProcedural: 0 - m_RenderingLayerMask: 1 - m_RendererPriority: 0 - m_Materials: - - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} - m_StaticBatchInfo: - firstSubMesh: 0 - subMeshCount: 0 - m_StaticBatchRoot: {fileID: 0} - m_ProbeAnchor: {fileID: 0} - m_LightProbeVolumeOverride: {fileID: 0} - m_ScaleInLightmap: 1 - m_ReceiveGI: 1 - m_PreserveUVs: 0 - m_IgnoreNormalsForChartDetection: 0 - m_ImportantGI: 0 - m_StitchLightmapSeams: 1 - m_SelectedEditorRenderState: 3 - m_MinimumChartSize: 4 - m_AutoUVMaxDistance: 0.5 - m_AutoUVMaxAngle: 89 - m_LightmapParameters: {fileID: 0} - m_SortingLayerID: 0 - m_SortingLayer: 0 - m_SortingOrder: 0 - m_AdditionalVertexStreams: {fileID: 0} ---- !u!65 &2288407999267381681 -BoxCollider: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4235077748483245160} - m_Material: {fileID: 0} - m_IncludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_ExcludeLayers: - serializedVersion: 2 - m_Bits: 0 - m_LayerOverridePriority: 0 - m_IsTrigger: 0 - m_ProvidesContacts: 0 - m_Enabled: 1 - serializedVersion: 3 - m_Size: {x: 0.9999999, y: 0.9999999, z: 1} - m_Center: {x: 0, y: 0.00000011920928, z: 0} diff --git a/Assets/Sprites/player.mat b/Assets/Sprites/player.mat index 8c43b70..796e5dc 100644 --- a/Assets/Sprites/player.mat +++ b/Assets/Sprites/player.mat @@ -78,6 +78,6 @@ Material: - _UVSec: 0 - _ZWrite: 1 m_Colors: - - _Color: {r: 0.16470589, g: 0.16470589, b: 0.16470589, a: 1} + - _Color: {r: 1, g: 1, b: 1, a: 1} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/WebGLTemplates/DiscordTemplate/TemplateData/style.css b/Assets/WebGLTemplates/DiscordTemplate/TemplateData/style.css index 48f624c..5aa3aa6 100644 --- a/Assets/WebGLTemplates/DiscordTemplate/TemplateData/style.css +++ b/Assets/WebGLTemplates/DiscordTemplate/TemplateData/style.css @@ -1,5 +1,24 @@ -body { padding: 0; margin: 0 } -#unity-container { position: absolute } +html, body { + height: 100%; + margin: 0; + overflow: hidden; /* Disable scrolling */ + } + +#unity-container { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +#unity-canvas { + width: 100%; + height: 100%; + background: {{{ BACKGROUND_COLOR }}}; +} + + #unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) } #unity-container.unity-mobile { position: fixed; width: 100%; height: 100% } #unity-canvas { background: {{{ BACKGROUND_COLOR }}} } diff --git a/Assets/WebGLTemplates/DiscordTemplate/index.html b/Assets/WebGLTemplates/DiscordTemplate/index.html index b4869c4..876211b 100644 --- a/Assets/WebGLTemplates/DiscordTemplate/index.html +++ b/Assets/WebGLTemplates/DiscordTemplate/index.html @@ -10,10 +10,32 @@ #endif +

- +
@@ -23,7 +45,6 @@
diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 4f5503f..b83eb3d 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -12,6 +12,6 @@ EditorBuildSettings: path: Assets/PlayroomKit/Examples/2d-platformer/2d-platformer.unity guid: cf82eec4c654cf44b89cec2a91afebd5 - enabled: 1 - path: Assets/Scenes/3d-Isometric.unity + path: Assets/PlayroomKit/Examples/discord-activity/discord-activity.unity guid: bb7ef8e4a67f3fb46b78e5d95a6858a7 m_configObjects: {} diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 5b2a017..2f81a5e 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -675,10 +675,10 @@ PlayerSettings: webGLDebugSymbols: 0 webGLEmscriptenArgs: webGLModulesDirectory: - webGLTemplate: APPLICATION:Default + webGLTemplate: PROJECT:DiscordTemplate webGLAnalyzeBuildSize: 0 webGLUseEmbeddedResources: 0 - webGLCompressionFormat: 0 + webGLCompressionFormat: 2 webGLWasmArithmeticExceptions: 0 webGLLinkerTarget: 1 webGLThreadsSupport: 0