Exemple #1
0
 void AnalyseSight()
 {
     foreach (GameObject obj in los.sighted)
     {
         if (obj.GetComponent <Bone>() != null)
         {
             //target = los.sighted[i];
             //targetType = btargetType.Viande;
             //sawSomething = true;
             tasks.Push(new Task((int)DogTask.Eat, obj));
         }
         else if (CurrentTask.id == (int)DogTask.WanderInFront && obj.CompareTag("Player"))
         {
             tasks.Push(new Task((int)DogTask.ChaseAndBark, obj));
         }
         else
         {
             Bush buisson = obj.GetComponent <Bush>();
             if (buisson != null && buisson.IsMoving())
             {
                 tasks.Push(new Task((int)DogTask.ChaseAndBark, obj));
                 //target = los.sighted[i];
                 //targetType = btargetType.Buisson;
                 //sawSomething = true;
             }
         }
     }
 }