Exemplo n.º 1
0
        /// <summary>
        /// Automatically called when an Interactor is registered with this Interaction Manager.
        /// Notifies the Interactor, passing the given <paramref name="args"/>.
        /// </summary>
        /// <param name="args">Event data containing the registered Interactor.</param>
        /// <remarks>
        /// <paramref name="args"/> is only valid during this method call, do not hold a reference to it.
        /// </remarks>
        /// <seealso cref="RegisterInteractor"/>
        protected virtual void OnRegistered(InteractorRegisteredEventArgs args)
        {
            Debug.Assert(args.manager == this, this);

            args.interactor.OnRegistered(args);
            interactorRegistered?.Invoke(args);
        }
        /// <inheritdoc />
        protected internal override void OnRegistered(InteractorRegisteredEventArgs args)
        {
            base.OnRegistered(args);
            args.manager.interactableRegistered   += OnInteractableRegistered;
            args.manager.interactableUnregistered += OnInteractableUnregistered;

            // Attempt to resolve any colliders that entered this trigger while this was not subscribed,
            // and filter out any targets that were unregistered while this was not subscribed.
            m_TriggerContactMonitor.interactionManager = args.manager;
            m_TriggerContactMonitor.ResolveUnassociatedColliders();
            XRInteractionManager.RemoveAllUnregistered(args.manager, m_ValidTargets);
        }
Exemplo n.º 3
0
 /// <inheritdoc />
 protected internal override void OnRegistered(InteractorRegisteredEventArgs args)
 {
     base.OnRegistered(args);
     args.manager.interactableUnregistered += OnInteractableUnregistered;
 }