This commit is contained in:
2026-01-25 21:08:21 +01:00
parent 58119f52b9
commit 4731404294
10 changed files with 17571 additions and 28 deletions
+12 -4
View File
@@ -13,9 +13,11 @@ public class BearAwareness : MonoBehaviour
public static event Action<float> HasWokenUp;
public float timeToWakeUp = 2f;
public float timeToWakeUp = 4f;
public AudioClip Awake;
public static bool isPaused = false;
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
@@ -36,15 +38,14 @@ public class BearAwareness : MonoBehaviour
//awareness += noice;
awarenessSlider.value += noice;
if (awareness >= awarenessSlider.maxValue)
if (awarenessSlider.value >= awarenessSlider.maxValue)
{
isPaused = true;
SoundEffectManager.Play("Alert");
BackgroundManager.StopBG();
BackgroundManager.PlayBG(true,Awake);
StopAllCoroutines();
Debug.Log("Bear is awake now!");
HasWokenUp.Invoke(timeToWakeUp);
StartCoroutine(Decrease(2));
}
}
@@ -53,6 +54,13 @@ public class BearAwareness : MonoBehaviour
while (true)
{
Debug.Log(isPaused);
while (isPaused)
{
Debug.Log("Pause");
}
yield return new WaitForSeconds(delay);
awarenessSlider.value -= 2;
+3 -1
View File
@@ -95,7 +95,8 @@ public class BearIsAwake : MonoBehaviour
}
elapsed += Time.deltaTime;
}
BearAwareness.isPaused = false;
//if (Physics.Raycast(transform.position, direction, out RaycastHit hit, distance))
//{
@@ -129,6 +130,7 @@ public class BearIsAwake : MonoBehaviour
private void OnTriggerEnter(Collider other)
{
BearAwareness.isPaused = true;
SoundEffectManager.Play("Alert");
BackgroundManager.StopBG();
BackgroundManager.PlayBG(true,Awake);