private void Start() { spriteRen = GetComponent <SpriteRenderer>(); aiMovement = GetComponent <EnemyAiMovement>(); anim = GetComponent <Animator>(); enemyMelee = GetComponent <EnemyMeleeAttack>(); }
private void Awake() { var player = GameObject.FindGameObjectWithTag("PLAYER"); if (player != null) { playerTr = player.GetComponent <Transform>(); } gManager = GameObject.Find("GameManager").GetComponent <GameManager>(); enemyTr = GetComponent <Transform>(); moveAgent = GetComponent <MoveAgent>(); emAttack = GetComponent <EnemyMeleeAttack>(); uiManager = GameObject.Find("UIManager").GetComponent <UIManager>(); bManager = GameObject.FindGameObjectWithTag("BUILD").GetComponent <BuildManager>(); if (GameObject.Find("SpawnManager") != null) { sManager = GameObject.Find("SpawnManager").GetComponent <SpawnManager>(); } if (GameObject.Find("GraveSpawnManager") != null) { gsManager = GameObject.Find("GraveSpawnManager").GetComponent <GraveSpawnManager>(); } animator = GetComponent <Animator>(); wSecond = new WaitForSeconds(0.2f); }
void Start() { player = GameObject.FindGameObjectWithTag("Player"); enemyMelee = GetComponent <EnemyMeleeAttack>(); rigBody = GetComponent <Rigidbody2D>(); speedHolder = speed; }
public void Start() { currentState = States.Idle; Target = GameObject.FindWithTag("Player").transform; agent = GetComponent <NavMeshAgent>(); meleeAttack = GetComponent <EnemyMeleeAttack>(); enemyAnim = gameObject.GetComponent <Animator>(); }
private void Awake() { anim = GetComponent <Animator>(); enemyAudio = GetComponent <AudioSource>(); capsuleCollider = GetComponent <CapsuleCollider>(); enemyMeleeAttack = GetComponent <EnemyMeleeAttack>(); enemyMeleeMovement = GetComponent <EnemyMeleeMovement>(); currentHealth = startingHealth; }
private void Awake() { localAgent = this.GetComponent <NavMeshAgent>(); activePlayer = GameObject.FindGameObjectWithTag("Player"); attackScript = this.GetComponent <EnemyMeleeAttack>(); }