Devs sprechen jetzt wenn sie was wollen
This commit is contained in:
@ -6,10 +6,12 @@ public class DeveloperNeeds : MonoBehaviour
|
||||
{
|
||||
[SerializeField] List<GameObject> Needs = new List<GameObject>();
|
||||
|
||||
private Text2Speech _text2speech;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
_text2speech = GetComponent<Text2Speech>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
@ -22,20 +24,25 @@ public class DeveloperNeeds : MonoBehaviour
|
||||
{
|
||||
|
||||
GameObject spawnedNeed = null;
|
||||
string context = "";
|
||||
|
||||
switch (needName)
|
||||
{
|
||||
case "coffee":
|
||||
spawnedNeed = Instantiate(Needs[0], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
||||
spawnedNeed = Instantiate(Needs[0], new Vector3(0.0f, 2f, 0.0f), Needs[0].transform.rotation);
|
||||
context = "Office, The NPC wants coffee";
|
||||
break;
|
||||
case "mate":
|
||||
spawnedNeed = Instantiate(Needs[1], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
||||
spawnedNeed = Instantiate(Needs[1], new Vector3(0.0f, 2f, 0.0f), Needs[0].transform.rotation);
|
||||
context = "Office, The NPC wants a Club Mate";
|
||||
break;
|
||||
case "toilet":
|
||||
spawnedNeed = Instantiate(Needs[2], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
||||
spawnedNeed = Instantiate(Needs[2], new Vector3(0.0f, 2f, 0.0f), Needs[0].transform.rotation);
|
||||
context = "Office, The NPC wants to go to the toilet, toilet is clogged and dirty";
|
||||
break;
|
||||
case "money":
|
||||
spawnedNeed = Instantiate(Needs[3], new Vector3(0.0f, 1.5f, 0.0f), Needs[0].transform.rotation);
|
||||
spawnedNeed = Instantiate(Needs[3], new Vector3(0.0f, 2f, 0.0f), Needs[0].transform.rotation);
|
||||
context = "Office, The NPC wants a raise, The NPC needs more money";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -44,6 +51,8 @@ public class DeveloperNeeds : MonoBehaviour
|
||||
if (spawnedNeed != null)
|
||||
{
|
||||
spawnedNeed.transform.SetParent(transform, false);
|
||||
spawnedNeed.transform.localScale = new Vector3(0.4f, 0.01f, 0.4f);
|
||||
_text2speech.Generate(context);
|
||||
return spawnedNeed;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user