Exemple #1
0
    private void Update()
    {
        if (dead)
        {
            return;
        }
        if (gameObject.CompareTag("Preview"))
        {
            return;
        }

        UnitActions.Move(this);
        UpdateMovingAnimation();
        UnitActions.UpdateIsSwimming(this);

        updateCounter = (updateCounter + 1) % GameManager.gameManager.countsBetweenUpdates;
        if (updateCounter == 0)
        {
            UnitActions.SetThought(this);
            //UnitActions.WanderIfDeadTarget(this);
            UnitActions.HungerEffect(this);
            UnitActions.ThirstEffect(this);
            UnitActions.TurnHungryChance(this);
            UnitActions.TurnThirstyChance(this);
            UnitActions.TurnHornyChance(this);
            UnitActions.HealthRegenEffect(this);
            unitState = UnitStateMachine.NextState(this);
        }
    }