本文整理汇总了C#中UnityEngine.EventSystems.PointerEventData.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# PointerEventData.Reset方法的具体用法?C# PointerEventData.Reset怎么用?C# PointerEventData.Reset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnityEngine.EventSystems.PointerEventData
的用法示例。
在下文中一共展示了PointerEventData.Reset方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnBeginDrag
/// <summary>
/// Raises the begin drag event.
/// </summary>
/// <param name="eventData">Event data.</param>
public virtual void OnBeginDrag(PointerEventData eventData)
{
if (!this.enabled || !this.IsAssigned() || !this.m_DragAndDropEnabled)
{
eventData.Reset();
return;
}
// Check if we have a key modifier and if it's held down
if (!this.DragKeyModifierIsDown())
{
eventData.Reset();
return;
}
// Start the drag
this.m_DragHasBegan = true;
// Create the temporary icon for dragging
this.CreateTemporaryIcon(eventData);
// Prevent event propagation
eventData.Use();
}
示例2: CastRayFromGaze
private void CastRayFromGaze()
{
pointerData = (pointerData == null ? new PointerEventData(eventSystem) : pointerData);
pointerData.Reset();
pointerData.position = new Vector3(hotspot.x * Screen.width, hotspot.y * Screen.height);
eventSystem.RaycastAll(pointerData, m_RaycastResultCache);
//List<RaycastResult> removeResult = new List<RaycastResult>();
//foreach (RaycastResult rayResult in m_RaycastResultCache)
//{
// if (interactTag != null && interactTag.Length > 1 && !rayResult.gameObject.tag.Equals(interactTag))
// {
// removeResult.Add(rayResult);
// }
//}
//foreach (RaycastResult rayResult in removeResult)
//{
// m_RaycastResultCache.Remove(rayResult);
//}
//TO-DO: FIND OUT HOW TO GET SPECIFIC RAYCAST FOR THIS OBJECT.
pointerData.pointerCurrentRaycast = FindFirstRaycast(m_RaycastResultCache);
m_RaycastResultCache.Clear();
}