コード例 #1
0
        public void RestoreState(object state)
        {
            BodyRecord body = (BodyRecord)state;

            calorieManager = body.manager;
            modifiedStats  = body.stats;
            bodyUpdated.Invoke();
        }
コード例 #2
0
        // 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) };
        }
コード例 #3
0
    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);
    }
コード例 #4
0
 void Start()
 {
     CM = GameObject.Find("CalorieManager").GetComponent <CalorieManager>();
 }