Example #1
0
    //

    //public Animator animator;

    void Start()
    {
        currentHealth   = maxHealth;
        skeleton        = GetComponentInParent <Transform>();
        enemy_behaviour = GetComponentInParent <Enemy_behaviour_1>();
        trigArea        = trigCheck.GetComponent <TriggerAreaCheck1>();
    }
Example #2
0
 void Start()
 {
     AS                = transform.GetComponent <AudioSource>();
     staggered         = false;
     rigidbody         = GetComponent <Rigidbody2D>();
     currentHealth     = maxHealth;
     camScript         = GameObject.Find("Main Camera").GetComponent <CameraScript>();
     enemy_behaviour   = skele.GetComponent <Enemy_behaviour>();
     enemy_behaviour_1 = bigSkele.GetComponent <Enemy_behaviour_1>();
     enemyHealth       = skele.GetComponentInChildren <EnemyHealth>();
     //bandit = GameObject.Find("Bandit1").GetComponent<BanditBehaviour>();
     playerMoves = transform.GetComponent <PlayerMovement>();
 }
Example #3
0
 void OnTriggerEnter2D(Collider2D trig)
 {
     if (trig.gameObject.tag == "Enemy_weapon")
     {
         enemy_behaviour   = trig.gameObject.GetComponentInParent <Enemy_behaviour>();
         enemyAttackDamage = enemy_behaviour.attackDamage;
         TakeDamage(enemyAttackDamage);
     }
     else if (trig.gameObject.tag == "Enemy_weapon1")
     {
         enemy_behaviour_1 = trig.gameObject.GetComponentInParent <Enemy_behaviour_1>();
         enemyAttackDamage = enemy_behaviour_1.attackDamage;
         TakeDamage(enemyAttackDamage);
     }
 }
Example #4
0
 private void Awake()
 {
     enemyParent = GetComponentInParent <Enemy_behaviour_1>();
     enemyHealth = GameObject.Find("BigFSkeleton/skeleton1_collider").GetComponent <EnemyHealth1>();
     anim        = GetComponentInParent <Animator>();
 }
 private void Awake()
 {
     enemyParent = GetComponentInParent <Enemy_behaviour_1>();
 }