Esempio n. 1
0
    //SNAP SLICE TO WALL
    void OnTriggerEnter(Collider other)
    {
        if (!isActivated)
        {
            if (other.gameObject.name == objectToSnapName)
            {
                quad             = other.gameObject;
                grabQuadScript   = quad.GetComponent <grabQuad>();
                rotateQuadScript = quad.GetComponent <rotateQuad>();

                isInsideSnapZone = true;
                isActivated      = true;
            }
        }
    }
Esempio n. 2
0
    //UNSNAP SLICE FROM WALL
    void OnTriggerExit(Collider other)
    {
        if (isActivated)
        {
            if (other.gameObject.name == objectToSnapName)
            {
                quad             = null;
                grabQuadScript   = null;
                rotateQuadScript = null;

                isInsideSnapZone = false;
                isActivated      = false;
            }
        }
    }