Add speech management
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public enum QuestionAnswer
|
||||
@@ -6,4 +8,44 @@ namespace DefaultNamespace
|
||||
NO,
|
||||
NO_YES,
|
||||
}
|
||||
|
||||
public static class QuestionAnswerExtensions
|
||||
{
|
||||
public static string ToRandomString(this QuestionAnswer answer)
|
||||
{
|
||||
string[] options = answer switch
|
||||
{
|
||||
QuestionAnswer.YES => new[]
|
||||
{
|
||||
"Yes",
|
||||
"Absolutely",
|
||||
"Affirmative",
|
||||
"Definitely",
|
||||
"Of course",
|
||||
"Sure",
|
||||
},
|
||||
|
||||
QuestionAnswer.NO => new[]
|
||||
{
|
||||
"No",
|
||||
"Absolutely not",
|
||||
"Negative",
|
||||
"Definitely not",
|
||||
"Nope",
|
||||
"Not at all",
|
||||
},
|
||||
|
||||
QuestionAnswer.NO_YES => new[]
|
||||
{
|
||||
"I cannot answer that question",
|
||||
"I'm not sure",
|
||||
"I don't know",
|
||||
},
|
||||
|
||||
_ => new[] { answer.ToString() }
|
||||
};
|
||||
|
||||
return options[Random.Range(0, options.Length)];
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user