/* Ici on exécute le comportement paramétré, qui lui aura un algorithme de recherche * différent prédéfini pour chaque état */ public override void Execution() { if (Comportement != null) { Comportement.Execution(); } }
/* ici on analyse si l'état du personnage convient selon ses paramètres * et on change l'état selon les conclusions, qui se chargera * de changer le comportement à associer automatiquement */ public override void AnalyserSituation() { if (Comportement != null) { Comportement.AnalyserSituation(); } }
// Update is called once per frame void Update() { comportement = Comportement.getComportement (comportementType); comportement.iapos = transform.position; if (timer == 0) { comportement.CalculateDestination (playerDestination); navAgent.SetDestination (comportement.destination); timer = comportement.timeBeforeUpdate; } timer--; }
void CheckComportement() { comportement = Comportement.getComportement (comportementType); // comportement = Comportement.getComportement (comportementType); }
/// <summary> /// Constructeur. /// </summary> /// <param name="type">Le type d'objectif.</param> /// <param name="chaineRealisation">La chaîne de comportements utilisée pour la réalisation de l'objectif.</param> public Objectif(TypeObjectif type, Comportement chaineRealisation) { this.TypeObj = type; this.RealisationObjectif = chaineRealisation; }