public void RestoreState(object state) { BodyRecord body = (BodyRecord)state; calorieManager = body.manager; modifiedStats = body.stats; bodyUpdated.Invoke(); }
// GUID key to appearance stat record // [System.Serializable] // private struct FollowerSetup // { // public BaseStats charClass; // public CalorieManager calorieManager; // public AppearanceStats appearance; // public PersonalityStats personality; // public InternalStats internalStats; // public FollowerPositions position; // } private void Awake() { calorieManager = new CalorieManager(); modifiedStats = new Dictionary <FeedeeStat, float[]>(); modifiedStats[FeedeeStat.Capacity] = new float[] { 0, Random.Range(-100, 200) }; modifiedStats[FeedeeStat.Greed] = new float[] { 0, Random.Range(0, 20) }; modifiedStats[FeedeeStat.FatDesire] = new float[] { 0, Random.Range(0, 20) }; modifiedStats[FeedeeStat.Metabolism] = new float[] { 0, Random.Range(0, 300) }; }
const float kcalPerSec = 0.07583f; // 몸무게 : 60kg, 자전거무게 : 10kg, 평균속도 12.9km/h 기준 void Awake() { if (instance == null) { instance = this; } else if (instance != this) { Destroy(gameObject); } DontDestroyOnLoad(gameObject); }
void Start() { CM = GameObject.Find("CalorieManager").GetComponent <CalorieManager>(); }