Fix World Camera

This commit is contained in:
2022-08-20 15:38:13 -07:00
parent 15a7e16650
commit 349c4dc4b6
26 changed files with 4085 additions and 2158 deletions

View File

@@ -7,8 +7,7 @@ namespace Scampz.GameJam
{
[TextArea(3, 10)]
public string[] Sentences;
[SerializeField]
public SFXClip SoundEffect;
public float TextSpeed;
}
}

View File

@@ -16,11 +16,6 @@ namespace Scampz.GameJam
private Animator _animator;
[SerializeField]
private TextMeshProUGUI _dialogueTextGUI;
[SerializeField]
private float _defaultTextSpeed = 0.1f;
private float _currentTextSpeed;
private Queue<string> sentences;
@@ -48,8 +43,6 @@ namespace Scampz.GameJam
{
if (IsTalking && Input.GetButtonDown(InputOptions.Cancel))
EndDialogue();
_currentTextSpeed = _defaultTextSpeed;
}
public void StartDialogue(Dialogue dialogue)
@@ -93,10 +86,12 @@ namespace Scampz.GameJam
{
_dialogueTextGUI.text += letter;
yield return null;
yield return new WaitForSeconds(_currentTextSpeed);
yield return new WaitForSeconds(dialogue.TextSpeed);
}
yield return new WaitForSeconds(1f);
yield return null;
SFXManager.Instance.StopSoundEffect();
yield return new WaitForSeconds(0.3f);
yield return new WaitForKeyDown(InputOptions.Submit);
SFXManager.Instance.PlaySoundEffect(SoundEffectName.Ok);
DisplayNextSentence(dialogue);
@@ -104,6 +99,7 @@ namespace Scampz.GameJam
private void EndDialogue()
{
StopAllCoroutines();
_animator.SetBool("IsOpen", false);
_dialogueTextGUI.text = string.Empty;
IsTalking = false;