Example #1
0
    void OnTriggerStay2D(Collider2D coll)
    {
        GameObject target = coll.gameObject;

        if (target.tag == "Spear")
        {
            WeaponSpear spear = target.GetComponentInChildren <WeaponSpear> ();
            if (Is_Harmful_Spear(spear))
            {
                spear.Stop();
                Divide_Asteroid();
            }
        }
    }
Example #2
0
    public override void OnTriggerEnter2D(Collider2D coll)
    {
        GameObject target = coll.gameObject;

        if (target.tag == "Spear")
        {
            WeaponSpear spear = target.GetComponentInChildren <WeaponSpear> ();
            if (Is_Harmful_Spear(spear))
            {
                spear.Stop();
                Divide_Asteroid();
            }
        }
        if (target.tag == "Player")
        {
            Register_Hit(target);
        }
    }