Zwischencommit 2
This commit is contained in:
parent
540c761433
commit
b7375f945f
|
@ -1066,6 +1066,9 @@ PrefabInstance:
|
||||||
- targetCorrespondingSourceObject: {fileID: 6540681369557983152, guid: d77999c19b7f3294599d4029e5b08ace, type: 3}
|
- targetCorrespondingSourceObject: {fileID: 6540681369557983152, guid: d77999c19b7f3294599d4029e5b08ace, type: 3}
|
||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 30470410}
|
addedObject: {fileID: 30470410}
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 6540681369557983152, guid: d77999c19b7f3294599d4029e5b08ace, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 30470414}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: d77999c19b7f3294599d4029e5b08ace, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: d77999c19b7f3294599d4029e5b08ace, type: 3}
|
||||||
--- !u!4 &30470408 stripped
|
--- !u!4 &30470408 stripped
|
||||||
Transform:
|
Transform:
|
||||||
|
@ -1107,8 +1110,9 @@ MonoBehaviour:
|
||||||
_happinessLevel: 100
|
_happinessLevel: 100
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 2
|
eventRate: 1
|
||||||
_deleteManually: 0
|
_talk: 0
|
||||||
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
_newNeedDelay: 3
|
_newNeedDelay: 3
|
||||||
_lastTenNeeds: []
|
_lastTenNeeds: []
|
||||||
|
@ -1226,6 +1230,21 @@ AudioSource:
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!114 &30470414
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 21686472}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a5cc0d7ecd7b47f48b2444cff2eb207d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_eventStack:
|
||||||
|
- What a great day to develope a game!
|
||||||
|
_maxStackHeight: 5
|
||||||
--- !u!1 &33191261
|
--- !u!1 &33191261
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -16403,6 +16422,9 @@ PrefabInstance:
|
||||||
- targetCorrespondingSourceObject: {fileID: 6839065564630337043, guid: 950f64c9c1d51e14b84b4e4d4a7b775a, type: 3}
|
- targetCorrespondingSourceObject: {fileID: 6839065564630337043, guid: 950f64c9c1d51e14b84b4e4d4a7b775a, type: 3}
|
||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 1077881944}
|
addedObject: {fileID: 1077881944}
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 6839065564630337043, guid: 950f64c9c1d51e14b84b4e4d4a7b775a, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 1077881948}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 950f64c9c1d51e14b84b4e4d4a7b775a, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 950f64c9c1d51e14b84b4e4d4a7b775a, type: 3}
|
||||||
--- !u!4 &523081034 stripped
|
--- !u!4 &523081034 stripped
|
||||||
Transform:
|
Transform:
|
||||||
|
@ -34278,8 +34300,9 @@ MonoBehaviour:
|
||||||
_happinessLevel: 100
|
_happinessLevel: 100
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 2
|
eventRate: 1
|
||||||
_deleteManually: 0
|
_talk: 0
|
||||||
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
_newNeedDelay: 3
|
_newNeedDelay: 3
|
||||||
_lastTenNeeds: []
|
_lastTenNeeds: []
|
||||||
|
@ -34397,6 +34420,21 @@ AudioSource:
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!114 &1077881948
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1077881942}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a5cc0d7ecd7b47f48b2444cff2eb207d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_eventStack:
|
||||||
|
- What a great day to develope a game!
|
||||||
|
_maxStackHeight: 5
|
||||||
--- !u!1 &1083890274
|
--- !u!1 &1083890274
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -45807,6 +45845,9 @@ PrefabInstance:
|
||||||
- targetCorrespondingSourceObject: {fileID: 5436741564957258347, guid: 6c7f06c6a702d4d41bba4b5576adc82c, type: 3}
|
- targetCorrespondingSourceObject: {fileID: 5436741564957258347, guid: 6c7f06c6a702d4d41bba4b5576adc82c, type: 3}
|
||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 1502578690}
|
addedObject: {fileID: 1502578690}
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 5436741564957258347, guid: 6c7f06c6a702d4d41bba4b5576adc82c, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 1502578692}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 6c7f06c6a702d4d41bba4b5576adc82c, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 6c7f06c6a702d4d41bba4b5576adc82c, type: 3}
|
||||||
--- !u!4 &1502578684 stripped
|
--- !u!4 &1502578684 stripped
|
||||||
Transform:
|
Transform:
|
||||||
|
@ -45961,12 +46002,30 @@ MonoBehaviour:
|
||||||
_happinessLevel: 100
|
_happinessLevel: 100
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 2
|
eventRate: 1
|
||||||
_deleteManually: 0
|
_talk: 1
|
||||||
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
_newNeedDelay: 3
|
_newNeedDelay: 3
|
||||||
_lastTenNeeds: []
|
_lastTenNeeds: []
|
||||||
HasNeed: 0
|
HasNeed: 0
|
||||||
|
--- !u!114 &1502578692
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 615669723}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a5cc0d7ecd7b47f48b2444cff2eb207d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_eventStack:
|
||||||
|
- Bugs
|
||||||
|
- Struggle
|
||||||
|
- Questioning life
|
||||||
|
_maxStackHeight: 5
|
||||||
--- !u!1001 &1502597417
|
--- !u!1001 &1502597417
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
@ -65034,6 +65093,9 @@ PrefabInstance:
|
||||||
- targetCorrespondingSourceObject: {fileID: 360020996318003118, guid: c161c997c07308740af96a685231f764, type: 3}
|
- targetCorrespondingSourceObject: {fileID: 360020996318003118, guid: c161c997c07308740af96a685231f764, type: 3}
|
||||||
insertIndex: -1
|
insertIndex: -1
|
||||||
addedObject: {fileID: 2100999000}
|
addedObject: {fileID: 2100999000}
|
||||||
|
- targetCorrespondingSourceObject: {fileID: 360020996318003118, guid: c161c997c07308740af96a685231f764, type: 3}
|
||||||
|
insertIndex: -1
|
||||||
|
addedObject: {fileID: 2100999004}
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: c161c997c07308740af96a685231f764, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: c161c997c07308740af96a685231f764, type: 3}
|
||||||
--- !u!4 &2100998998 stripped
|
--- !u!4 &2100998998 stripped
|
||||||
Transform:
|
Transform:
|
||||||
|
@ -65075,8 +65137,9 @@ MonoBehaviour:
|
||||||
_happinessLevel: 100
|
_happinessLevel: 100
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 2
|
eventRate: 1
|
||||||
_deleteManually: 0
|
_talk: 0
|
||||||
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
_newNeedDelay: 3
|
_newNeedDelay: 3
|
||||||
_lastTenNeeds: []
|
_lastTenNeeds: []
|
||||||
|
@ -65194,6 +65257,21 @@ AudioSource:
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
|
--- !u!114 &2100999004
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 997355948}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: a5cc0d7ecd7b47f48b2444cff2eb207d, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
_eventStack:
|
||||||
|
- What a great day to develope a game!
|
||||||
|
_maxStackHeight: 5
|
||||||
--- !u!1 &2101876026
|
--- !u!1 &2101876026
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
@ -7,11 +7,13 @@ public class DeveloperNeeds : MonoBehaviour
|
||||||
[SerializeField] List<GameObject> Needs = new List<GameObject>();
|
[SerializeField] List<GameObject> Needs = new List<GameObject>();
|
||||||
|
|
||||||
private Text2Speech _text2speech;
|
private Text2Speech _text2speech;
|
||||||
|
private AudioSource _audioSource;
|
||||||
|
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
_text2speech = GetComponent<Text2Speech>();
|
_text2speech = GetComponent<Text2Speech>();
|
||||||
|
_audioSource = GetComponent<AudioSource>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -30,19 +32,19 @@ public class DeveloperNeeds : MonoBehaviour
|
||||||
{
|
{
|
||||||
case "coffee":
|
case "coffee":
|
||||||
spawnedNeed = Instantiate(Needs[0], new Vector3(0.0f, 2f, 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";
|
context = "The NPC wants coffee";
|
||||||
break;
|
break;
|
||||||
case "mate":
|
case "mate":
|
||||||
spawnedNeed = Instantiate(Needs[1], new Vector3(0.0f, 2f, 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";
|
context = "The NPC wants a Club Mate";
|
||||||
break;
|
break;
|
||||||
case "toilet":
|
case "toilet":
|
||||||
spawnedNeed = Instantiate(Needs[2], new Vector3(0.0f, 2f, 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";
|
context = "The NPC wants to go to the toilet, toilet is clogged and dirty";
|
||||||
break;
|
break;
|
||||||
case "money":
|
case "money":
|
||||||
spawnedNeed = Instantiate(Needs[3], new Vector3(0.0f, 2f, 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";
|
context = "The NPC wants a raise, The NPC needs more money";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
@ -52,7 +54,10 @@ public class DeveloperNeeds : MonoBehaviour
|
||||||
{
|
{
|
||||||
spawnedNeed.transform.SetParent(transform, false);
|
spawnedNeed.transform.SetParent(transform, false);
|
||||||
spawnedNeed.transform.localScale = new Vector3(0.4f, 0.01f, 0.4f);
|
spawnedNeed.transform.localScale = new Vector3(0.4f, 0.01f, 0.4f);
|
||||||
|
if (!_audioSource.isPlaying)
|
||||||
|
{
|
||||||
_text2speech.Generate(context);
|
_text2speech.Generate(context);
|
||||||
|
}
|
||||||
return spawnedNeed;
|
return spawnedNeed;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -36,7 +36,11 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
public double DevelopmentPower => _developementPower;
|
public double DevelopmentPower => _developementPower;
|
||||||
|
|
||||||
private GameManager _gameManager;
|
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 bool _fullfillNeedManually = false;
|
||||||
[SerializeField] private float _timer;
|
[SerializeField] private float _timer;
|
||||||
[SerializeField] private float _newNeedDelay = 3.0f;
|
[SerializeField] private float _newNeedDelay = 3.0f;
|
||||||
|
@ -62,6 +66,9 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
{
|
{
|
||||||
_gameManager = GameManager.Instance;
|
_gameManager = GameManager.Instance;
|
||||||
_developerNeeds = GetComponent<DeveloperNeeds>();
|
_developerNeeds = GetComponent<DeveloperNeeds>();
|
||||||
|
_eventStack = GetComponent<NPC_EventStack>();
|
||||||
|
_text2Speech = GetComponent<Text2Speech>();
|
||||||
|
_audioSource = GetComponent<AudioSource>();
|
||||||
ResetTimer();
|
ResetTimer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,6 +97,11 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
_fullfillNeedManually = false;
|
_fullfillNeedManually = false;
|
||||||
NeedFullfilled();
|
NeedFullfilled();
|
||||||
}
|
}
|
||||||
|
if (_talk)
|
||||||
|
{
|
||||||
|
_talk = false;
|
||||||
|
Talk();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetTimer()
|
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);
|
||||||
|
//}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,6 +7,8 @@ public class NPC_EventStack : MonoBehaviour
|
||||||
[SerializeField] private List<string> _eventStack = new List<string>() { "What a great day to develope a game!" };
|
[SerializeField] private List<string> _eventStack = new List<string>() { "What a great day to develope a game!" };
|
||||||
[SerializeField] private int _maxStackHeight = 5;
|
[SerializeField] private int _maxStackHeight = 5;
|
||||||
|
|
||||||
|
private Text2Speech _text2speech;
|
||||||
|
|
||||||
public void AddNewContext(string context)
|
public void AddNewContext(string context)
|
||||||
{
|
{
|
||||||
_eventStack.Add(context);
|
_eventStack.Add(context);
|
||||||
|
@ -34,4 +36,16 @@ public class NPC_EventStack : MonoBehaviour
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void GenerateVoice()
|
||||||
|
{
|
||||||
|
if ( _eventStack.Count == 0 )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_text2speech.Generate(GetEntireContext());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ public class Text2Speech : MonoBehaviour
|
||||||
private OpenAIAPI _openAiApi;
|
private OpenAIAPI _openAiApi;
|
||||||
private Conversation? _conversation;
|
private Conversation? _conversation;
|
||||||
private readonly string _openAiApiKey = "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";
|
private readonly string _openAiApiKey = "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";
|
||||||
private readonly string _prompt = "Write a short text for an NPC in a game. The NPC works at a small gamedevelopement office and his Manager is called Gottfried. The text should be based on the following bullet-point context, which describes the events of the last moments. Remember to only respond with the short text that the ONE NPC should speak! The context is: ";
|
private readonly string _prompt = "Write a short text for an NPC in a game. The NPC works at a small gamedevelopement office and its manager is called Gottfried who is responsable for all the NPCs needs. The text should be based on the following bullet-point context, which describes the events of the last moments. Remember to only respond with the short text that only this ONE NPC should speak and nothing else! The context is: ";
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue