OVROverlayEditor.GetCursorPoints(UnityEngine.Rect, UnityEngine.Rect, out UnityEngine.Vector2, out UnityEngine.Vector2, out UnityEngine.Vector2, out UnityEngine.Vector2)

Here are the examples of the csharp api OVROverlayEditor.GetCursorPoints(UnityEngine.Rect, UnityEngine.Rect, out UnityEngine.Vector2, out UnityEngine.Vector2, out UnityEngine.Vector2, out UnityEngine.Vector2) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

19 View Source File : OVROverlayEditor.cs
License : MIT License
Project Creator : IanPhilips

private void CreateCursorRects(Rect drawRect, Rect selectRect)
	{
		Vector2 leftPos, rightPos, topPos, bottomPos;
		GetCursorPoints(drawRect, selectRect, out leftPos, out rightPos, out topPos, out bottomPos);

		EditorGUIUtility.AddCursorRect(new Rect(leftPos - 5 * Vector2.one, 10 * Vector2.one), MouseCursor.ResizeHorizontal);
		EditorGUIUtility.AddCursorRect(new Rect(rightPos - 5 * Vector2.one, 10 * Vector2.one), MouseCursor.ResizeHorizontal);
		EditorGUIUtility.AddCursorRect(new Rect(topPos - 5 * Vector2.one, 10 * Vector2.one), MouseCursor.ResizeVertical);
		EditorGUIUtility.AddCursorRect(new Rect(bottomPos - 5 * Vector2.one, 10 * Vector2.one), MouseCursor.ResizeVertical);
	}

19 View Source File : OVROverlayEditor.cs
License : MIT License
Project Creator : IanPhilips

private bool IsOverRectControls(Rect drawRect, Vector2 mousePos, Rect selectRect, ref Side side)
	{
		Vector2 leftPos, rightPos, topPos, bottomPos;
		GetCursorPoints(drawRect, selectRect, out leftPos, out rightPos, out topPos, out bottomPos);

		if ((leftPos - mousePos).sqrMagnitude <= 25)
		{
			side = Side.Left;
			return true;
		}
		if ((rightPos - mousePos).sqrMagnitude <= 25)
		{
			side = Side.Right;
			return true;
		}
		if ((topPos - mousePos).sqrMagnitude <= 25)
		{
			side = Side.Top;
			return true;
		}
		if ((bottomPos - mousePos).sqrMagnitude <= 25)
		{
			side = Side.Bottom;
			return true;
		}
		return false;
	}