void Update() { if (JustBorn) { InitializeNewBorn(); } MostUrgentNeedByIndex = NeedsManager.FindMostUrgentNeed(this); StateMachineRef.Execute(); // Set Horn Color To State Color AgentUtils.SetChildColor(gameObject, 0, StateMachineRef.currentState.StateColor); }
void Awake() { SetReferences(); // Set body color AgentUtils.SetChildColor(gameObject, 2, AgentColor); InitializeTraits(); InitializePathfinder(); InitializeStateMachine(); }
void InitializeNewBorn() { MaxAge = Traits[0]; ReproductiveUrge = Traits[1]; FoodConsumption = Traits[2]; EnergyConsumption = Traits[3]; WorkingSpeed = Traits[4]; Size = Traits[5]; // Apply Agent Body Color AgentUtils.SetChildColor(gameObject, 2, AgentColor); Energy = 90f; Food = 20f; CurrentAge = 0f; ReproductiveMultiplier = 0f; NeedsManager.NeedsValues[HORNY] = 0f; JustBorn = false; }