Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
177586801c
BIN
blender/Models/Fox_Walking.blend
(Stored with Git LFS)
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
BIN
blender/Models/Fox_Walking.fbx
(Stored with Git LFS)
Normal file
Binary file not shown.
1557
blueberryPeak/Assets/Scenes/MainMenu.unity
Normal file
1557
blueberryPeak/Assets/Scenes/MainMenu.unity
Normal file
File diff suppressed because it is too large
Load Diff
7
blueberryPeak/Assets/Scenes/MainMenu.unity.meta
Normal file
7
blueberryPeak/Assets/Scenes/MainMenu.unity.meta
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bed5a0c285f984a5e99a8d69bc2bab91
|
||||||
|
DefaultImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
18
blueberryPeak/Assets/Scripts/Helper/MainMenu.cs
Normal file
18
blueberryPeak/Assets/Scripts/Helper/MainMenu.cs
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
2
blueberryPeak/Assets/Scripts/Helper/MainMenu.cs.meta
Normal file
2
blueberryPeak/Assets/Scripts/Helper/MainMenu.cs.meta
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: bfd1564be9e1f46fc80749ae2e20f617
|
@ -1,46 +1,43 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
using UnityEngine;
|
|
||||||
using TMPro;
|
using TMPro;
|
||||||
using UnityEngine.UI;
|
using UnityEngine;
|
||||||
using UnityEngine.UIElements;
|
using Event = AK.Wwise.Event;
|
||||||
|
|
||||||
public class DialogManager : MonoBehaviour
|
public class DialogManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public GameObject dialogPanel;
|
public GameObject dialogPanel;
|
||||||
public TextMeshProUGUI dialogText; // Use TextMeshProUGUI instead of Text
|
public TextMeshProUGUI dialogText; // Use TextMeshProUGUI instead of Text
|
||||||
public PlayerMovement playerMovement;
|
public PlayerMovement playerMovement;
|
||||||
[SerializeField] private AK.Wwise.Event TypeSound;
|
[SerializeField] private Event TypeSound;
|
||||||
|
|
||||||
|
private Coroutine dialogCoroutine;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
dialogPanel.SetActive(false); // Hide on start
|
dialogPanel.SetActive(false); // Hide on start
|
||||||
}
|
}
|
||||||
|
|
||||||
Coroutine dialogCoroutine = null;
|
|
||||||
public void ShowDialog(string message)
|
public void ShowDialog(string message)
|
||||||
{
|
{
|
||||||
print("should be showing dialog");
|
print("should be showing dialog");
|
||||||
if (dialogCoroutine != null)
|
if (dialogCoroutine != null) StopCoroutine(dialogCoroutine);
|
||||||
{
|
|
||||||
StopCoroutine(dialogCoroutine);
|
|
||||||
}
|
|
||||||
dialogCoroutine = StartCoroutine(ShowDialogCoroutine(message));
|
dialogCoroutine = StartCoroutine(ShowDialogCoroutine(message));
|
||||||
dialogPanel.SetActive(true);
|
dialogPanel.SetActive(true);
|
||||||
playerMovement.moveAllowed = false;
|
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
|
||||||
// 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
|
dialogText.text = ""; // Clear previous text
|
||||||
dialogPanel.SetActive(true);
|
dialogPanel.SetActive(true);
|
||||||
playerMovement.moveAllowed = false;
|
playerMovement.moveAllowed = false;
|
||||||
|
|
||||||
int letterCount = 0;
|
var letterCount = 0;
|
||||||
int nextSoundTrigger = Random.Range(2, 5); // Random between 2 and 5 inclusive
|
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;
|
dialogText.text += letter;
|
||||||
letterCount++;
|
letterCount++;
|
||||||
@ -49,21 +46,19 @@ public class DialogManager : MonoBehaviour
|
|||||||
{
|
{
|
||||||
TypeSound.Post(gameObject);
|
TypeSound.Post(gameObject);
|
||||||
letterCount = 0;
|
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;
|
dialogCoroutine = null;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void HideDialog()
|
public void HideDialog()
|
||||||
{
|
{
|
||||||
dialogPanel.SetActive(false);
|
dialogPanel.SetActive(false);
|
||||||
playerMovement.moveAllowed = true;
|
playerMovement.moveAllowed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user