Advertisement
Guest User

Untitled

a guest
May 27th, 2016
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using UnityEditor;
  4. [CustomEditor(typeof(SomeScriptType))]
  5. public class MyEditorPlayer : Editor {
  6.  
  7. void OnSceneGUI()
  8. {
  9. int controlID = GUIUtility.GetControlID(FocusType.Passive);
  10. switch (Event.current.GetTypeForControl(controlID))
  11. {
  12. case EventType.mouseDown:
  13. GUIUtility.hotControl = controlID;
  14. Debug.Log("MouseDown");
  15. Event.current.Use();
  16. break;
  17. case EventType.MouseUp:
  18. GUIUtility.hotControl = 0;
  19. Event.current.Use();
  20. break;
  21. }
  22. }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement