void Start() { currentHP = MAX_HP; rangedAttack = GetComponent <EnemyRangedAttack>(); rb = GetComponent <Rigidbody2D>(); player = GameObject.FindGameObjectWithTag("Player"); slimeMove = GetComponent <SlimeMovement>(); enemyMove = GetComponent <EnemyMovement>(); }
// Use this for initialization void Start() { thePlayerTracker = FindObjectOfType <PlayerPathTracker>(); enemyObject = this.gameObject.transform.parent.gameObject; rangedAttack = enemyObject.GetComponent <EnemyRangedAttack>(); // stillOutOfSight is created to not have the player going back and forth when in range but player out of sight between enemies path and players path stillOutOfSight = false; }
// Use this for initialization void Start() { this.gameObject.name = "Thomas"; enemyObject = this.gameObject; engageWithPlayerObject = this.gameObject.transform.GetChild(0).gameObject; enemyHealthMan = enemyObject.GetComponent <EnemyHealthManager>(); // enemyStaminaMan = enemyObject.GetComponent<EnemyStaminaManager>(); playerEngagement = engageWithPlayerObject.GetComponent <EngagedWithPlayer>(); stalkZoneObject = this.gameObject.transform.GetChild(7).gameObject; stalkZone = stalkZoneObject.GetComponent <RecognizeStalkZone>(); rangedAttack = enemyObject.GetComponent <EnemyRangedAttack>(); playerHealthMan = FindObjectOfType <PlayerHealthManager>(); playerStaminaMan = FindObjectOfType <PlayerStaminaManager>(); playerHealth = FindObjectOfType <PlayerHealthManager>(); hurtPlayer = FindObjectOfType <HurtPlayerUpdated>(); randomMove = FindObjectOfType <RandomMovement>(); //this needs to grab child object script //playerEngagement = FindObjectOfType<EngagedWithPlayer>(); playerObject = GameObject.Find("Player"); thePlayer = playerObject.GetComponent <PlayerController>(); target = playerObject; dodgeCounter = 2.2f; tellCounter = 0.5f; actionTimer = 0.2f; enemyHurtCounter = 2; myRigidbody = GetComponent <Rigidbody2D>(); anim = GetComponent <Animator>(); if (!enemyExists) { enemyExists = true; //DontDestroyOnLoad(transform.gameObject); } else { //Destroy(gameObject); } // dodging = true; // dodgeFirstTime = true; //For now enemy will always have a correct line of sight and the fleeing system is not yet set up. fleeTwo = false; dodgingThree = false; followToDeath = false; }
private void Awake() { //finding the coordinates of the player playerTransform = GameObject.FindGameObjectWithTag("Player").transform; player = GameObject.FindGameObjectWithTag("Player"); playerStats = player.GetComponent <PlayerStats>(); enemyRangedAttack = GetComponent <EnemyRangedAttack>(); enemyStats = GetComponent <EnemyStats>(); nav = GetComponent <NavMeshAgent>(); nav.stoppingDistance = enemyRangedAttack.range; }
// Use this for initialization void Start() { hurtPlayer = FindObjectOfType <HurtPlayerUpdated>(); playerStaminaMan = FindObjectOfType <PlayerStaminaManager>(); thePlayer = FindObjectOfType <PlayerController>(); sfxMan = FindObjectOfType <SFXManager>(); shield = FindObjectOfType <ShieldBlock>(); thePS = FindObjectOfType <PlayerStats>(); enemyGameObject = this.gameObject.transform.parent.gameObject; enemy = enemyGameObject.GetComponent <EnemyTestScript>(); rangedEnemy = enemyGameObject.GetComponent <BasicRangedEnemy>(); enemyMaster = enemyGameObject.GetComponent <EnemyMasterScript>(); enemyTransform = enemyGameObject.transform; rangedAttack = enemyGameObject.GetComponent <EnemyRangedAttack>(); playerHealth = FindObjectOfType <PlayerHealthManager>(); hurtEnemy = FindObjectOfType <HurtEnemy>(); playerShield = FindObjectOfType <ShieldBlock>(); hitPoint = GameObject.Find("Player").transform; bloodCounter = 10; deathStrike = false; thePlayerDeathStrike = false; playerStaminaDrain = false; faceOff = false; check = 0; beforeRecov = true; enemyAttackCounter = 1f; enemyDamagePossible = false; preAttack = false; recovAttack = false; preAttackCounter = 0.6f; recovAttackCounter = 0.3f; enemyAttackCounter = 0.06f; freezeFrame = 1f; }
public virtual void Attack() { EnemyRangedAttack attack = Instantiate(attackPrefab); attack.PositionAttack(this.gameObject, objective); }
private void Awake() { instance = this; }