private void OnEnable()
    {
        if (mARInteractible == null)
        {
            mARInteractible = GetComponent <ARInteractible> ();
        }

        //Subscribing to ARInteractible Events
        mARInteractible.OnEnter += MARInteractible_OnEnter;
        mARInteractible.OnExit  += MARInteractible_OnExit;

        mARInteractible.OnButtonPressStart   += MARInteractible_OnButtonPressStart;
        mARInteractible.OnButtonPressEnd     += MARInteractible_OnButtonPressEnd;
        mARInteractible.OnTrackpadTouchBegin += MARInteractible_OnTrackpadTouchBegin;
        mARInteractible.OnTrackpadTouchEnd   += MARInteractible_OnTrackpadTouchEnd;

        mARInteractible.OnSingleClickUp        += MARInteractible_OnSingleClickUp;
        mARInteractible.OnSingleClickConfirm   += MARInteractible_OnSingleClickConfirm;
        mARInteractible.OnDoubleClick          += MARInteractible_OnDoubleClick;
        mARInteractible.OnDoubleClickCancelled += MARInteractible_OnDoubleClickCancelled;
        mARInteractible.OnLongPressStart       += MARInteractible_OnLongPressStart;
        mARInteractible.OnLongPressEnd         += MARInteractible_OnLongPressEnd;
        mARInteractible.OnSwipeVertical        += MARInteractible_OnSwipeVertical;
        mARInteractible.OnSwipeHorizontal      += MARInteractible_OnSwipeHorizontal;
    }
    public void Start()
    {
        arCamera   = ARCamera.Instance;
        controller = HoloboardController.Instance;

        ray          = arCamera.GetRayFromGaze();
        interactible = GetComponent <ARInteractible> ();
    }
コード例 #3
0
 private void OnEnable()
 {
     //Subscribing to events
     mARInteractible = GetComponent <ARInteractible> ();
     if (mARInteractible != null)
     {
         mARInteractible.OnEnter            += MARInteractible_OnEnter;
         mARInteractible.OnExit             += MARInteractible_OnExit;
         mARInteractible.OnButtonPressStart += MARInteractible_OnButtonPressStart;
         mARInteractible.OnButtonPressEnd   += MARInteractible_OnButtonPressEnd;
     }
 }
    private void OnDisable()
    {
        if (interactible == null)
        {
            interactible = GetComponent <ARInteractible> ();
        }

        //Unsubscribing interactibe events
        interactible.OnSingleClickConfirm -= Interactible_OnSingleClick;
        interactible.OnSwipeVertical      -= Interactible_OnSwipeVertical;
        interactible.OnSwipeHorizontal    -= Interactible_OnSwipeHorizontal;
        interactible.OnDoubleClick        -= Interactible_OnDoubleClick;
        interactible.OnLongPressStart     -= Interactible_OnLongPressStart;
        interactible.OnLongPressEnd       -= Interactible_OnLongPressEnd;
    }
    private void OnEnable()
    {
        if (interactible == null)
        {
            interactible = GetComponent <ARInteractible> ();
        }

        //Subscribing to interactible events
        interactible.OnSingleClickConfirm += Interactible_OnSingleClick;
        interactible.OnSwipeVertical      += Interactible_OnSwipeVertical;
        interactible.OnSwipeHorizontal    += Interactible_OnSwipeHorizontal;
        interactible.OnDoubleClick        += Interactible_OnDoubleClick;
        interactible.OnLongPressStart     += Interactible_OnLongPressStart;
        interactible.OnLongPressEnd       += Interactible_OnLongPressEnd;
    }
コード例 #6
0
    // Use this for initialization
    void Start()
    {
        if (TargetImage != null)
        {
            TargetImage.color = NormalColor;
        }

        mARInteractible = GetComponent <ARInteractible> ();

        //If no interactible exists, disable this script
        if (mARInteractible == null)
        {
            enabled = false;
            return;
        }
    }