Im bouta fall asleep!!!

This commit is contained in:
BOT Alex 2024-02-04 10:24:38 +01:00
parent 7bdd06ab2a
commit f54efe80be
4 changed files with 47 additions and 9 deletions

View File

@ -675,7 +675,7 @@ PrefabInstance:
objectReference: {fileID: 1920006248} objectReference: {fileID: 1920006248}
- target: {fileID: 5108819328747686001, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - target: {fileID: 5108819328747686001, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: MaxVibration propertyPath: MaxVibration
value: 0.5 value: 0.25
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5150961666696654592, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3} - target: {fileID: 5150961666696654592, guid: 30e0cc55a67f02d4f92b2677ec4b1511, type: 3}
propertyPath: Volume propertyPath: Volume
@ -1281,7 +1281,7 @@ PrefabInstance:
objectReference: {fileID: 1920006248} objectReference: {fileID: 1920006248}
- target: {fileID: 3389629528887116870, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3} - target: {fileID: 3389629528887116870, guid: 99a6ff8b9591949439b620b13bd249a4, type: 3}
propertyPath: MaxVibration propertyPath: MaxVibration
value: 0.5 value: 0.25
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_RemovedGameObjects: [] m_RemovedGameObjects: []

View File

@ -27,7 +27,7 @@ public class EnemyPathFinding : MonoBehaviour
private void Rumble() private void Rumble()
{ {
RumbleManager.StartRumble(-1, 1f, 1f, 0.5f); RumbleManager.StartRumble(-1, 0.5f, 0.5f, 0.25f);
} }
private void Update() private void Update()

View File

@ -3,6 +3,7 @@ using UnityEngine.Events;
using TMPro; using TMPro;
using System; using System;
using UnityUtils; using UnityUtils;
using System.Collections;
public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
{ {
@ -32,6 +33,27 @@ public class HealthComponent : MonoBehaviour, ISquezeDamageReceiver
void Awake() void Awake()
{ {
currentHealth = maxHealth; currentHealth = maxHealth;
OnHealthChange.AddListener((_, _) => showRedTint = 1);
StartCoroutine(RedTintLoop());
}
float showRedTint = 0;
private IEnumerator RedTintLoop()
{
SpriteRenderer sr = GetComponentInChildren<SpriteRenderer>();
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() void Update()

View File

@ -27,10 +27,8 @@ public class RopeRumbling : MonoBehaviour
{ {
this.enabled = false; this.enabled = false;
} }
else
{ //StartCoroutine(RumbleLoop());
}
hasInit = true; hasInit = true;
} }
@ -42,7 +40,25 @@ public class RopeRumbling : MonoBehaviour
float ropeClamed = Mathf.Max(0, rope.Overshoot); float ropeClamed = Mathf.Max(0, rope.Overshoot);
float sensitive_mapped = ropeClamed.Remap(0.2f, 1f, 0f, MaxVibration); float sensitive_mapped = ropeClamed.Remap(0.2f, 1f, 0f, MaxVibration);
float mapped = ropeClamed.Remap(0.9f, 1f, 0f, MaxVibration); float mapped = ropeClamed.Remap(0.5f, 1f, 0f, MaxVibration);
RumbleManager.StartRumble(-1, 0, sensitive_mapped, 0.1f); 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);
// }
//}
} }