DeactivateZooming.cs - MitchOSully/Visualising-the-DFN-Dataset GitHub Wiki

Summary

This script should be attached to a GUI element that requires a scrolling action (e.g. the Info Panel). We will denote the GUI element as 'the element'. When the cursor hovers over the element, zooming is deactivated for the camera, so that when we scroll in the element we don't also move the camera.

List of Functions

Public Global Variables

void OnPointerEnter(PointerEventData pointerEventData)
void OnPointerExit(PointerEventData pointerEventData)

Public Global Variables

CameraController cameraScript

Reference to the camera script so we can alter zoomingActive.

void OnPointerEnter(PointerEventData pointerEventData)

Sets zoomingActive in CameraController.cs to false.

Called When

The cursor first moves over the element.

void OnPointerExit(PointerEventData pointerEventData)

Sets zoomingActive in CameraController.cs to true.

Called When

The cursor first moves off the element.