Example #1
0
	/// <summary>
	/// Removes a mouse/touchpad pointer listener.
	/// </summary>
	/// <param name="del">Delegate to be removed.</param>
	public void RemoveRayPtrListener(PointerInfoDelegate del)
	{
		rayListeners -= del;
	}
Example #2
0
	/// <summary>
	/// Registers a delegate to be called with all ray 
	/// pointer input.  Use this when you want to "listen" 
	/// to all ray input.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void AddRayPtrListener(PointerInfoDelegate del)
	{
		rayListeners += del;
	}
Example #3
0
	/// <summary>
	/// Removes a mouse/touchpad pointer listener.
	/// </summary>
	/// <param name="del">Delegate to be removed.</param>
	public void RemoveMouseTouchPtrListener(PointerInfoDelegate del)
	{
		mouseTouchListeners -= del;
	}
Example #4
0
	/// <summary>
	/// Removes a delegate previously added with SetNonUIHitDelegate()
	/// or AddNonUIHitDelegate().
	/// </summary>
	/// <param name="del"></param>
	public void RemoveNonUIHitDelegate(PointerInfoDelegate del)
	{
		informNonUIHit -= del;
	}
Example #5
0
	/// <summary>
	/// Registers a delegate to be called with all mouse 
	/// and touchpad pointer input.  Use this when you 
	/// want to "listen" to all mouse or touchpad input.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void AddMouseTouchPtrListener(PointerInfoDelegate del)
	{
		mouseTouchListeners += del;
	}
Example #6
0
	/// <summary>
	/// Sets the delegate to be called when a raycast is
	/// performed on an input event which hits a non-UI
	/// object.  Use this when your game uses raycasts for
	/// non-UI game purposes but you don't want to waste 
	/// performance with a redundant set of raycasts.
	/// NOTE: This will replace any previously registered
	/// delegates.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void SetNonUIHitDelegate(PointerInfoDelegate del)
	{
		informNonUIHit = del;
	}
Example #7
0
	/// <summary>
	/// Adds a delegate to be called when a raycast is
	/// performed on an input event which hits a non-UI
	/// object.  Use this when your game uses raycasts for
	/// non-UI game purposes but you don't want to waste 
	/// performance with a redundant set of raycasts.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void AddNonUIHitDelegate(PointerInfoDelegate del)
	{
		informNonUIHit += del;
	}
Example #8
0
	/// <summary>
	/// Removes a mouse/touchpad pointer listener.
	/// </summary>
	/// <param name="del">Delegate to be removed.</param>
	public void RemoveMouseTouchPtrListener(PointerInfoDelegate del)
	{
		RemovePtrListener(mouseTouchListeners, del);
	}
Example #9
0
	/// <summary>
	/// Removes a mouse/touchpad pointer listener.
	/// </summary>
	/// <param name="del">Delegate to be removed.</param>
	public void RemoveRayPtrListener(PointerInfoDelegate del)
	{
		RemovePtrListener(rayListeners, del);
	}
Example #10
0
	// Helper method that removes a pointer listener from a list:
	protected void RemovePtrListener(EZLinkedList<EZLinkedListNode<PointerInfoDelegate>> list, PointerInfoDelegate del)
	{
		for (EZLinkedListIterator<EZLinkedListNode<PointerInfoDelegate>> i = list.Begin(); !i.Done; i.Next())
		{
			if (i.Current.val == del)
			{
				// Save it:
				EZLinkedListNode<PointerInfoDelegate> node = i.Current;

				// Remove it from the active list:
				list.Remove(i.Current);

				// Add it to our free pool:
				listenerPool.Add(node);

				// We're done.
				i.End();
				break;
			}
		}
	}
Example #11
0
	/// <summary>
	/// Registers a delegate to be called with all ray 
	/// pointer input.  Use this when you want to "listen" 
	/// to all ray input.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void AddRayPtrListener(PointerInfoDelegate del)
	{
		rayListeners.Add(GetPtrListenNode(del));
	}
Example #12
0
	/// <summary>
	/// Registers a delegate to be called with all mouse 
	/// and touchpad pointer input.  Use this when you 
	/// want to "listen" to all mouse or touchpad input.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	public void AddMouseTouchPtrListener(PointerInfoDelegate del)
	{
		mouseTouchListeners.Add(GetPtrListenNode(del));
	}
Example #13
0
	protected EZLinkedListNode<PointerInfoDelegate> GetPtrListenNode(PointerInfoDelegate del)
	{
		EZLinkedListNode<PointerInfoDelegate> delNode;

		if (listenerPool.Count > 0)
		{
			delNode = listenerPool.Head;
			listenerPool.Remove(delNode);
			delNode.val = del;
		}
		else
			delNode = new EZLinkedListNode<PointerInfoDelegate>(del);

		return delNode;
	}
Example #14
0
	/// <summary>
	/// Registers a delegate to be called when a raycast is
	/// performed on an input event which hits a non-UI
	/// object.  Use this when your game uses raycasts for
	/// non-UI game purposes but you don't want to waste 
	/// performance with a redundant set of raycasts.
	/// </summary>
	/// <param name="del">Delegate to be called.</param>
	/// <returns>The previous delegate. It is recommended to save 
	/// this value and call it in your own delegate to preserve 
	/// the delegate chain.</returns>
	public PointerInfoDelegate SetNonUIHitDelegate(PointerInfoDelegate del)
	{
		PointerInfoDelegate oldDel = informNonUIHit;
		informNonUIHit = del;
		return oldDel;
	}