コード例 #1
0
    public override void Bind()
    {
        this.View.mCloseButton.TappedOn += OnTappedOnCloseButton;
        this.View.mButtonTwo.TappedOn   += OnTappedOnButtonTwo;
        this.View.mButtonFour.TappedOn  += OnTappedOnButtonFour;
        this.View.mButtonThree.TappedOn += OnTappedOnButtonThree;
        this.View.mButtonOne.TappedOn   += OnTappedOnButtonOne;
        this.View.mAboutButton.TappedOn += OnTappedOnAboutButton;

        // register Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.RegisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.RegisterOnPauseCallback(OnPause);
        }

        // Find the Wood image target.
        mAResume = GameObject.Find("AResume").GetComponent <ImageTargetBehaviour>();

        // Add a mesh for each virtual button on the Wood target.
        VirtualButtonBehaviour[] vbs =
            mAResume.gameObject.GetComponentsInChildren <VirtualButtonBehaviour>();
        foreach (VirtualButtonBehaviour vb in vbs)
        {
            CreateVBMesh(vb);
            // Also store the position and scale for later.
            mVBPositionDict.Add(vb.VirtualButtonName, vb.transform.localPosition);
            mVBScaleDict.Add(vb.VirtualButtonName, vb.transform.localScale);
        }
    }
コード例 #2
0
    public override void Bind()
    {
        this.View.mCloseButton.TappedOn         += OnTappedOnCloseButton;
        this.View.mVirtualGreenButton.TappedOn  += OnTappedOnGreenButton;
        this.View.mVirtualYellowButton.TappedOn += OnTappedOnYellowButton;
        this.View.mVirtualRedButton.TappedOn    += OnTappedOnRedButton;
        this.View.mVirtualBlueButton.TappedOn   += OnTappedOnBlueButton;
        this.View.mAboutButton.TappedOn         += OnTappedOnAboutButton;

        // register Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.RegisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.RegisterOnPauseCallback(OnPause);
        }

        // Find the Wood image target.
        //mImageTargetWood = GameObject.Find("ImageTargetWood").GetComponent<ImageTargetBehaviour>();

        // Add a mesh for each virtual button on the Wood target.
        //VirtualButtonBehaviour[] vbs =
        //        mImageTargetWood.gameObject.GetComponentsInChildren<VirtualButtonBehaviour>();
        //foreach (VirtualButtonBehaviour vb in vbs)
        //{
        //   CreateVBMesh(vb);
        // Also store the position and scale for later.
        //    mVBPositionDict.Add(vb.VirtualButtonName, vb.transform.localPosition);
        //   mVBScaleDict.Add(vb.VirtualButtonName, vb.transform.localScale);
        //}
    }
コード例 #3
0
    void Start()
    {
        VuforiaAbstractBehaviour vuforia = FindObjectOfType <VuforiaAbstractBehaviour>();

        vuforia.RegisterVuforiaStartedCallback(OnVuforiaStarted);
        vuforia.RegisterOnPauseCallback(OnPaused);
    }
コード例 #4
0
ファイル: MenuOptions.cs プロジェクト: sekoucox7913/AR-Study
    protected virtual void Start()
    {
        mCamSettings       = FindObjectOfType <CameraSettings>();
        mTrackableSettings = FindObjectOfType <TrackableSettings>();
        mMenuAnim          = FindObjectOfType <MenuAnimator>();

        VuforiaAbstractBehaviour vuforia = FindObjectOfType <VuforiaAbstractBehaviour>();

        vuforia.RegisterOnPauseCallback(OnPaused);
    }
    public override void UnBind()
    {
        this.View.mCloseButton.TappedOn -= OnTappedOnCloseButton;
        this.View.UnLoadView();
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.UnregisterOnPauseCallback(OnPause);
        }
    }
コード例 #6
0
 public void OnEnable()
 {
     this.mBhvr                     = (VuforiaAbstractBehaviour)base.target;
     this.mWorldCenterMode          = base.serializedObject.FindProperty("mWorldCenterMode");
     this.mWorldCenter              = base.serializedObject.FindProperty("mWorldCenter");
     this.mCentralAnchorPoint       = base.serializedObject.FindProperty("mCentralAnchorPoint");
     this.mParentAnchorPoint        = base.serializedObject.FindProperty("mParentAnchorPoint");
     this.mPrimaryCamera            = base.serializedObject.FindProperty("mPrimaryCamera");
     this.mSecondaryCamera          = base.serializedObject.FindProperty("mSecondaryCamera");
     this.mWereBindingFieldsExposed = base.serializedObject.FindProperty("mWereBindingFieldsExposed");
 }
    public override void Bind()
    {
        this.View.mCloseButton.TappedOn += OnTappedOnCloseButton;
        this.View.mAboutLabel.TappedOn  += OnTappedOnAboutButton;
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.RegisterOnPauseCallback(OnPause);
        }
    }
コード例 #8
0
    void OnDestroy()
    {
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.UnregisterVuforiaInitErrorCallback(OnVuforiaInitializationError);
        }

        mAppManager.DeInitManager();
    }
コード例 #9
0
    void Awake()
    {
        VuforiaAbstractBehaviour vuforia = FindObjectOfType <VuforiaAbstractBehaviour>();

        //vuforia.RegisterVuforiaInitErrorCallback(OnInitError);

        // Get the UI Canvas that contains (parent of) the error text box
        if (errorText)
        {
            errorCanvas = errorText.GetComponentsInParent <Canvas>(true)[0];
        }
    }
