Esempio n. 1
0
        // TODO refactor this funcionality with the pointClick Event System
        //This function is called by the EventTrigger on an Interactable, and trigger instantaneously
        public override void OnImmediateInteractableClick(InteractionTrigger interactable, int numCliks) {
            Debug.Log("Click on Interactable: " + interactable.gameObject.transform.name);
            //If the handle input flag is set to false then do nothing.
            if (!handleInput)
                return;

            //Interact onClick
            interactable.React();
        }
Esempio n. 2
0
        private void OnTriggerEnter(Collider other)
        {
            if (other.gameObject.CompareTag(interactableTag))
            {
                InteractionTrigger interAux = other.gameObject.GetComponent <InteractionTrigger>();

                if (interAux.autoReact)
                {
                    interAux.React();
                }
                else if (!interactionTriggersInRange.Exists(x => x.GetInstanceID() == interAux.GetInstanceID()))
                {
                    interactionTriggersInRange.Add(interAux);
                    Debug.Log("Interactable Added");
                }
            }
        }