Build settings and animations
This commit is contained in:
parent
38c0bcaef4
commit
b95544d7cb
19 changed files with 1904 additions and 129 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue