From 2626dde244fb723cca2472c0855af4f1a2ba92e4 Mon Sep 17 00:00:00 2001 From: BOTAlex Date: Sat, 1 Jun 2024 16:26:03 +0200 Subject: [PATCH] Removed all warnings --- Assets/Scripts/Enemy/EnemyPathFinding.cs | 2 +- Assets/Scripts/Enemy/EnemySpawner.cs | 4 +-- Assets/Scripts/HeathSystem/HealthComponent.cs | 33 +++++++++---------- .../Managers/AudioManager/AudioManager.cs | 2 +- .../Scripts/Managers/Rumbling/RopeRumbling.cs | 2 +- .../Scripts/Player/Movement/PlayerMovement.cs | 10 +++--- Assets/Scripts/Upgrade/Upgrader.cs | 7 ++-- Assets/Sounding/RopeSounding.cs | 4 +-- 8 files changed, 30 insertions(+), 34 deletions(-) diff --git a/Assets/Scripts/Enemy/EnemyPathFinding.cs b/Assets/Scripts/Enemy/EnemyPathFinding.cs index 9aa38b3..aec6248 100644 --- a/Assets/Scripts/Enemy/EnemyPathFinding.cs +++ b/Assets/Scripts/Enemy/EnemyPathFinding.cs @@ -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; diff --git a/Assets/Scripts/Enemy/EnemySpawner.cs b/Assets/Scripts/Enemy/EnemySpawner.cs index c7d0018..c5d28b1 100644 --- a/Assets/Scripts/Enemy/EnemySpawner.cs +++ b/Assets/Scripts/Enemy/EnemySpawner.cs @@ -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() { diff --git a/Assets/Scripts/HeathSystem/HealthComponent.cs b/Assets/Scripts/HeathSystem/HealthComponent.cs index 4baeeee..ce0e32d 100644 --- a/Assets/Scripts/HeathSystem/HealthComponent.cs +++ b/Assets/Scripts/HeathSystem/HealthComponent.cs @@ -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(); - float bloodAccumalted = playerInput.PlayerNum == 0 ? BloodComputeShader.Instance.mop1Clean : BloodComputeShader.Instance.mop2Clean; - TakeDamage(-bloodAccumalted / regen); - } + //// blod regen + //if (bloodRegen) + //{ + // PlayerInput playerInput = GetComponent(); + // 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() { diff --git a/Assets/Scripts/Managers/AudioManager/AudioManager.cs b/Assets/Scripts/Managers/AudioManager/AudioManager.cs index 8d34b8c..a1166fc 100644 --- a/Assets/Scripts/Managers/AudioManager/AudioManager.cs +++ b/Assets/Scripts/Managers/AudioManager/AudioManager.cs @@ -79,7 +79,7 @@ public class AudioManager : MonoBehaviour { Destroy(audioSource.gameObject); } - catch (SystemException err) + catch (SystemException) { } diff --git a/Assets/Scripts/Managers/Rumbling/RopeRumbling.cs b/Assets/Scripts/Managers/Rumbling/RopeRumbling.cs index c2d8fe2..cddab00 100644 --- a/Assets/Scripts/Managers/Rumbling/RopeRumbling.cs +++ b/Assets/Scripts/Managers/Rumbling/RopeRumbling.cs @@ -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; diff --git a/Assets/Scripts/Player/Movement/PlayerMovement.cs b/Assets/Scripts/Player/Movement/PlayerMovement.cs index 71ff4ec..70c84ab 100644 --- a/Assets/Scripts/Player/Movement/PlayerMovement.cs +++ b/Assets/Scripts/Player/Movement/PlayerMovement.cs @@ -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; diff --git a/Assets/Scripts/Upgrade/Upgrader.cs b/Assets/Scripts/Upgrade/Upgrader.cs index ed178d3..56384cb 100644 --- a/Assets/Scripts/Upgrade/Upgrader.cs +++ b/Assets/Scripts/Upgrade/Upgrader.cs @@ -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; } } diff --git a/Assets/Sounding/RopeSounding.cs b/Assets/Sounding/RopeSounding.cs index 0e02a80..71ce183 100644 --- a/Assets/Sounding/RopeSounding.cs +++ b/Assets/Sounding/RopeSounding.cs @@ -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()