Compare commits

...

2 Commits

Author SHA1 Message Date
BOTAlex 2d93c013d4 Started debugging snorre's blood shit. (Partly working) 2024-06-01 16:32:54 +02:00
BOTAlex 2626dde244 Removed all warnings 2024-06-01 16:26:03 +02:00
10 changed files with 42 additions and 40 deletions

View File

@ -4128,7 +4128,6 @@ MonoBehaviour:
difficultyIncreasePerWave: 3
WaveTime: 20
SpawnRadius: 22.6
NumEnemies: 6
initialSpawnDelay: 5
SpawnCenter: {fileID: 5796191506433166635}
timer: 0

View File

@ -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)) {

View File

@ -10,7 +10,7 @@ public class EnemyPathFinding : MonoBehaviour
[SerializeField] public Transform[] targets;
[SerializeField] private float ropeDistCheck = 1f;
[SerializeField] private float stopBeforeTargetOffset = 1f;
//[SerializeField] private float stopBeforeTargetOffset = 1f; //Unused
[SerializeField] private LayerMask ropeCheckMask;
private bool isCollidingWithTarget;

View File

@ -14,7 +14,7 @@ public class EnemySpawner : NetworkBehaviour
[SerializeField] private float difficultyIncreasePerWave = 1f;
[SerializeField] public float WaveTime = 20f;
[SerializeField] private float SpawnRadius = 10;
[SerializeField] private int NumEnemies = 6;
//[SerializeField] private int NumEnemies = 6; //Unused
private GameObject[] players;
[SerializeField] private float initialSpawnDelay = 5;
[Space(10)]
@ -30,7 +30,7 @@ public class EnemySpawner : NetworkBehaviour
public static EnemySpawner instance;
private static int idCounter = 0;
//private static int idCounter = 0; //Unused
private void OnEnable()
{

View File

@ -13,8 +13,8 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
[SerializeField] private bool onlyCallZeroHealthOnce = true;
[SerializeField] float maxHealth = 100;
[SerializeField] float damageTickDelay = 0.25f;
private float currentDamageTick = 0f;
//[SerializeField] float damageTickDelay = 0.25f; //Unused
//private float currentDamageTick = 0f; //Unused
private float accumulatedDamageInTick = 0f;
public float currentHealth { get; private set; }
@ -87,23 +87,22 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
void Update()
{
return;
// blod regen
if (bloodRegen)
{
PlayerInput playerInput = GetComponent<PlayerInput>();
float bloodAccumalted = playerInput.PlayerNum == 0 ? BloodComputeShader.Instance.mop1Clean : BloodComputeShader.Instance.mop2Clean;
TakeDamage(-bloodAccumalted / regen);
}
//// blod regen
//if (bloodRegen)
//{
// PlayerInput playerInput = GetComponent<PlayerInput>();
// float bloodAccumalted = playerInput.PlayerNum == 0 ? BloodComputeShader.Instance.mop1Clean : BloodComputeShader.Instance.mop2Clean;
// TakeDamage(-bloodAccumalted / regen);
//}
if (currentDamageTick < Time.time)
{
if (accumulatedDamageInTick < 1f) return;
//if (currentDamageTick < Time.time)
//{
// if (accumulatedDamageInTick < 1f) return;
OnHealthChangeAtPos?.Invoke(transform.position.Add(y: 2f), accumulatedDamageInTick);
currentDamageTick = Time.time + damageTickDelay;
accumulatedDamageInTick = 0f;
}
// OnHealthChangeAtPos?.Invoke(transform.position.Add(y: 2f), accumulatedDamageInTick);
// currentDamageTick = Time.time + damageTickDelay;
// accumulatedDamageInTick = 0f;
//}
}
public float getMaxHealth() {

View File

@ -79,7 +79,7 @@ public class AudioManager : MonoBehaviour
{
Destroy(audioSource.gameObject);
}
catch (SystemException err)
catch (SystemException)
{
}

View File

@ -5,7 +5,7 @@ using UnityEngine.InputSystem;
public class RopeRumbling : MonoBehaviour
{
[SerializeField] private float RopeRubleTolerance = 0.5f;
//[SerializeField] private float RopeRubleTolerance = 0.5f; //Unused
[SerializeField] private float MaxVibration = 0.8f;
private PlayerInput pInput;

View File

@ -11,7 +11,7 @@ public class PlayerMovement : MonoBehaviour
public float moveSpeed = 5f;
private Rigidbody2D rb;
private bool right = false;
//private bool right = false; //Unused
[Header("Whipping")]
[SerializeField]
@ -19,11 +19,11 @@ public class PlayerMovement : MonoBehaviour
public float whipSmashSpeed = 2f;
public float whipSmashDamageMult = 2f;
[SerializeField]
private float whipMoveSpeed = 25f;
//[SerializeField] //Unused
//private float whipMoveSpeed = 25f;
[SerializeField]
private float maxWhipMoveSpeed = 30f;
//[SerializeField] //Unused
//private float maxWhipMoveSpeed = 30f;
private IMoveData playerInput;

View File

@ -52,13 +52,13 @@ public class Upgrader : MonoBehaviour
private PlayerInput Player1Input;
private PlayerInput Player2Input;
private float acceptTime = 0f;
//private float acceptTime = 0f; //Unused
private Image background;
private Image[] upgradeImages = new Image[8];
private bool prevCouldUpgrade = true;
// private bool prevCouldUpgrade = true; //Unused
public Image BloodMeter;
public TMPro.TextMeshProUGUI description;
@ -370,9 +370,6 @@ public class Upgrader : MonoBehaviour
BloodMeter.fillAmount = ((float)bloodManager.score) / ((float)upgradeCost);
}
// dont care
yield return null;
}
}

View File

@ -6,12 +6,12 @@ using UnityUtils;
public class RopeSounding : MonoBehaviour
{
[SerializeField] private float PlayTime = 1f;
// [SerializeField] private float PlayTime = 1f; //Unused
RopeSimulatorOld rope;
AudioSource AS;
float playTimeLeft = 0;
//float playTimeLeft = 0; //Unused
// Update is called once per frame
void Update()