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 GetStats() { return new Dictionary { { "Caffine", _caffeine_level }, { "Hunger", _hunger_level }, { "Happiness", _happiness_level }, { "Developement Power", _developement_power } }; } public void SetStats(Dictionary 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; } } } }