void UpdateReproductiveMultiplier() { ReproductiveClock += Time.deltaTime; if (ReproductiveClock <= AgentsSharedParameters.ReproductiveRecoveryTime) { ReproductiveMultiplier = AgentUtils.Remap(ReproductiveClock, 0f, AgentsSharedParameters.ReproductiveRecoveryTime, 0f, 1f); } }
public int FindMostUrgentNeed(Agent agent) { int index = NULLNEED; // Remap Values float rmpFood = AgentUtils.Remap(agent.Food, 0f, agent.AgentsSharedParameters.MaxFood, 0f, 1f); float rmpEnergy = AgentUtils.Remap(agent.Energy, 0f, agent.AgentsSharedParameters.MaxEnergy, 0f, 1f); float rmpAge = AgentUtils.Remap(agent.CurrentAge, 0f, agent.MaxAge, 0f, 1f); //FoodNeedOverride = ValidateOverride(foodToHunger, rmpFood); // Evaluate Need Curves NeedsValues[HUNGRY] = foodToHunger.Evaluate(rmpFood) * OverrideNeed(FoodNeedOverride); NeedsValues[TIRED] = energyToTiredness.Evaluate(rmpEnergy); NeedsValues[WORK] = energyToReadyness.Evaluate(rmpEnergy) * OverrideNeed(WorkNeedOverride); NeedsValues[HORNY] = agent.ReproductiveMultiplier * ageToHorney.Evaluate(rmpAge); //find Biggest Value float mostUrgent = 0f; int i = 0; foreach (float need in NeedsValues) { if (need > mostUrgent) { mostUrgent = need; index = i; } i++; } return(index); }
void UpdateFoodBar() { float mapedBar = AgentUtils.Remap(FoodValue, 0f, MaxFood, 0f, 1f); _foodBar.GetComponent <RectTransform>().SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, mapedBar); }
public void UpdateBar() { float mapedBar = AgentUtils.Remap(BarValue.Value, MinValue, MaxValue, 0f, 120f); this._rect.SetSizeWithCurrentAnchors(RectTransform.Axis.Horizontal, mapedBar); }