Reworked the dialogue system

Now the dialogue can use tags to add special effects
Reorganized project structure, updating may require adding some using statements
This commit is contained in:
Gerard Gascón 2022-09-15 17:27:28 +02:00 committed by GitHub
parent 95bad523b9
commit 0e8b8b1835
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 1912 additions and 1266 deletions

View file

@ -75,7 +75,7 @@ namespace SimpleTools.Timer{
}
/// <summary>
/// Pause and sets the time to the default one
/// Pause and sets the time to the defaultOne
/// </summary>
public void ResetTimer(){
isPaused = true;

View file

@ -5,32 +5,32 @@ using System;
using TMPro;
namespace SimpleTools.Timer{
public static class TimerUtility {
/// <summary>
/// Setup the timer
/// </summary>
/// <param name="container">TMPro object that will contain the timer</param>
/// <param name="timerType">What type of timer will it be (Countdown, Stopwatch, Clock)</param>
/// <param name="countdownTime">The time that will have in case it is a countdown timer</param>
/// <returns></returns>
public static Timer SetupTimer(this TMP_Text container, TimerType timerType, TimerUpdate timerUpdate, float countdownTime = 60f){
Timer t = container.gameObject.AddComponent<Timer>();
float elapsedTime = 0f;
string text = string.Empty;
TimeSpan timePlaying = TimeSpan.Zero;
public static class TimerUtility {
/// <summary>
/// Setup the timer
/// </summary>
/// <param name="container">TMPro object that will contain the timer</param>
/// <param name="timerType">What type of timer will it be (Countdown, Stopwatch, Clock)</param>
/// <param name="countdownTime">The time that will have in case it is a countdown timer</param>
/// <returns></returns>
public static Timer SetupTimer(this TMP_Text container, TimerType timerType, TimerUpdate timerUpdate, float countdownTime = 60f){
Timer t = container.gameObject.AddComponent<Timer>();
float elapsedTime = 0f;
string text = string.Empty;
TimeSpan timePlaying = TimeSpan.Zero;
switch (timerType){
case TimerType.Countdown:
elapsedTime = countdownTime;
timePlaying = TimeSpan.FromSeconds(elapsedTime);
text = timePlaying.ToString("m':'ss'.'ff");
break;
case TimerType.Clock:
text = DateTime.Now.ToString("HH:mm:ss");
break;
}
t.Setup(elapsedTime, true, timePlaying, container, timerType, timerUpdate, text);
case TimerType.Countdown:
elapsedTime = countdownTime;
timePlaying = TimeSpan.FromSeconds(elapsedTime);
text = timePlaying.ToString("m':'ss'.'ff");
break;
case TimerType.Clock:
text = DateTime.Now.ToString("HH:mm:ss");
break;
}
t.Setup(elapsedTime, true, timePlaying, container, timerType, timerUpdate, text);
return t;
}
}
return t;
}
}
}