diff --git a/Assets/Scenes/GameScene.unity b/Assets/Scenes/GameScene.unity index a8e3d9c..018a38a 100644 --- a/Assets/Scenes/GameScene.unity +++ b/Assets/Scenes/GameScene.unity @@ -675,7 +675,7 @@ PrefabInstance: objectReference: {fileID: 1920006248} - target: {fileID: 5108819328747686001, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} propertyPath: MaxVibration - value: 0.5 + value: 0.25 objectReference: {fileID: 0} - target: {fileID: 5150961666696654592, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} propertyPath: Volume @@ -1281,7 +1281,7 @@ PrefabInstance: objectReference: {fileID: 1920006248} - target: {fileID: 3389629528887116870, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} propertyPath: MaxVibration - value: 0.5 + value: 0.25 objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] diff --git a/Assets/Scripts/Enemy/EnemyPathFinding.cs b/Assets/Scripts/Enemy/EnemyPathFinding.cs index af8b395..6e124ee 100644 --- a/Assets/Scripts/Enemy/EnemyPathFinding.cs +++ b/Assets/Scripts/Enemy/EnemyPathFinding.cs @@ -27,7 +27,7 @@ public class EnemyPathFinding : MonoBehaviour private void Rumble() { - RumbleManager.StartRumble(-1, 1f, 1f, 0.5f); + RumbleManager.StartRumble(-1, 0.5f, 0.5f, 0.25f); } private void Update() diff --git a/Assets/Scripts/Player/HealthComponent.cs b/Assets/Scripts/Player/HealthComponent.cs index 25aedc0..13fb382 100644 --- a/Assets/Scripts/Player/HealthComponent.cs +++ b/Assets/Scripts/Player/HealthComponent.cs @@ -3,6 +3,7 @@ using UnityEngine.Events; using TMPro; using System; using UnityUtils; +using System.Collections; public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver { @@ -32,6 +33,27 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver void Awake() { currentHealth = maxHealth; + OnHealthChange.AddListener((_, _) => showRedTint = 1); + StartCoroutine(RedTintLoop()); + } + + float showRedTint = 0; + private IEnumerator RedTintLoop() + { + SpriteRenderer sr = GetComponentInChildren(); + while (true) + { + if (showRedTint < 0.1f) + { + yield return new WaitForSecondsRealtime(0.1f); + continue; + } + + sr.color = Color.red; + yield return new WaitForSecondsRealtime(0.1f); + sr.color = Color.white; + yield return new WaitForSecondsRealtime(0.1f); + } } void Update() diff --git a/Assets/Scripts/Rumbling/RopeRumbling.cs b/Assets/Scripts/Rumbling/RopeRumbling.cs index c0115f9..2efee39 100644 --- a/Assets/Scripts/Rumbling/RopeRumbling.cs +++ b/Assets/Scripts/Rumbling/RopeRumbling.cs @@ -27,10 +27,8 @@ public class RopeRumbling : MonoBehaviour { this.enabled = false; } - else - { - - } + + //StartCoroutine(RumbleLoop()); hasInit = true; } @@ -42,7 +40,25 @@ public class RopeRumbling : MonoBehaviour float ropeClamed = Mathf.Max(0, rope.Overshoot); float sensitive_mapped = ropeClamed.Remap(0.2f, 1f, 0f, MaxVibration); - float mapped = ropeClamed.Remap(0.9f, 1f, 0f, MaxVibration); - RumbleManager.StartRumble(-1, 0, sensitive_mapped, 0.1f); + float mapped = ropeClamed.Remap(0.5f, 1f, 0f, MaxVibration); + RumbleManager.StartRumble(-1, mapped, sensitive_mapped, 0.1f); + + //float ropeClamed = Mathf.Max(0, rope.Overshoot); + //float sensitive_mapped = ropeClamed.Remap(0.2f, 0.8f, 0f, MaxVibration); + //float mapped = ropeClamed.Remap(0.9f, 1f, 0f, MaxVibration); + //rumbleStrength = sensitive_mapped; } + + //float rumbleStrength = 0; + //private IEnumerator RumbleLoop() + //{ + // while (true) + // { + // if (rumbleStrength > 0.1f) + // { + // RumbleManager.StartRumble(-1, 0, rumbleStrength, 0.025f); + // } + // yield return new WaitForSecondsRealtime(0.2f); + // } + //} }