diff --git a/Assets/Scenes/GameScene.unity.meta b/Assets/Scenes/GameScene.unity.meta new file mode 100644 index 0000000..3ba924c --- /dev/null +++ b/Assets/Scenes/GameScene.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 0400e5e5779425c40ba3164b1e0b5b59 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Blood/BloodComputeShader.cs b/Assets/Scripts/Blood/BloodComputeShader.cs index d9d5f17..a26d038 100644 --- a/Assets/Scripts/Blood/BloodComputeShader.cs +++ b/Assets/Scripts/Blood/BloodComputeShader.cs @@ -69,7 +69,10 @@ public class BloodComputeShader : MonoBehaviour return; } Instance = this; + + GameManager.OnPlayersReady += OnPlayersReady; } + void Start() { ComputeHelper.CreateStructuredBuffer(ref particleBuffer, numParticles); @@ -130,6 +133,12 @@ public class BloodComputeShader : MonoBehaviour freeBloodReadRequest = AsyncGPUReadback.Request(freeParticleBuffer); } + void OnPlayersReady(GameObject[] players) + { + mop1 = players[0].GetComponent(); + mop2 = players[1].GetComponent(); + } + // Update is called once per frame void Update() { diff --git a/Assets/Scripts/Blood/Project.Scripts.Blood.asmdef b/Assets/Scripts/Blood/Project.Scripts.Blood.asmdef index cdac294..487f6e3 100644 --- a/Assets/Scripts/Blood/Project.Scripts.Blood.asmdef +++ b/Assets/Scripts/Blood/Project.Scripts.Blood.asmdef @@ -2,7 +2,8 @@ "name": "Project.Scripts.Blood", "rootNamespace": "", "references": [ - "GUID:6055be8ebefd69e48b49212b09b47b2f" + "GUID:6055be8ebefd69e48b49212b09b47b2f", + "GUID:c0e1b40f519e6e84b8f4af9930403ecb" ], "includePlatforms": [], "excludePlatforms": [], diff --git a/Assets/Scripts/Managers/Project.Scripts.Manager.asmdef b/Assets/Scripts/Managers/Project.Scripts.Manager.asmdef index 546be7e..147e256 100644 --- a/Assets/Scripts/Managers/Project.Scripts.Manager.asmdef +++ b/Assets/Scripts/Managers/Project.Scripts.Manager.asmdef @@ -1,13 +1,7 @@ { "name": "Project.Scripts.Manager", "rootNamespace": "", - "references": [ - "GUID:6055be8ebefd69e48b49212b09b47b2f", - "GUID:0ba5c175a7b2c8345a4e996560a9d0ab", - "GUID:2ea4a18a75f268848b43865100892489", - "GUID:055e16077a1232f4780a04598b3bfe00", - "GUID:1031dfc67c8f1a645b71d679ac3bf7db" - ], + "references": [], "includePlatforms": [], "excludePlatforms": [], "allowUnsafeCode": false, diff --git a/Assets/Scripts/Multiplayer/SteamManager.cs b/Assets/Scripts/Multiplayer/SteamManager.cs index b3362e8..1be6243 100644 --- a/Assets/Scripts/Multiplayer/SteamManager.cs +++ b/Assets/Scripts/Multiplayer/SteamManager.cs @@ -9,6 +9,7 @@ using TMPro; using Unity.Netcode; using Unity.Netcode.Transports.UTP; using UnityEngine; +using UnityEngine.SceneManagement; using UnityEngine.UI; public class SteamManager : ZNetworkData @@ -90,7 +91,11 @@ public class SteamManager : ZNetworkData { if (!NetworkManager.Singleton.IsHost) return; - NetworkManager.Singleton.SceneManager.LoadScene("Multiplayer", UnityEngine.SceneManagement.LoadSceneMode.Single); + // Gets next scene name + int nextSceneIndex = SceneManager.GetActiveScene().buildIndex + 1; + string nextSceneName = SceneUtility.GetScenePathByBuildIndex(nextSceneIndex); + + NetworkManager.Singleton.SceneManager.LoadScene(nextSceneName, UnityEngine.SceneManagement.LoadSceneMode.Single); } private void UpdateUI()