Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- using UnityEditor;
- [CustomEditor(typeof(SomeScriptType))]
- public class MyEditorPlayer : Editor {
- void OnSceneGUI()
- {
- int controlID = GUIUtility.GetControlID(FocusType.Passive);
- switch (Event.current.GetTypeForControl(controlID))
- {
- case EventType.mouseDown:
- GUIUtility.hotControl = controlID;
- Debug.Log("MouseDown");
- Event.current.Use();
- break;
- case EventType.MouseUp:
- GUIUtility.hotControl = 0;
- Event.current.Use();
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement