Example #1
0
    public void Take_Damage_Spear(WeaponSpear spear)
    {
        if (took_hit_invincible)
        {
            return;
        }

        spear.Fix_Spear_To(this.gameObject);
        Take_Damage(spear.damage);
    }
Example #2
0
    void OnTriggerEnter2D(Collider2D coll)
    {
        GameObject target = coll.gameObject;

        if (gameObject.tag != "DragonAttackFireball" && !lookingAt(target, this.gameObject))
        {
            return;
        }
        if (target.tag == "Arrow")
        {
            target.GetComponentInChildren <WeaponArrow>().Fix_Arrow_To(this.gameObject);
        }
        if (target.tag == "Knife")
        {
            target.GetComponentInChildren <WeaponKnife>().Fix_Knife_To(this.gameObject);
        }
        if (target.tag == "Spear" && gameObject.tag != "DragonAttackFireball")
        {
            WeaponSpear spear = target.GetComponentInChildren <WeaponSpear>();
            Debug.Log(spear);
            spear.Fix_Spear_To(this.gameObject);
        }
    }