diff --git a/AGENTS.md b/AGENTS.md index 3f0b681..56abd43 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,8 @@ - Project name: Ultimate-HelixJump - Unity version: Unity 6000.3.0f1 +- Active game object: + - Name: PlatformManager + - Tag: Untagged + - Layer: Default \ No newline at end of file diff --git a/Assets/DarkMatter/Code/App/Installers/GameLifetimeScope.cs b/Assets/DarkMatter/Code/App/Installers/GameLifetimeScope.cs index f1cbd71..e020b42 100644 --- a/Assets/DarkMatter/Code/App/Installers/GameLifetimeScope.cs +++ b/Assets/DarkMatter/Code/App/Installers/GameLifetimeScope.cs @@ -11,6 +11,7 @@ namespace Darkmatter.App { [SerializeField] private PlatformPool platformPool; [SerializeField] private LeaderBoardDataPool leaderBoardDataPool; + [SerializeField] private PlayerSplashPool playerSplashPool; [SerializeField] private PlatformManager manager; [SerializeField] private InputReaderSO inputReader; [SerializeField] private GameSessionSO gameSession; @@ -27,6 +28,7 @@ namespace Darkmatter.App { builder.RegisterComponent(platformPool).As>(); builder.RegisterComponent(leaderBoardDataPool).As>(); + builder.RegisterComponent(playerSplashPool).As>(); builder.RegisterComponent(manager).As(); builder.RegisterInstance(inputReader).As(); builder.Register(Lifetime.Singleton).As(); diff --git a/Assets/DarkMatter/Code/Core/Contracts/IPoolable.cs b/Assets/DarkMatter/Code/Core/Contracts/IPoolable.cs deleted file mode 100644 index ea8fdd8..0000000 --- a/Assets/DarkMatter/Code/Core/Contracts/IPoolable.cs +++ /dev/null @@ -1,10 +0,0 @@ -using UnityEngine; - -namespace Darkmatter.Core -{ - public interface IPoolable - { - void OnSpawn(); - void OnDespawn(); - } -} diff --git a/Assets/DarkMatter/Code/Core/Contracts/IPoolable.cs.meta b/Assets/DarkMatter/Code/Core/Contracts/IPoolable.cs.meta deleted file mode 100644 index 95bb9e4..0000000 --- a/Assets/DarkMatter/Code/Core/Contracts/IPoolable.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: bae72f3bdf0337048826015fe234b8f3 \ No newline at end of file diff --git a/Assets/DarkMatter/Code/Domain/Player/Player.cs b/Assets/DarkMatter/Code/Domain/Player/Player.cs index 4bd9c15..77665cf 100644 --- a/Assets/DarkMatter/Code/Domain/Player/Player.cs +++ b/Assets/DarkMatter/Code/Domain/Player/Player.cs @@ -29,6 +29,7 @@ namespace Darkmatter.Domain { isDead = false; playerMaterial.color = playerMaterialColors[Random.Range(0, playerMaterialColors.Length)]; + } private void OnCollisionEnter(Collision collision) diff --git a/Assets/DarkMatter/Code/Domain/LeaderBoard.meta b/Assets/DarkMatter/Code/Presentation/LeaderBoard.meta similarity index 77% rename from Assets/DarkMatter/Code/Domain/LeaderBoard.meta rename to Assets/DarkMatter/Code/Presentation/LeaderBoard.meta index 291126d..c477081 100644 --- a/Assets/DarkMatter/Code/Domain/LeaderBoard.meta +++ b/Assets/DarkMatter/Code/Presentation/LeaderBoard.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 519b6dff3c0f4154b911953421501a5d +guid: 9d68e43472632a542bc60a79aa0250ae folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/DarkMatter/Code/Presentation/LeaderBoard/LeaderBoardData.cs b/Assets/DarkMatter/Code/Presentation/LeaderBoard/LeaderBoardData.cs new file mode 100644 index 0000000..49bb8af --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/LeaderBoard/LeaderBoardData.cs @@ -0,0 +1,13 @@ +using Darkmatter.Core; +using TMPro; +using UnityEngine; + +namespace Darkmatter.Presentation +{ + public class LeaderBoardData : MonoBehaviour,ILeaderBoardData + { + public TextMeshProUGUI playerPos; + public TextMeshProUGUI playerName; + public TextMeshProUGUI playerScore; + } +} diff --git a/Assets/DarkMatter/Code/Presentation/LeaderBoard/LeaderBoardData.cs.meta b/Assets/DarkMatter/Code/Presentation/LeaderBoard/LeaderBoardData.cs.meta new file mode 100644 index 0000000..d9ee8d4 --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/LeaderBoard/LeaderBoardData.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: eca7710de6fa5b94fa7c532a021816e7 \ No newline at end of file diff --git a/Assets/DarkMatter/Code/Presentation/Platforms/LeaderBoardData.cs b/Assets/DarkMatter/Code/Presentation/Platforms/LeaderBoardData.cs deleted file mode 100644 index 6cc312e..0000000 --- a/Assets/DarkMatter/Code/Presentation/Platforms/LeaderBoardData.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Darkmatter.Core; -using TMPro; -using UnityEngine; -using VContainer; - -namespace Darkmatter.Presentation -{ - - public class LeaderBoardData : MonoBehaviour,IPoolable, ILeaderBoardData - { - public TextMeshProUGUI posNumber; - public TextMeshProUGUI playerName; - public TextMeshProUGUI playerScore; - - public void OnDespawn() - { - Debug.Log("LB data Despawnned"); - } - - public void OnSpawn() - { - Debug.Log("LB data spawnned"); - } - } -} diff --git a/Assets/DarkMatter/Code/Presentation/Platforms/LeaderBoardData.cs.meta b/Assets/DarkMatter/Code/Presentation/Platforms/LeaderBoardData.cs.meta deleted file mode 100644 index 71ccfc2..0000000 --- a/Assets/DarkMatter/Code/Presentation/Platforms/LeaderBoardData.cs.meta +++ /dev/null @@ -1,2 +0,0 @@ -fileFormatVersion: 2 -guid: 19899d49b8ee4db41a4ca8dd590ad4a1 \ No newline at end of file diff --git a/Assets/DarkMatter/Code/Presentation/Platforms/Platform.cs b/Assets/DarkMatter/Code/Presentation/Platforms/Platform.cs index 5ab0fbf..516edaa 100644 --- a/Assets/DarkMatter/Code/Presentation/Platforms/Platform.cs +++ b/Assets/DarkMatter/Code/Presentation/Platforms/Platform.cs @@ -4,7 +4,7 @@ using System.Collections.Generic; using UnityEngine; using VContainer; -public class Platform : MonoBehaviour, IPlatform , IPoolable +public class Platform : MonoBehaviour, IPlatform { [SerializeField] private List _platformPiece = new List(); [SerializeField] private Material _safeMaterial; @@ -75,16 +75,6 @@ public class Platform : MonoBehaviour, IPlatform , IPoolable platformManager.BuildNewPlatform(); } } - - public void OnSpawn() - { - hasAchievedScore = false; - } - - public void OnDespawn() - { - - } } diff --git a/Assets/DarkMatter/Code/Presentation/Pool/ObjectPool.cs b/Assets/DarkMatter/Code/Presentation/Pool/ObjectPool.cs index 97eb66b..324b51a 100644 --- a/Assets/DarkMatter/Code/Presentation/Pool/ObjectPool.cs +++ b/Assets/DarkMatter/Code/Presentation/Pool/ObjectPool.cs @@ -1,13 +1,12 @@ using Darkmatter.Core; using System.Collections.Generic; -using System.Runtime.InteropServices.WindowsRuntime; using UnityEngine; using VContainer; using VContainer.Unity; namespace Darkmatter.Presentation { - public class ObjectPool : MonoBehaviour,IPool where T : MonoBehaviour, IPoolable + public class ObjectPool : MonoBehaviour,IPool where T : Component { [SerializeField] T prefab; [SerializeField] private Transform prefabParent; @@ -29,7 +28,6 @@ namespace Darkmatter.Presentation { T obj = Instantiate(prefab, prefabParent); resolver.InjectGameObject(obj.gameObject); - obj.OnSpawn(); obj.gameObject.SetActive(false); pool.Enqueue(obj); } @@ -41,7 +39,6 @@ namespace Darkmatter.Presentation { T obj = Instantiate(prefab, prefabParent); resolver.InjectGameObject(obj.gameObject); - obj.OnSpawn(); obj.gameObject.SetActive(true); pool.Enqueue(obj); return obj; @@ -52,7 +49,6 @@ namespace Darkmatter.Presentation public void ReturnToPool(T obj) { - obj.OnDespawn(); obj.gameObject.SetActive(false); pool.Enqueue(obj); } diff --git a/Assets/DarkMatter/Code/Presentation/Pool/PlayerSplashPool.cs b/Assets/DarkMatter/Code/Presentation/Pool/PlayerSplashPool.cs new file mode 100644 index 0000000..4d8ee92 --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/Pool/PlayerSplashPool.cs @@ -0,0 +1,6 @@ +using UnityEngine; + +namespace Darkmatter.Presentation +{ + public class PlayerSplashPool : ObjectPool { } +} diff --git a/Assets/DarkMatter/Code/Presentation/Pool/PlayerSplashPool.cs.meta b/Assets/DarkMatter/Code/Presentation/Pool/PlayerSplashPool.cs.meta new file mode 100644 index 0000000..281bfc6 --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/Pool/PlayerSplashPool.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 9d59f9cfcc85400449668d96f0e2d89c \ No newline at end of file diff --git a/Assets/DarkMatter/Code/Presentation/Splash.meta b/Assets/DarkMatter/Code/Presentation/Splash.meta new file mode 100644 index 0000000..bbf510a --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/Splash.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3dcc2bb2471f63b478b2b3e9697c0351 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/DarkMatter/Code/Presentation/Splash/Splash.cs b/Assets/DarkMatter/Code/Presentation/Splash/Splash.cs new file mode 100644 index 0000000..6e5d596 --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/Splash/Splash.cs @@ -0,0 +1,18 @@ +using Darkmatter.Core; +using UnityEngine; + +namespace Darkmatter.Presentation +{ + public class Splash : MonoBehaviour + { + public void OnDespawn() + { + Debug.Log("Despawned splash"); + } + + public void OnSpawn() + { + Debug.Log("Spawnned Splash"); + } + } +} diff --git a/Assets/DarkMatter/Code/Presentation/Splash/Splash.cs.meta b/Assets/DarkMatter/Code/Presentation/Splash/Splash.cs.meta new file mode 100644 index 0000000..476ab8c --- /dev/null +++ b/Assets/DarkMatter/Code/Presentation/Splash/Splash.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 3db6a3cf6d18bec4f88fe6a46e141d5f \ No newline at end of file diff --git a/Assets/DarkMatter/Code/Presentation/UI/LeaderBoardView.cs b/Assets/DarkMatter/Code/Presentation/UI/LeaderBoardView.cs index ebb4472..7854cd0 100644 --- a/Assets/DarkMatter/Code/Presentation/UI/LeaderBoardView.cs +++ b/Assets/DarkMatter/Code/Presentation/UI/LeaderBoardView.cs @@ -20,7 +20,7 @@ namespace Darkmatter.Presentation public void UpdateData(int rank,string name, string score) { LeaderBoardData data = Instantiate(LBplayerData, LBDataContainer); - data.posNumber.text = rank.ToString(); + data.playerPos.text = rank.ToString(); data.playerName.text = name; data.playerScore.text = score; } diff --git a/Assets/Resources/Materials/Player.mat b/Assets/Resources/Materials/Player.mat index c3e7d3e..a224aad 100644 --- a/Assets/Resources/Materials/Player.mat +++ b/Assets/Resources/Materials/Player.mat @@ -129,8 +129,8 @@ Material: - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.22148229, g: 0.13866144, b: 0.7169812, a: 0} - - _Color: {r: 0.22148225, g: 0.13866141, b: 0.7169812, a: 0} + - _BaseColor: {r: 0.735849, g: 0.09371662, b: 0.48520926, a: 0} + - _Color: {r: 0.735849, g: 0.093716584, b: 0.48520917, a: 0} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Resources/Materials/death.mat b/Assets/Resources/Materials/death.mat index 9cb9efc..0421cc0 100644 --- a/Assets/Resources/Materials/death.mat +++ b/Assets/Resources/Materials/death.mat @@ -116,7 +116,7 @@ Material: - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.8679245, g: 0.8474546, b: 0.8474546, a: 0} + - _BaseColor: {r: 0.17342028, g: 0.754717, b: 0.0747597, a: 0} - _Color: {r: 0.17342025, g: 0.75471693, b: 0.07475967, a: 0} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} diff --git a/Assets/Resources/Materials/safe.mat b/Assets/Resources/Materials/safe.mat index 7e1552f..b614c85 100644 --- a/Assets/Resources/Materials/safe.mat +++ b/Assets/Resources/Materials/safe.mat @@ -116,8 +116,8 @@ Material: - _XRMotionVectorsPass: 1 - _ZWrite: 1 m_Colors: - - _BaseColor: {r: 0.7924528, g: 0.7552929, b: 0.063545756, a: 1} - - _Color: {r: 0.8113207, g: 0.53379685, b: 0.042096816, a: 1} + - _BaseColor: {r: 0.122641504, g: 0.12090601, b: 0.12090601, a: 0} + - _Color: {r: 0.12264148, g: 0.12090597, b: 0.12090597, a: 0} - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} m_BuildTextureStacks: [] diff --git a/Assets/Resources/PlatformPrefabs/Data.prefab b/Assets/Resources/PlatformPrefabs/Data.prefab index c8356c4..085c96d 100644 --- a/Assets/Resources/PlatformPrefabs/Data.prefab +++ b/Assets/Resources/PlatformPrefabs/Data.prefab @@ -146,7 +146,7 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 6295715214915275273} - - component: {fileID: 6369205413707127148} + - component: {fileID: 1566650972078747329} m_Layer: 5 m_Name: Data m_TagString: Untagged @@ -177,7 +177,7 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 817.4707, y: 120} m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &6369205413707127148 +--- !u!114 &1566650972078747329 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -186,10 +186,10 @@ MonoBehaviour: m_GameObject: {fileID: 340109946359880583} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 19899d49b8ee4db41a4ca8dd590ad4a1, type: 3} + m_Script: {fileID: 11500000, guid: eca7710de6fa5b94fa7c532a021816e7, type: 3} m_Name: - m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.LeaderboardData - posNumber: {fileID: 8966731343238371749} + m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.LeaderBoardData + playerPos: {fileID: 8966731343238371749} playerName: {fileID: 7140963729975583955} playerScore: {fileID: 7199945981426735824} --- !u!1 &4797370510838053142 diff --git a/Assets/Resources/PlatformPrefabs/Splash.prefab b/Assets/Resources/PlatformPrefabs/Splash.prefab index a58eba8..94c95f4 100644 --- a/Assets/Resources/PlatformPrefabs/Splash.prefab +++ b/Assets/Resources/PlatformPrefabs/Splash.prefab @@ -10,6 +10,7 @@ GameObject: m_Component: - component: {fileID: 4060169500839605980} - component: {fileID: 8834857514908603474} + - component: {fileID: 7697948330971322712} m_Layer: 0 m_Name: Splash m_TagString: Untagged @@ -91,3 +92,15 @@ SpriteRenderer: m_SpriteTileMode: 0 m_WasSpriteAssigned: 1 m_SpriteSortPoint: 0 +--- !u!114 &7697948330971322712 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9000420296853654146} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3db6a3cf6d18bec4f88fe6a46e141d5f, type: 3} + m_Name: + m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.Splash diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index fc89cc1..22ded61 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -300,7 +300,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: c15c9d815e963334384a40fbc8e84f23, type: 3} m_Name: m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.LeaderBoardDataPool - prefab: {fileID: 6369205413707127148, guid: b16e394676a0f3e4dbf81cd523bf2325, type: 3} + prefab: {fileID: 1566650972078747329, guid: b16e394676a0f3e4dbf81cd523bf2325, type: 3} prefabParent: {fileID: 1836214634} poolSize: 15 --- !u!1 &63427161 @@ -534,6 +534,53 @@ AudioSource: m_PreInfinity: 2 m_PostInfinity: 2 m_RotationOrder: 4 +--- !u!1 &136903764 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 136903765} + - component: {fileID: 136903766} + m_Layer: 0 + m_Name: PlayerSplashPool + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &136903765 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 136903764} + 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: 1111723450} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &136903766 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 136903764} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9d59f9cfcc85400449668d96f0e2d89c, type: 3} + m_Name: + m_EditorClassIdentifier: PresentationAssembly::Darkmatter.Presentation.PlayerSplashPool + prefab: {fileID: 7697948330971322712, guid: 28c1e4391077e5c4e98f5924dc346fd9, type: 3} + prefabParent: {fileID: 1850425825} + poolSize: 5 --- !u!1 &155034150 GameObject: m_ObjectHideFlags: 0 @@ -10984,6 +11031,7 @@ MonoBehaviour: autoInjectGameObjects: [] platformPool: {fileID: 1073116393} leaderBoardDataPool: {fileID: 62404198} + playerSplashPool: {fileID: 136903766} manager: {fileID: 1850425826} inputReader: {fileID: 11400000, guid: dfe12148dc4d7ea46b49e490c1b1aad5, type: 2} gameSession: {fileID: 11400000, guid: 166236fc288d5a343ba6dd8ab704e653, type: 2} @@ -13296,6 +13344,7 @@ Transform: m_Children: - {fileID: 1073116392} - {fileID: 62404197} + - {fileID: 136903765} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &1148039065