Exemplo n.º 1
0
    public override void Action()
    {
        Automate_Habitant automate = base.automate as Automate_Habitant;

        if (automate.Target != null)
        {
            automate.Habitant.NavMeshComponent.destination = automate.Target.transform.position;
            //Si l'habitant devient trop proche de la cible, alors on change de cible
            if (Vector3.Distance(automate.Target.transform.position, automate.Habitant.transform.position) < 5)
            {
                automate.Target = null;
            }
        }
        else
        {
            automate.Target = Waypoint();
        }
    }
Exemplo n.º 2
0
 private void Start()
 {
     automate         = new Automate_Habitant(this);
     navMeshComponent = GetComponent <NavMeshAgent>();
     GenererCouleurAleatoire();
 }
Exemplo n.º 3
0
 public EtatHabitantRechercheWaypoint(Automate_Habitant automate) : base(automate)
 {
 }