shenjianxing 6b341ae2b4 适配VR
2025-04-01 16:16:45 +08:00

55 lines
1.5 KiB
C#

////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2007-2020 , Inc. All Rights Reserved.
//
////////////////////////////////////////////////////////////////////////////////
using UnityEngine;
using UnityEngine.EventSystems;
using GCSeries.Core.Input;
namespace GCSeries.Core.EventSystems
{
public class ZPointerEventData : PointerEventData
{
public ZPointerEventData(EventSystem eventSystem)
: base(eventSystem)
{
}
/// <summary>
/// A reference to the pointer responsible for dispatching
/// the pointer event.
/// </summary>
public ZPointer Pointer { get; set; } = null;
/// <summary>
/// The event's associated pointer button id.
/// </summary>
public int ButtonId { get; set; } = -1;
/// <summary>
/// The pointer's 3D position delta since the last update.
/// </summary>
public Vector3 Delta3D { get; set; } = Vector3.zero;
/// <summary>
/// Is the pointer event in regards to a UI Object
/// </summary>
public bool IsUIObject { get; set; } = false;
/// <summary>
/// Checks whether the pointer is moving based on its 3D position delta.
/// </summary>
///
/// <returns>
/// True if the pointer is moving. False otherwise.
/// </returns>
public bool IsPointerMoving3D()
{
return (this.Delta3D.sqrMagnitude > 0);
}
}
}