Esempio n. 1
0
    void OnTriggerStay2D(Collider2D coll)
    {
        ZoneBound bound = coll.transform.GetComponent <ZoneBound>();

        if (bound && bound.m_collider != m_currentZone)
        {
            m_camera.m_currentBounds = bound.m_collider;
            m_currentZone            = bound.m_collider;
            ZoneBound.CurrentZone    = bound;
            GameManager.instance.NewZone();
        }
    }
Esempio n. 2
0
File: Dog.cs Progetto: VFGF/LD40
    void OnTriggerExit2D(Collider2D coll)
    {
        ZoneBound bound = coll.transform.GetComponent <ZoneBound>();

        if (bound)
        {
            if (bound == m_zone)
            {
                Destroy(gameObject);
            }
        }
    }
Esempio n. 3
0
    void OnTriggerStay2D(Collider2D coll)
    {
        if (!isTreasure || zone != -1)
        {
            return;
        }
        ZoneBound bound = coll.transform.GetComponent <ZoneBound>();

        if (bound)
        {
            int.TryParse("" + bound.gameObject.transform.name[4], out zone);
            print("The treasure has appeared in zone " + zone);
        }
    }