private void RemoveListeners()
        {
            GvrEventExecutor executor = GvrPointerInputModule.FindEventExecutor();

            if (executor == null)
            {
                return;
            }

            executor.OnPointerClick -= OnPointerClick;
        }
Exemple #2
0
    private void RemoveListeners()
    {
        GvrEventExecutor eventExecutor = GvrPointerInputModule.FindEventExecutor();

        if (eventExecutor == null)
        {
            return;
        }

        eventExecutor.OnPointerClick -= OnPointerClickHandler;
        eventExecutor.OnPointerDown  -= OnPointerDownHandler;
        eventExecutor.OnPointerUp    -= OnPointerUpHandler;
        eventExecutor.OnPointerEnter -= OnPointerEnterHandler;
        eventExecutor.OnPointerExit  -= OnPointerExitHandler;
    }
Exemple #3
0
    private void AddListeners()
    {
        GvrEventExecutor eventExecutor = GvrPointerInputModule.FindEventExecutor();

        if (eventExecutor == null)
        {
            return;
        }

        eventExecutor.OnPointerClick += OnPointerClickHandler;
        eventExecutor.OnPointerDown  += OnPointerDownHandler;
        eventExecutor.OnPointerUp    += OnPointerUpHandler;
        eventExecutor.OnPointerEnter += OnPointerEnterHandler;
        eventExecutor.OnPointerExit  += OnPointerExitHandler;
    }
    void Start()
    {
        _trigger = GetComponent <EventTrigger>();
        EventTrigger.Entry entry = new EventTrigger.Entry();
        entry.eventID = EventTriggerType.PointerDown;
        entry.callback.AddListener((data) => OnClick());
        _trigger.triggers.Add(entry);



        EventTrigger.Entry entry2 = new EventTrigger.Entry();
        entry2.eventID = EventTriggerType.PointerUp;
        entry2.callback.AddListener((data) => OnExit());
        _trigger.triggers.Add(entry2);


        rb = GetComponent <Rigidbody>();
        GvrEventExecutor eventExecutor = GvrPointerInputModule.FindEventExecutor();

        eventExecutor.OnPointerClick += OnItemInterract;
    }