Esempio n. 1
0
        /// <summary>
        /// Return the current drop receiver for a particular UI interactor.
        /// This is an IDropReceiver object that the UI interactor is currently hovering over while dragging an IDroppable object.
        /// </summary>
        /// <param name="uiInteractor">A UI interactor from the interaction system.</param>
        /// <returns>The IDropReceiver object that is currently being targeted by the interactor. If there is none, returns null.</returns>
        public IDropReceiver GetCurrentDropReceiver(IUIInteractor uiInteractor)
        {
            if (m_DropReceivers.TryGetValue(uiInteractor, out var dropReceiver))
            {
                return(dropReceiver);
            }

            return(null);
        }
Esempio n. 2
0
 void SetCurrentDropReceiver(IUIInteractor uiInteractor, IDropReceiver dropReceiver)
 {
     if (dropReceiver == null)
     {
         m_DropReceivers.Remove(uiInteractor);
     }
     else
     {
         m_DropReceivers[uiInteractor] = dropReceiver;
     }
 }
Esempio n. 3
0
 public RegisteredInteractor(IUIInteractor interactor, int deviceIndex)
 {
     this.interactor = interactor;
     model           = new TrackedDeviceModel(deviceIndex);
 }
Esempio n. 4
0
 /// <summary>
 /// Returns the current droppable data object for a particular UI interactor.
 /// This is the generic object data associated with an IDroppable being dragged by the UI interactor.
 /// </summary>
 /// <param name="uiInteractor">A UI interactor from the interaction system.</param>
 /// <returns>The droppable object data from the interactor's current IDroppable. If there is none, returns null.</returns>
 public object GetCurrentDropObject(IUIInteractor uiInteractor)
 {
     return(m_Droppables.TryGetValue(uiInteractor, out var droppable) ? droppable.GetDropObject() : null);
 }