zwischencommit
This commit is contained in:
parent
22c5d4582e
commit
45d8263e1b
|
@ -1111,6 +1111,7 @@ MonoBehaviour:
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 1
|
eventRate: 1
|
||||||
|
_startTime: 40
|
||||||
_talk: 0
|
_talk: 0
|
||||||
_fullfillNeedManually: 0
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
|
@ -34301,6 +34302,7 @@ MonoBehaviour:
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 1
|
eventRate: 1
|
||||||
|
_startTime: 60
|
||||||
_talk: 0
|
_talk: 0
|
||||||
_fullfillNeedManually: 0
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
|
@ -46003,6 +46005,7 @@ MonoBehaviour:
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 1
|
eventRate: 1
|
||||||
|
_startTime: 30
|
||||||
_talk: 1
|
_talk: 1
|
||||||
_fullfillNeedManually: 0
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
|
@ -65138,6 +65141,7 @@ MonoBehaviour:
|
||||||
_baseDevelopementPower: 100
|
_baseDevelopementPower: 100
|
||||||
_developementPower: 100
|
_developementPower: 100
|
||||||
eventRate: 1
|
eventRate: 1
|
||||||
|
_startTime: 50
|
||||||
_talk: 0
|
_talk: 0
|
||||||
_fullfillNeedManually: 0
|
_fullfillNeedManually: 0
|
||||||
_timer: 0
|
_timer: 0
|
||||||
|
|
|
@ -13,6 +13,7 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
[SerializeField] private double _baseDevelopementPower = 100.0; // max 100, min 0
|
[SerializeField] private double _baseDevelopementPower = 100.0; // max 100, min 0
|
||||||
[SerializeField] private double _developementPower = 100.0; // max unlimited, min 0
|
[SerializeField] private double _developementPower = 100.0; // max unlimited, min 0
|
||||||
[SerializeField] double eventRate = 1.0; // max 60, min 0 -> how many events are requested per minute
|
[SerializeField] double eventRate = 1.0; // max 60, min 0 -> how many events are requested per minute
|
||||||
|
[SerializeField] private float _startTime = 30.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gibt das Koffeinlevel des Entwicklers zurück
|
/// Gibt das Koffeinlevel des Entwicklers zurück
|
||||||
|
@ -69,7 +70,7 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
_eventStack = GetComponent<NPC_EventStack>();
|
_eventStack = GetComponent<NPC_EventStack>();
|
||||||
_text2Speech = GetComponent<Text2Speech>();
|
_text2Speech = GetComponent<Text2Speech>();
|
||||||
_audioSource = GetComponent<AudioSource>();
|
_audioSource = GetComponent<AudioSource>();
|
||||||
ResetTimer();
|
ResetTimer(_startTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
|
@ -104,7 +105,7 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ResetTimer()
|
private void ResetTimer(float startTime = 0.0f)
|
||||||
{
|
{
|
||||||
if (eventRate <= 0)
|
if (eventRate <= 0)
|
||||||
{
|
{
|
||||||
|
@ -113,7 +114,14 @@ public class NPC_Behavior : MonoBehaviour
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_timeBetweenEvents = 60f / (float)eventRate;
|
_timeBetweenEvents = 60f / (float)eventRate;
|
||||||
_timer = Random.Range(0.5f * _timeBetweenEvents, 1.25f * _timeBetweenEvents);
|
if (startTime > 0)
|
||||||
|
{
|
||||||
|
_timer = startTime;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_timer = Random.Range(0.5f * _timeBetweenEvents, 1.25f * _timeBetweenEvents);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue