From 2d93c013d4325640f13e45cd36bb9d74dfe4da0b Mon Sep 17 00:00:00 2001 From: BOTAlex Date: Sat, 1 Jun 2024 16:32:54 +0200 Subject: [PATCH] Started debugging snorre's blood shit. (Partly working) --- Assets/Scenes/GameScene.unity | 1 - Assets/Scripts/Blood/BloodComputeShader.cs | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index bc6c192..83e9e7f 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -4128,7 +4128,6 @@ MonoBehaviour: difficultyIncreasePerWave: 3 WaveTime: 20 SpawnRadius: 22.6 - NumEnemies: 6 initialSpawnDelay: 5 SpawnCenter: {fileID: 5796191506433166635} timer: 0 diff --git a/Assets/Scripts/Blood/BloodComputeShader.cs b/Assets/Scripts/Blood/BloodComputeShader.cs index 2e3b021..587ded4 100644 --- a/Assets/Scripts/Blood/BloodComputeShader.cs +++ b/Assets/Scripts/Blood/BloodComputeShader.cs @@ -147,17 +147,24 @@ public class BloodComputeShader : MonoBehaviour // Update is called once per frame void Update() { - if (!gameHasStarted) return; + if (Input.GetKeyDown(KeyCode.B)) + createBloodTest(1000); - Assert.IsNotNull(mop1); - Assert.IsNotNull(mop2); + //if (!gameHasStarted) return; + + //Assert.IsNotNull(mop1); + //Assert.IsNotNull(mop2); bloodCompute.SetFloat("deltaTime", Time.deltaTime); bloodCompute.SetInt("numParticles", numParticles); bloodCompute.SetFloat("size", size); bloodCompute.SetFloat("gravity", 9.8f); - bloodCompute.SetVector("mop1Pos", mop1.transform.position); - bloodCompute.SetVector("mop2Pos", mop2.transform.position); + //bloodCompute.SetVector("mop1Pos", mop1.transform.position); + //bloodCompute.SetVector("mop2Pos", mop2.transform.position); + + bloodCompute.SetVector("mop1Pos", Vector3.zero); // Debug + bloodCompute.SetVector("mop2Pos", Vector3.zero); + bloodCompute.SetFloat("CleanRadius", CleanRadius); // if (Input.GetKeyUp(KeyCode.Alpha9)) {