//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; } } }
//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; } } }