Detect Mouse Up In Edit Mode

How can I determine if the left mouse button is not being pressed in a script that executes in edit mode?

It took a while to find this because I did not know what to Google.

using UnityEditor;

[CustomEditor(typeof(anchorTool))]
class anchorToolEditor : Editor {
	void OnSceneGUI() {
		if (Event.current.type == EventType.MouseUp && Event.current.button == 0) {
			anchorTool myTarget = (anchorTool)target;
		}
	}
}

Import UnityEditor and set the script type to Editor, this will allow OnSceneGUI to run in edit mode. [CustomEditor(typeof(anchorTool))] will only run this script when an object with the script “anchorTool” attached is selected and myTarget will be the instance of the “anchorTool” script that is attached to the currently selected object.

This script must be in a folder named “Editor” in the root of your “Assets” directory.