-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
15fe6f8
commit a333e30
Showing
6 changed files
with
340 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using TMPro; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class DialogueManager : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private TextMeshProUGUI _content; | ||
|
||
[SerializeField] | ||
private TextMeshProUGUI _thanks; | ||
|
||
|
||
readonly private string _famousLastWords = "You spend the night sitting there with george,\n" + | ||
"observing the magnificent scenery and taking in\n" + | ||
"the cold air..breathe...it feels good to be alive."; | ||
readonly private string _themksVmro = "thanks for staying with chad"; | ||
|
||
void Start() | ||
{ | ||
StartCoroutine(TypeFamousLastWords()); | ||
} | ||
|
||
|
||
IEnumerator TypeFamousLastWords() | ||
{ | ||
yield return new WaitForSeconds(0.5f); | ||
foreach (char letter in _famousLastWords) | ||
{ | ||
_content.text += letter; | ||
yield return new WaitForSeconds(0.02f); | ||
} | ||
StartCoroutine(TypeThemksBro()); | ||
} | ||
|
||
|
||
IEnumerator TypeThemksBro() | ||
{ | ||
yield return new WaitForSeconds(0.5f); | ||
foreach (char letter in _themksVmro) | ||
{ | ||
_thanks.text += letter; | ||
yield return new WaitForSeconds(0.02f); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using TMPro; | ||
|
||
public class DialogueZoneFive : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private TextMeshProUGUI _dialogue; | ||
|
||
[SerializeField] | ||
private TextMeshProUGUI _continueButton; | ||
|
||
[SerializeField] | ||
private TextMeshProUGUI _hairaaHoonMein; | ||
|
||
private bool _continueBShow = false; | ||
|
||
[SerializeField] | ||
private PlayerZoneFive _player; | ||
|
||
[SerializeField] | ||
private string[] _convo; | ||
|
||
private int _ind = 0; | ||
|
||
|
||
private void Start() | ||
{ | ||
_player = GameObject.Find("PlayerZ5").GetComponent<PlayerZoneFive>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (_continueBShow && Input.GetKeyDown(KeyCode.Space)) | ||
{ | ||
ClickContinue(); | ||
} | ||
} | ||
|
||
public void StartDogConvo() | ||
{ | ||
StartCoroutine(TypeConvo(_convo[_ind])); | ||
} | ||
|
||
|
||
public void ShowExclamation() | ||
{ | ||
StartCoroutine(Surprised()); | ||
} | ||
|
||
IEnumerator Surprised() | ||
{ | ||
_hairaaHoonMein.text = "!!!"; | ||
yield return new WaitForSeconds(1.5f); | ||
_hairaaHoonMein.text = ""; | ||
} | ||
|
||
|
||
IEnumerator TypeConvo(string whatToType) | ||
{ | ||
yield return new WaitForSeconds(0.5f); | ||
foreach (char letter in whatToType) | ||
{ | ||
_dialogue.text += letter; | ||
yield return new WaitForSeconds(0.02f); | ||
} | ||
yield return new WaitForSeconds(0.05f); | ||
_continueButton.text = "press space to continue"; | ||
_continueBShow = true; | ||
} | ||
|
||
public void ClickContinue() | ||
{ | ||
_continueButton.text = ""; | ||
_continueBShow = false; | ||
_dialogue.text = ""; | ||
if (_ind < 2) | ||
{ | ||
_ind++; | ||
StartCoroutine(TypeConvo(_convo[_ind])); | ||
} | ||
else | ||
{ | ||
_player.LastRites(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class PlayerZoneFive : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private Image blackk; | ||
[SerializeField] | ||
private Animator animm; | ||
|
||
private Player _player; | ||
|
||
private bool _initialDone = false; | ||
|
||
[SerializeField] | ||
private DialogueZoneFive _dialogueManager; | ||
|
||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
_player = GetComponent<Player>(); | ||
_dialogueManager = GameObject.Find("DialogueZ5").GetComponent<DialogueZoneFive>(); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
if (!_initialDone && transform.position.y < _player.floorYCord) | ||
{ | ||
transform.Translate(Vector3.up * 2.5f * Time.deltaTime); | ||
} | ||
else if (!_initialDone) | ||
{ | ||
_initialDone = true; | ||
_dialogueManager.ShowExclamation(); | ||
SetMovementTrue(); | ||
} | ||
} | ||
|
||
|
||
private void OnTriggerEnter2D(Collider2D other) | ||
{ | ||
if (other.tag is "kutta") | ||
{ | ||
_player.playerMovement = false; | ||
_dialogueManager.StartDogConvo(); | ||
} | ||
} | ||
|
||
|
||
public void SetMovementTrue() | ||
{ | ||
_player.playerMovement = true; | ||
} | ||
|
||
public void LastRites() | ||
{ | ||
StartCoroutine(Fading()); | ||
} | ||
|
||
IEnumerator Fading() | ||
{ | ||
yield return new WaitForSeconds(1.5f); | ||
animm.SetBool("Fade", true); | ||
yield return new WaitUntil(() => blackk.color.a == 1); | ||
SceneManager.LoadScene("HappyEnding"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,73 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using TMPro; | ||
|
||
public class DialogueZoneFour : MonoBehaviour | ||
{ | ||
// Start is called before the first frame update | ||
void Start() | ||
[SerializeField] | ||
private TextMeshProUGUI _dialogue; | ||
|
||
[SerializeField] | ||
private TextMeshProUGUI _continueButton; | ||
|
||
private bool _continueBShow = false; | ||
|
||
[SerializeField] | ||
private PlayerZoneFour _player; | ||
|
||
[SerializeField] | ||
private string[] _convo; | ||
|
||
private int _ind = 0; | ||
|
||
|
||
private void Start() | ||
{ | ||
_player = GameObject.Find("PlayerZ4").GetComponent<PlayerZoneFour>(); | ||
} | ||
|
||
private void Update() | ||
{ | ||
if (_continueBShow && Input.GetKeyDown(KeyCode.Space)) | ||
{ | ||
ClickContinue(); | ||
} | ||
} | ||
|
||
public void StartDogConvo() | ||
{ | ||
StartCoroutine(TypeConvo(_convo[_ind])); | ||
} | ||
|
||
|
||
IEnumerator TypeConvo(string whatToType) | ||
{ | ||
|
||
yield return new WaitForSeconds(0.5f); | ||
foreach (char letter in whatToType) | ||
{ | ||
_dialogue.text += letter; | ||
yield return new WaitForSeconds(0.02f); | ||
} | ||
yield return new WaitForSeconds(0.05f); | ||
_continueButton.text = "press space to continue"; | ||
_continueBShow = true; | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
public void ClickContinue() | ||
{ | ||
|
||
_continueButton.text = ""; | ||
_continueBShow = false; | ||
_dialogue.text = ""; | ||
if (_ind < 0) | ||
{ | ||
_ind++; | ||
StartCoroutine(TypeConvo(_convo[_ind])); | ||
} | ||
else | ||
{ | ||
_player.SetMovementTrue(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,84 @@ | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using UnityEngine; | ||
using UnityEngine.UI; | ||
using UnityEngine.SceneManagement; | ||
|
||
public class PlayerZoneFour : MonoBehaviour | ||
{ | ||
[SerializeField] | ||
private Image blackk; | ||
[SerializeField] | ||
private Animator animm; | ||
|
||
private Player _player; | ||
|
||
[SerializeField] | ||
private GameObject _dogCollar; | ||
|
||
private bool _initialDone = false; | ||
private bool _dogChat = false; | ||
|
||
[SerializeField] | ||
private DialogueZoneFour _dialogueManager; | ||
|
||
|
||
// Start is called before the first frame update | ||
void Start() | ||
{ | ||
|
||
_player = GetComponent<Player>(); | ||
_dialogueManager = GameObject.Find("DialogueZ4").GetComponent<DialogueZoneFour>(); | ||
} | ||
|
||
// Update is called once per frame | ||
void Update() | ||
{ | ||
|
||
if (!_initialDone && transform.position.x < -8) | ||
{ | ||
transform.Translate(Vector3.right * 2.5f * Time.deltaTime); | ||
} | ||
else if (!_initialDone) | ||
{ | ||
_initialDone = true; | ||
SetMovementTrue(); | ||
} | ||
|
||
// stairs thing | ||
if (transform.position.x > 8.27f) | ||
{ | ||
_player.playerMovement = false; | ||
transform.Translate(Vector3.up * 6f * Time.deltaTime); | ||
} | ||
} | ||
|
||
|
||
private void OnTriggerEnter2D(Collider2D other) | ||
{ | ||
if (!_dogChat && other.tag is "hint6") | ||
{ | ||
_player.playerMovement = false; | ||
_dogChat = true; | ||
_dogCollar.transform.position = new Vector3(0, 3.95f, 0); | ||
_dogCollar.transform.localScale = new Vector3(5, 5, 0); | ||
_dialogueManager.StartDogConvo(); | ||
} | ||
|
||
if (other.tag is "nextScene") | ||
{ | ||
StartCoroutine(Fading()); | ||
} | ||
} | ||
|
||
|
||
public void SetMovementTrue() | ||
{ | ||
_player.playerMovement = true; | ||
} | ||
|
||
IEnumerator Fading() | ||
{ | ||
animm.SetBool("Fade", true); | ||
yield return new WaitUntil(() => blackk.color.a == 1); | ||
SceneManager.LoadScene("ZoneFive"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters