// 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); } }
// 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>(); }
// Use this for initialization void Start() { hp = GetComponent <HealthScript>(); shoot = GetComponent <enemyShoot>(); }
// 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; }
void Start() { agent = GetComponent <NavMeshAgent> (); target = GameObject.Find("Player").transform; enemyShoot = GetComponent <enemyShoot>(); }