void Start() { player = GameObject.FindGameObjectWithTag("Player").transform; playerHasMelee = player.GetComponentInChildren <PlayerTraits>().Melee; EnemyTraits traits = GetComponent <EnemyTraits>(); individualNumber = traits.IndividualNumber; hasMelee = traits.Melee; }
void Start() // Initiallizing camera, animator, rigidboy { playerTransform = GameObject.FindGameObjectWithTag("Player").transform; SetupAnimator(); rigid = GetComponent <Rigidbody>(); traits = GetComponentInChildren <EnemyTraits>(); hasMelee = traits.Melee; hasRanged = traits.Ranged; hasBlock = traits.Block; hasDash = traits.Dash; if (hasDash) { dashing = GetComponentInChildren <DashingFeature>(); } health = GetComponentInChildren <EnemyHealth>(); }
void Start() { health = GetComponentInChildren <EnemyHealth>(); traits = GetComponentInChildren <EnemyTraits>(); hasMelee = traits.Melee; hasRanged = traits.Ranged; hasBlock = traits.Block; hasDash = traits.Dash; if (hasDash) { dashing = GetComponentInChildren <DashingFeature>(); } controlManager = GetComponent <EnemyControlManager>(); player = GameObject.FindGameObjectWithTag("Player").transform; playerHealth = player.GetComponent <PlayerHealth>(); playerHasMelee = player.GetComponent <PlayerTraits>().Melee; if (playerHasMelee) { playerMeleeAttacking = player.GetComponentInChildren <MeleeAttackFeature>(); } playerHasBlock = player.GetComponent <PlayerTraits>().Block; if (playerHasBlock) { playerBlocking = player.GetComponentInChildren <BlockingFeature>(); } navAgent = GetComponent <NavMeshAgent>(); meleeRangeTracker = GetComponentInChildren <MeleeRangeTracker>(); currentState = EnemyState.Approach; }