示例#1
0
        void Start()
        {
            _NodeOccupied = false;

            // Base Stats
            hunger = 100;
            thirst = 100;
            energy = 100;

            // Timer
            timePerTick = 5;

            //timer = GetComponent<TimerNew>();
            //timer.tick.AddListener(updateStats);

            tempUState = new UStates();
            stateListSetup();
        }
示例#2
0
        private void stateListSetup()
        {
            float tempUVal;

            // change state values into percentages to be used with the public curves

            uValueHunger = hunger / 100;
            uValueThirst = thirst / 100;
            uValueEnergy = energy / 100;

            // find the value of the state value as set of the curve

            // Hunger
            tempUVal = HungerRate.Evaluate(uValueHunger);
            tempUVal = Mathf.Clamp(tempUVal, 0.0f, 1.0f);
            tempUState.currentState = states.Hungry;
            tempUState.utilityValue = (1 * (tempUVal * 10));
            stateValue.Add(tempUState);

            tempUState = new UStates();

            // Thirst
            tempUVal = ThirstRate.Evaluate(uValueThirst);
            tempUVal = Mathf.Clamp(tempUVal, 0.0f, 1.0f);
            tempUState.currentState = states.Thirsty;
            tempUState.utilityValue = (1 * (tempUVal * 10));
            stateValue.Add(tempUState);
            tempUState = new UStates();

            // Energy
            tempUVal = TirednessRate.Evaluate(uValueEnergy);
            tempUVal = Mathf.Clamp(tempUVal, 0.0f, 1.0f);
            tempUState.currentState = states.Tried;
            tempUState.utilityValue = (1 * (tempUVal * 10));
            stateValue.Add(tempUState);

            tempUState = new UStates();
        }