Added first NPC Scripts
This commit is contained in:
parent
e550f67842
commit
4da9e345d9
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4ac77a83fb60e1b43a2a8b9d22d07e93
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -0,0 +1,59 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class NPC_Behavior : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private double _caffeine_level = 0.0; // max 100
|
||||
[SerializeField] private double _hunger_level = 0.0; // max 100
|
||||
[SerializeField] private double _happiness_level = 100.0; // max 100
|
||||
[SerializeField] private double _developement_power = 100.0; // max unlimited
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Dictionary<string, double> GetStats()
|
||||
{
|
||||
return new Dictionary<string, double>
|
||||
{
|
||||
{ "Caffine", _caffeine_level },
|
||||
{ "Hunger", _hunger_level },
|
||||
{ "Happiness", _happiness_level },
|
||||
{ "Developement Power", _developement_power }
|
||||
};
|
||||
}
|
||||
|
||||
public void SetStats(Dictionary<string, double> stats)
|
||||
{
|
||||
foreach (string key in stats.Keys)
|
||||
{
|
||||
switch (key)
|
||||
{
|
||||
case "Caffine":
|
||||
_caffeine_level = stats[key];
|
||||
break;
|
||||
case "Hunger":
|
||||
_hunger_level = stats[key];
|
||||
break;
|
||||
case "Happiness":
|
||||
_happiness_level = stats[key];
|
||||
break;
|
||||
case "Developement Power":
|
||||
_developement_power = stats[key];
|
||||
break;
|
||||
default:
|
||||
Debug.LogError("Unknown Stat/Key");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 707d39e7a8ed7a44a8341ead8ee2a9ad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in New Issue