Esempio n. 1
0
 // Use this for initialization
 void Start()
 {
     navMeshAgent = GetComponent <NavMeshAgent>();
     animator     = GetComponentInChildren <Animator> ();
     attackScript = GetComponent <TrollAttack> ();
 }
Esempio n. 2
0
 void Awake()
 {
     // Setting up the references.
     anim = GetComponent<Animator>();
     animation = GetComponent<Animation>();
     enemyAudio = GetComponent<AudioSource>();
     if (typedemonstre == 3)
     {
         boss1attack = GetComponent<Boss1Attack>();
     }
     if (typedemonstre == 4)
     {
         trollAttack = GetComponent<TrollAttack>();
     }
     //hitParticles = GetComponentInChildren<ParticleSystem>();
     capsuleCollider = GetComponent<CapsuleCollider>();
     // Setting the current health when the enemy first spawns.
     currentHealth = startingHealth;
     if (typedemonstre == 4)
     {
         // Code pour empécher la répétition automatique de l'animation d'attaque
         animation["Hit"].wrapMode = WrapMode.Once;
         // Code pour empécher la répétition automatique de l'animation de saut
         animation["Die"].wrapMode = WrapMode.Once;
     }
     if (typedemonstre == 7)
     {
         // Code pour empécher la répétition automatique de l'animation d'attaque
         animation["Attack"].wrapMode = WrapMode.Once;
         // Code pour empécher la répétition automatique de l'animation de saut
         animation["Dead"].wrapMode = WrapMode.Once;
     }
 }