Ejemplo n.º 1
0
    void OnTriggerEnter2D(Collider2D otherCollider)
    {
        // Is this a robot?
        mineralScript mineral = otherCollider.gameObject.GetComponent <mineralScript>();

        if (mineral != null)
        {
            mineral.isPickUp       = 2;
            rob.transform.position = startpos.transform.position;
            rob.directionType      = 2;
        }
    }
Ejemplo n.º 2
0
    void OnTriggerEnter2D(Collider2D otherCollider)
    {
        ShotScript shot = otherCollider.gameObject.GetComponent <ShotScript>();

        if (shot != null)
        {
            SpecialEffectsHelper.Instance.Explosion(transform.position);
            Destroy(shot.gameObject);
        }

        stoneScript   stone = otherCollider.gameObject.GetComponent <stoneScript> ();
        mineralScript mine  = otherCollider.gameObject.GetComponent <mineralScript> ();

        if (stone != null)
        {
            this.rigidbody2D.isKinematic = true;
        }
        if (mine != null)
        {
            this.rigidbody2D.isKinematic = true;
        }
    }