Home > other >  The Unity editor extension under how to monitor the position of the mouse and press
The Unity editor extension under how to monitor the position of the mouse and press

Time:09-20

Is not the Unity of the input operation, the editor, UniityEditor to here, I create a Windows panel, need to get the mouse in the above position, please ask next greatly, with which the API can be used for? Still need to use c # in attached, you just need to get to the location of the mouse on the screen to go,

CodePudding user response:

Well, I encapsulates the
https://github.com/pinzeweifen/demo/blob/master/Unity/Editor/QEditorEvent.cs
 
Public static bool IsMouseDown ()
{
Return Event. Current. Type==EventType. MouseDown;
}

Public static bool IsMouseUp ()
{
Return Event. Current. Type==EventType. MouseUp;
}

Public static bool IsMouseMove ()
{
Return Event. Current. Type==EventType. MouseMove;
}
  • Related