Inheritance: MonoBehaviour
    // Start is called before the first frame update
    void Start()
    {
        shoot = GetComponent <enemyShoot>(); //Asignamos a la variable los scripts antes mencionados
        move  = GetComponent <enemyAI>();

        CurrentHealthPoints = EnemyMaxHealthPoints; //Pone la vida al máximo al empezar
        isFullHealth        = true;

        if (enemyHealthUI)
        {
            enemyHealthUI.SetEnemyMaxHealthUI(EnemyMaxHealthPoints);
        }
    }
Beispiel #2
0
    // Use this for initialization

    protected virtual void Awake()
    {
        m_healthController = GetComponent <enemyHealth> ();
        m_sightController  = GetComponent <enemySight> ();
        m_shootController  = GetComponent <enemyShoot> ();

        player       = GameObject.FindGameObjectWithTag("Player");
        anim         = GetComponent <Animator>();
        audios       = GetComponents <AudioSource> ();
        detectSource = audios [0];
        hitSource    = audios [1];
        if (audios.Length == 3)
        {
            shootsound = audios [2];
        }
    }
 private void Start()
 {
     AiPath     = GetComponent <AIPath>();
     EnemyShoot = GetComponent <enemyShoot>();
 }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     hp    = GetComponent <HealthScript>();
     shoot = GetComponent <enemyShoot>();
 }
Beispiel #5
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     boss                = GameObject.FindGameObjectWithTag("Boss");
     shootScript         = boss.GetComponent <enemyShoot>();
     shootScript.enabled = true;
 }
Beispiel #6
0
 void Start()
 {
     agent      = GetComponent <NavMeshAgent> ();
     target     = GameObject.Find("Player").transform;
     enemyShoot = GetComponent <enemyShoot>();
 }