Ejemplo n.º 1
0
    void Update()
    {
        if (JustBorn)
        {
            InitializeNewBorn();
        }

        MostUrgentNeedByIndex = NeedsManager.FindMostUrgentNeed(this);

        StateMachineRef.Execute();
        // Set Horn Color To State Color
        AgentUtils.SetChildColor(gameObject, 0, StateMachineRef.currentState.StateColor);
    }
Ejemplo n.º 2
0
    void Awake()
    {
        SetReferences();

        // Set body color
        AgentUtils.SetChildColor(gameObject, 2, AgentColor);

        InitializeTraits();

        InitializePathfinder();

        InitializeStateMachine();
    }
Ejemplo n.º 3
0
    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;
    }