Exemplo n.º 1
0
        public virtual void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.gameObject.GetComponent <Spawner> ())
            {
                GameObject g = Instantiate(interactable.gameObject.GetComponent <Spawner> ().ingredientPrefab, transform.position, transform.rotation);
                CurrentlyInteracting = g.GetComponent <NVRInteractableItem> ();
                CurrentlyInteracting.BeginInteraction(this);
            }
            if (interactable.CanAttach == true)
            {
                if (interactable.AttachedHand != null)
                {
                    if (interactable.AllowTwoHanded == false)
                    {
                        interactable.AttachedHand.EndInteraction(null);
                    }
                }

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);

                if (OnBeginInteraction != null)
                {
                    OnBeginInteraction.Invoke(interactable);
                }
            }
        }
Exemplo n.º 2
0
        private void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.CanAttach == true)
            {
                if (interactable.AttachedHand != null)
                {
                    interactable.AttachedHand.EndInteraction(null);
                }

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);
            }
        }
Exemplo n.º 3
0
        public virtual void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.CanAttach == true)
            {
                if (interactable.AttachedHand != null)//xw:AttachHand change?
                {
                    interactable.AttachedHand.EndInteraction(null);
                }

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);
            }
        }
Exemplo n.º 4
0
        public virtual void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.CanAttach == true)
            {
                if (interactable.AttachedHand != null)
                {
                    interactable.AttachedHand.EndInteraction(null);
                }

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);

                // TODO: A more general event may be better
                ScenarioLogManager.Instance.LogEvent(this.gameObject, "OnGrasp", CurrentlyInteracting.gameObject.name);
            }
        }
Exemplo n.º 5
0
        public virtual void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.CanAttach == true)
            {
                if (interactable.AttachedHand != null)
                {
                    interactable.AttachedHand.EndInteraction(null);
                }

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);

                if (OnBeginInteraction != null)
                {
                    OnBeginInteraction.Invoke(interactable);
                }
            }
        }
Exemplo n.º 6
0
        public virtual void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.CanAttach == true)
            {
                // Implemented hand controller should subscribe to this event and implement appropriate functionality
                OnBeginInteractionCustomHands.Invoke(interactable);

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);

                if (PhysicalController)
                {
                    PhysicalController.On();        // enable animation with Phyiscal Hand component during interaction
                }

                if (OnBeginInteraction != null)
                {
                    OnBeginInteraction.Invoke(interactable);
                }
            }
        }
Exemplo n.º 7
0
        private void BeginInteraction(NVRInteractable interactable)
        {
            if (interactable.CanAttach == true)
            {
                if (interactable.AttachedHand != null)
                {
                    interactable.AttachedHand.EndInteraction(null);
                }

                CurrentlyInteracting = interactable;
                CurrentlyInteracting.BeginInteraction(this);
            }
        }