version 2.5.0

This commit is contained in:
Sean Lu
2024-12-06 15:44:37 +08:00
parent dfdcd0fd7f
commit 2bfa2ad4c7
966 changed files with 238216 additions and 77239 deletions

View File

@@ -0,0 +1,48 @@
// Copyright HTC Corporation All Rights Reserved.
using UnityEngine;
using UnityEngine.EventSystems;
namespace VIVE.OpenXR.Raycast
{
public class RaycastEventData : PointerEventData
{
/// <summary> The actor sends an event. </summary>
public GameObject Actor { get { return m_Actor; } }
private GameObject m_Actor = null;
public RaycastEventData(EventSystem eventSystem, GameObject actor)
: base(eventSystem)
{
m_Actor = actor;
}
}
/// <summary>
/// The object which receives events should implement this interface.
/// </summary>
public interface IHoverHandler : IEventSystemHandler
{
void OnHover(RaycastEventData eventData);
}
/// <summary>
/// Objects will use
/// ExecuteEvents.Execute (GameObject, BaseEventData, RayastEvents.pointerXXXXHandler)
/// to send XXXX events.
/// </summary>
public static class RaycastEvents
{
#region Event Executor of Hover
/// Use ExecuteEvents.Execute (GameObject, BaseEventData, RaycastEvents.pointerHoverHandler)
private static void HoverExecutor(IHoverHandler handler, BaseEventData eventData)
{
handler.OnHover(ExecuteEvents.ValidateEventData<RaycastEventData>(eventData));
}
public static ExecuteEvents.EventFunction<IHoverHandler> pointerHoverHandler
{
get { return HoverExecutor; }
}
#endregion
}
}