Esempio n. 1
0
    void OnCollisionEnter2D(Collision2D coll)
    {
        if (coll.transform.tag == "Attack")
        {
            Attack_data ad = coll.transform.GetComponent <Attack_data>();

            if (hm.transform == ad.caster.transform)
            {
                return;
            }
            player.ApplyDmg(ad.DMG(), ad.type);

            if (cc.target == null && mv.NotMoving)
            {
                cc.target = ad.caster;
            }
        }
        else if (coll.transform.tag == "SearchForPlayer")
        {
            GTarget gt = coll.transform.GetComponent <GTarget>();
            gt.SetTarget(hm.transform);
        }
    }
Esempio n. 2
0
    IEnumerator SelfDistract()
    {
        yield return(new WaitForSeconds(3));

        ad.DMG();
    }