/// <summary> /// Attempts to capture the cursor at the given depth with the given HUD space. If drawInHudSpace /// is true, then the cursor will be drawn in the given space. /// </summary> public bool TryCaptureHudSpace(float depthSquared, HudSpaceDelegate GetHudSpaceFunc) { if (GetCapturedHudSpaceFunc == null || depthSquared <= captureDepth) { captureDepth = depthSquared; GetCapturedHudSpaceFunc = GetHudSpaceFunc; return(true); } else { return(false); } }
/// <summary> /// Releases the cursor /// </summary> public void Release() { CapturedElement = null; captureDepth = 0f; GetCapturedHudSpaceFunc = null; }
/// <summary> /// Attempts to capture the cursor at the given depth with the given HUD space. If drawInHudSpace /// is true, then the cursor will be drawn in the given space. /// </summary> public void CaptureHudSpace(float depth, HudSpaceDelegate GetHudSpaceFunc) => TryCaptureHudSpace(depth, GetHudSpaceFunc);
/// <summary> /// Returns true if the given HUD space is being captured by the cursor /// </summary> public bool IsCapturingSpace(HudSpaceDelegate GetHudSpaceFunc) => Visible && GetCapturedHudSpaceFunc == GetHudSpaceFunc;