Zwischencommit 2

This commit is contained in:
2024-04-05 18:11:26 +02:00
parent 540c761433
commit b7375f945f
5 changed files with 132 additions and 14 deletions

View File

@ -36,7 +36,11 @@ public class NPC_Behavior : MonoBehaviour
public double DevelopmentPower => _developementPower;
private GameManager _gameManager;
private NPC_EventStack _eventStack;
private Text2Speech _text2Speech;
private AudioSource _audioSource;
[SerializeField] private bool _talk = false;
[SerializeField] private bool _fullfillNeedManually = false;
[SerializeField] private float _timer;
[SerializeField] private float _newNeedDelay = 3.0f;
@ -62,6 +66,9 @@ public class NPC_Behavior : MonoBehaviour
{
_gameManager = GameManager.Instance;
_developerNeeds = GetComponent<DeveloperNeeds>();
_eventStack = GetComponent<NPC_EventStack>();
_text2Speech = GetComponent<Text2Speech>();
_audioSource = GetComponent<AudioSource>();
ResetTimer();
}
@ -90,6 +97,11 @@ public class NPC_Behavior : MonoBehaviour
_fullfillNeedManually = false;
NeedFullfilled();
}
if (_talk)
{
_talk = false;
Talk();
}
}
private void ResetTimer()
@ -192,4 +204,13 @@ public class NPC_Behavior : MonoBehaviour
}
}
}
public void Talk()
{
//if (!_audioSource.isPlaying)
//{
string context = _eventStack.GetEntireContext();
_text2Speech.Generate(context);
//}
}
}