Build settings and animations
This commit is contained in:
parent
38c0bcaef4
commit
b95544d7cb
19 changed files with 1904 additions and 129 deletions
|
@ -1,10 +1,20 @@
|
|||
using System;
|
||||
using Audio;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
namespace Flow {
|
||||
public class MainMenu : MonoBehaviour {
|
||||
private void Start() {
|
||||
AudioManager.instance.Play("Musica");
|
||||
}
|
||||
|
||||
public void LoadGame() {
|
||||
SceneManager.LoadScene(sceneBuildIndex: 1);
|
||||
}
|
||||
|
||||
public void QuitGame() {
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,5 @@
|
|||
using System.Text.RegularExpressions;
|
||||
using Audio;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -24,6 +25,7 @@ namespace Messaging.Composer {
|
|||
private readonly Regex _removeRegex = new(@"<([a-z]+)(?![^>]*\/>)[^>]*>(?!.*<([a-z]+)(?![^>]*\/>)[^>]*>)");
|
||||
|
||||
public void WriteEmoji(string emoji) {
|
||||
AudioManager.instance.PlayOneShot("click");
|
||||
if (GetRemainingIcons() <= 0) return;
|
||||
|
||||
_iconsWritten++;
|
||||
|
@ -34,6 +36,7 @@ namespace Messaging.Composer {
|
|||
private int GetRemainingIcons() => _numberIcons - _iconsWritten;
|
||||
|
||||
public void RemoveEmoji() {
|
||||
AudioManager.instance.PlayOneShot("borrar");
|
||||
string newText = _removeRegex.Replace(fieldText.text, "");
|
||||
if (newText != fieldText.text) {
|
||||
_iconsWritten--;
|
||||
|
|
|
@ -4,6 +4,7 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
using Audio;
|
||||
using Flow;
|
||||
using Messaging.Composer;
|
||||
using UnityEngine;
|
||||
|
@ -50,6 +51,7 @@ namespace Messaging {
|
|||
_sendButton.Unlock();
|
||||
|
||||
_currentJoke = GetRandomJoke();
|
||||
AudioManager.instance.PlayOneShot("recibir_mensaje");
|
||||
CreateMessage(_currentJoke.QuestionMessage.Key, false);
|
||||
_emojiButtonManager.SetButtonImages(GenerateButtonOptions());
|
||||
}
|
||||
|
@ -61,6 +63,7 @@ namespace Messaging {
|
|||
_sendButton.Unlock();
|
||||
|
||||
_currentJoke = GetRandomJoke();
|
||||
AudioManager.instance.PlayOneShot("recibir_mensaje");
|
||||
CreateMessage(_currentJoke.QuestionMessage.Key, false);
|
||||
_emojiButtonManager.SetButtonImages(GenerateButtonOptions());
|
||||
}
|
||||
|
@ -72,23 +75,24 @@ namespace Messaging {
|
|||
_currentJokeIndex = Mathf.Max(_currentJokeIndex, 0);
|
||||
if (message == _currentJoke.AnswerMessage.Key) {
|
||||
_sendButton.Lock();
|
||||
bool isCorrect = _currentJokeIndex != 0;
|
||||
|
||||
if (isCorrect) {
|
||||
if (FindObjectOfType<ProgressBar>().AddProgress())
|
||||
return;
|
||||
}
|
||||
AudioManager.instance.Play("correcto");
|
||||
if (FindObjectOfType<ProgressBar>().AddProgress())
|
||||
return;
|
||||
|
||||
Coroutine routine = StartCoroutine(ShowRealTexts(isCorrect));
|
||||
Coroutine routine = StartCoroutine(ShowRealTexts(true));
|
||||
StartCoroutine(SendRandomJoke(routine, sendJokeDelay));
|
||||
_lives.ResetLives();
|
||||
} else {
|
||||
_lives.Wrong();
|
||||
if (_lives.CurrentLives == 0) {
|
||||
AudioManager.instance.Play("3fallos");
|
||||
_sendButton.Lock();
|
||||
Coroutine routine = StartCoroutine(ShowRealTexts(false));
|
||||
StartCoroutine(SendRandomJoke(routine, initialSendJokeDelay));
|
||||
_lives.ResetLives();
|
||||
} else {
|
||||
AudioManager.instance.Play("zumbido");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using Audio;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
|
@ -23,6 +24,7 @@ namespace Messaging.Typer {
|
|||
while (true) {
|
||||
if (ShouldShowNextCharacter(timeOfLastCharacter)) {
|
||||
if (_textBox.maxVisibleCharacters <= _textBox.textInfo.characterCount) {
|
||||
AudioManager.instance.PlayOneShot("escribir");
|
||||
_textBox.maxVisibleCharacters++;
|
||||
if (_textBox.text[_textBox.maxVisibleCharacters - 1] == ' ') {
|
||||
_textBox.maxVisibleCharacters++;
|
||||
|
|
13
Assets/Scripts/Utilities/HoverClickSound.cs
Normal file
13
Assets/Scripts/Utilities/HoverClickSound.cs
Normal file
|
@ -0,0 +1,13 @@
|
|||
using Audio;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class HoverClickSound : MonoBehaviour, IPointerEnterHandler, IPointerClickHandler {
|
||||
public void OnPointerEnter(PointerEventData eventData) {
|
||||
AudioManager.instance.PlayOneShot("hover");
|
||||
}
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData) {
|
||||
AudioManager.instance.PlayOneShot("click");
|
||||
}
|
||||
}
|
11
Assets/Scripts/Utilities/HoverClickSound.cs.meta
Normal file
11
Assets/Scripts/Utilities/HoverClickSound.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7c108da9c1667e843b2c2776e187057e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Add table
Add a link
Reference in a new issue