Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Last active June 12, 2019 20:48
Show Gist options
  • Save pr00thmatic/b7cbcee604842596f44b8911e8d54806 to your computer and use it in GitHub Desktop.
Save pr00thmatic/b7cbcee604842596f44b8911e8d54806 to your computer and use it in GitHub Desktop.
RaycastHit hitInfo;
Ray worldRay = HandleUtility.GUIPointToWorldRay(Event.current.mousePosition);
return Physics.Raycast(worldRay, out hitInfo);
if (Event.current.type == EventType.MouseDown) {
// el usuario hizo click en la escena!
GUIUtility.hotControl = GUIUtility.GetControlID(FocusType.Passive);
Event.current.Use();
// las dos líneas de código anteriores cancelan el evento.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment