Merge remote-tracking branch 'origin/main'

This commit is contained in:
Florian 2025-06-18 11:42:02 +02:00
commit 177586801c
7 changed files with 1603 additions and 21 deletions

BIN
blender/Models/Fox_Walking.blend (Stored with Git LFS)

Binary file not shown.

BIN
blender/Models/Fox_Walking.fbx (Stored with Git LFS) Normal file

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: bed5a0c285f984a5e99a8d69bc2bab91
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,18 @@
using UnityEngine;
using UnityEngine.SceneManagement;
public class MainMenu : MonoBehaviour
{
public void StartGame()
{
Debug.Log("Start Game");
// Load the first scene (assuming it's named "GameScene")
SceneManager.LoadScene("Beach");
}
public void QuitGame()
{
Debug.Log("Quit Game");
Application.Quit();
}
}

View File

@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: bfd1564be9e1f46fc80749ae2e20f617

View File

@ -1,46 +1,43 @@
using System.Collections;
using UnityEngine;
using TMPro;
using UnityEngine.UI;
using UnityEngine.UIElements;
using UnityEngine;
using Event = AK.Wwise.Event;
public class DialogManager : MonoBehaviour
{
public GameObject dialogPanel;
public TextMeshProUGUI dialogText; // Use TextMeshProUGUI instead of Text
public PlayerMovement playerMovement;
[SerializeField] private AK.Wwise.Event TypeSound;
[SerializeField] private Event TypeSound;
private Coroutine dialogCoroutine;
private void Start()
{
dialogPanel.SetActive(false); // Hide on start
}
Coroutine dialogCoroutine = null;
public void ShowDialog(string message)
{
print("should be showing dialog");
if (dialogCoroutine != null)
{
StopCoroutine(dialogCoroutine);
}
if (dialogCoroutine != null) StopCoroutine(dialogCoroutine);
dialogCoroutine = StartCoroutine(ShowDialogCoroutine(message));
dialogPanel.SetActive(true);
playerMovement.moveAllowed = false;
}
// Coroutine to show dialog. Each letter is displayed one by one
// Coroutine to show dialog. Each letter is displayed one by one
IEnumerator ShowDialogCoroutine(string message)
private IEnumerator ShowDialogCoroutine(string message)
{
dialogText.text = ""; // Clear previous text
dialogPanel.SetActive(true);
playerMovement.moveAllowed = false;
int letterCount = 0;
int nextSoundTrigger = Random.Range(2, 5); // Random between 2 and 5 inclusive
var letterCount = 0;
var nextSoundTrigger = Random.Range(3, 8); // Random between 2 and 5 inclusive
foreach (char letter in message)
foreach (var letter in message)
{
dialogText.text += letter;
letterCount++;
@ -49,21 +46,19 @@ public class DialogManager : MonoBehaviour
{
TypeSound.Post(gameObject);
letterCount = 0;
nextSoundTrigger = Random.Range(2, 5); // Choose new interval
nextSoundTrigger = Random.Range(3, 8); // Choose new interval
}
yield return new WaitForSeconds(0.05f);
yield return new WaitForSeconds(0.02f);
}
dialogCoroutine = null;
}
public void HideDialog()
{
dialogPanel.SetActive(false);
playerMovement.moveAllowed = true;
}
}
}