コード例 #10
0
    void Start()
    {
        VuforiaAbstractBehaviour vuforia = FindObjectOfType <VuforiaAbstractBehaviour>();

        vuforia.RegisterVuforiaStartedCallback(OnVuforiaStarted);
        vuforia.RegisterOnPauseCallback(OnPaused);

        /////////
        mDTEH = FindObjectOfType <DefaultTrackableEventHandler>();
        //mActiveStrategy = SceneSwicher.st;
        ////////
    }
コード例 #11
0
    public override void Bind()
    {
        this.View.mCloseButton.TappedOn += OnTappedOnCloseButton;
        this.View.mAboutLabel.TappedOn  += OnTappedOnAboutButton;

        // register Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.RegisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.RegisterOnPauseCallback(OnPause);
        }
    }
コード例 #12
0
    void Awake()
    {
        mPopUpMsg = GetComponent <SampleInitErrorHandler>();
        if (!mPopUpMsg)
        {
            mPopUpMsg = gameObject.AddComponent <SampleInitErrorHandler>();
        }

        // Check for an initialization error on start.
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.RegisterVuforiaInitErrorCallback(OnVuforiaInitializationError);
        }
    }
コード例 #13
0
    public override void UnBind()
    {
        this.View.mCloseButton.TappedOn           -= OnTappedOnCloseButton;
        this.View.mAboutLabel.TappedOn            -= OnTappedOnAboutButton;
        this.View.mPlayFullscreeSettings.TappedOn -= OnTappedOnFullscreenButton;

        // unregister Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.UnregisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.UnregisterOnPauseCallback(OnPause);
        }

        this.View.UnLoadView();
    }
コード例 #14
0
    public override void UnBind()
    {
        this.View.mExtendedTracking.TappedOn -= OnTappedToTurnOnTraking;
        this.View.mCloseButton.TappedOn      -= OnTappedOnCloseButton;
        this.View.mAboutLabel.TappedOn       -= OnTappedOnAboutButton;

        // unregister Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.UnregisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.UnregisterOnPauseCallback(OnPause);
        }

        sExtendedTrackingIsEnabled = false;
        this.View.UnLoadView();
    }
コード例 #15
0
    public override  void Bind()
    {
        this.View.mExtendedTracking.TappedOn    += OnTappedToTurnOnTraking;
        this.View.mCameraFlashSettings.TappedOn += OnTappedToTurnOnFlash;
        this.View.mAutoFocusSetting.TappedOn    += OnTappedToTurnOnAutoFocus;
        this.View.mCameraFacing.TappedOnOption  += OnTappedToTurnCameraFacing;
        this.View.mDataSet.TappedOnOption       += OnTappedOnDataSet;
        this.View.mCloseButton.TappedOn         += OnTappedOnCloseButton;
        this.View.mAboutLabel.TappedOn          += OnTappedOnAboutButton;

        // register Vuforia started callback
        VuforiaAbstractBehaviour VuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));
        if (VuforiaBehaviour)
        { 
            VuforiaBehaviour.RegisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            VuforiaBehaviour.RegisterOnPauseCallback(OnPause);
        }
    }
コード例 #16
0
    public override void UnBind()
    {
        this.View.mCloseButton.TappedOn -= OnTappedOnCloseButton;
        this.View.mButtonTwo.TappedOn   -= OnTappedOnButtonTwo;
        this.View.mButtonFour.TappedOn  -= OnTappedOnButtonFour;
        this.View.mButtonThree.TappedOn -= OnTappedOnButtonThree;
        this.View.mButtonOne.TappedOn   -= OnTappedOnButtonOne;
        this.View.mAboutButton.TappedOn -= OnTappedOnAboutButton;

        // unregister Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.UnregisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.UnregisterOnPauseCallback(OnPause);
        }

        mVBPositionDict.Clear();
        mVBScaleDict.Clear();
        this.View.UnLoadView();
        mView = null;
    }
コード例 #17
0
    public override void UnBind()
    {
        this.View.mExtendedTracking.TappedOn    -= OnTappedToTurnOnTraking;
        this.View.mCameraFlashSettings.TappedOn -= OnTappedToTurnOnFlash;
        this.View.mAutoFocusSetting.TappedOn    -= OnTappedToTurnOnAutoFocus;
        this.View.mCameraFacing.TappedOnOption  -= OnTappedToTurnCameraFacing;
        this.View.mDataSet.TappedOnOption       -= OnTappedOnDataSet;
        this.View.mCloseButton.TappedOn         -= OnTappedOnCloseButton;
        this.View.mAboutLabel.TappedOn          -= OnTappedOnAboutButton;
        sExtendedTrackingIsEnabled = false;

        // unregister Vuforia started callback
        VuforiaAbstractBehaviour vuforiaBehaviour = (VuforiaAbstractBehaviour)FindObjectOfType(typeof(VuforiaAbstractBehaviour));

        if (vuforiaBehaviour)
        {
            vuforiaBehaviour.UnregisterVuforiaStartedCallback(EnableContinuousAutoFocus);
            vuforiaBehaviour.UnregisterOnPauseCallback(OnPause);
        }

        this.View.UnLoadView();
        mView = null;
    }
コード例 #18
0
    void Awake()
    {
        VuforiaAbstractBehaviour vuforia = FindObjectOfType <VuforiaAbstractBehaviour>();

        vuforia.RegisterVuforiaInitErrorCallback(OnInitError);
    }
コード例 #19
0
    void Awake()
    {
        VuforiaAbstractBehaviour vuforia = FindObjectOfType <VuforiaAbstractBehaviour>();

        vuforia.RegisterVuforiaInitializedCallback(SetViewMode);
    }