Add mountain level, fix dialogue close box animation

This commit is contained in:
2022-08-19 23:30:56 -07:00
parent 18b93ea3cd
commit 7f5e517fa4
20 changed files with 3907 additions and 11071 deletions

View File

@@ -5,20 +5,18 @@ namespace Scampz.GameJam.Assets.Scripts
public class ActivateCamera : MonoBehaviour
{
[SerializeField]
private Camera _mainCamera;
[SerializeField]
private Camera _backgroundCamera;
private Camera[] cameras;
private void OnTriggerEnter(Collider collider)
{
var cameras = FindObjectsOfType<Camera>();
foreach (var camera in cameras)
camera.enabled = false;
var allCamerasInCurrentScene = FindObjectsOfType<Camera>();
foreach (var sceneCamera in allCamerasInCurrentScene)
sceneCamera.enabled = false;
if (collider.CompareTag("Player"))
{
_mainCamera.enabled = true;
_backgroundCamera.enabled = true;
foreach (var camera in cameras)
camera.enabled = true;
}
}
}

View File

@@ -16,7 +16,10 @@ namespace Scampz.GameJam
[SerializeField]
private TextMeshProUGUI dialogueTextGUI;
[SerializeField]
private float _textSpeed = 0.1f;
private float _defaultTextSpeed = 0.1f;
private float _currentTextSpeed;
private Queue<string> sentences;
@@ -44,6 +47,8 @@ namespace Scampz.GameJam
{
if (IsTalking && Input.GetButtonDown(InputOptions.Cancel))
EndDialogue();
_currentTextSpeed = _defaultTextSpeed;
}
public void StartDialogue(Dialogue dialogue)
@@ -62,6 +67,7 @@ namespace Scampz.GameJam
if (!sentences.Any())
{
EndDialogue();
StopAllCoroutines();
return;
}
@@ -80,14 +86,13 @@ namespace Scampz.GameJam
{
dialogueTextGUI.text += letter;
yield return null;
yield return new WaitForSecondsRealtime(_textSpeed);
yield return new WaitForSeconds(_currentTextSpeed);
}
yield return new WaitForSecondsRealtime(1f);
yield return new WaitForSeconds(1f);
SFXManager.Instance.StopSoundEffect();
yield return new WaitForKeyDown(InputOptions.Submit);
SFXManager.Instance.PlaySoundEffect(SoundEffectName.Ok);
yield return new WaitForSeconds(0.5f);
DisplayNextSentence();
}