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

Summary

This script should be attached to a GUI element that requires a dragging action (like sliders). We will denote the GUI element as 'the element'. When the cursor first clicks on the element, dragging is deactivated for the camera, so that when we move a slider we don't also move the camera.

List of Functions

Public Global Variables

void OnPointeDown(PointerEventData pointerEventData)
void OnPointerUp(PointerEventData pointerEventData)

Public Global Variables

CameraController cameraScript

Reference to the camera script so we can alter draggingActive.

void OnPointerDown(PointerEventData pointerEventData)

Sets draggingActive in CameraController.cs to false.

Called When

The mouse click button goes down over the element

void OnPointerUp(PointerEventData pointerEventData)

Sets draggingActive in CameraController.cs to true.

Called When

The mouse click button is released from the element.