public void Update()
    {
        if (thisTrackedImage.image == null || thisTrackedImage.image.TrackingState != TrackingState.Tracking)
        {
            //foreach (var element in thisTrackedImage.ARBookPageElements) element.SetActive(false);
            return;
        }
        //give a 2 second window before it starts pinging away
        if (Time.time < birthTime + 2f)
        {
            return;
        }

        if (thisTrackedImage.image.TrackingMethod == AugmentedImageTrackingMethod.FullTracking)
        {
            isFullTracked = true;
            InteractionNotice(true);
            if (mainTracker.TrackingNotice(gameObject.name, true))
            {
                SetBit(true);
            }
            else
            {
                ResetBit();
            }
        }

        //user placed down the peppermint token and covered the tracked image
        if (thisTrackedImage.image.TrackingMethod == AugmentedImageTrackingMethod.LastKnownPose && isFullTracked)
        {
            timeSinceFullTrackingMethod += Time.deltaTime;
            if (timeSinceFullTrackingMethod > 1.3f)
            {
                isFullTracked = false;
                InteractionNotice(false);
                if (mainTracker.TrackingNotice(gameObject.name, false))
                {
                    SetBit(false);
                }
                else
                {
                    ResetBit();
                }
                timeSinceFullTrackingMethod = 0f;
            }
        }
        else
        {
            timeSinceFullTrackingMethod = 0f;
        }
    }
예제 #2
0
    public void Update()
    {
        if (thisTrackedImage.image == null || thisTrackedImage.image.TrackingState != TrackingState.Tracking)
        {
            //foreach (var element in thisTrackedImage.ARBookPageElements) element.SetActive(false);
            return;
        }

        if (thisTrackedImage.image.TrackingMethod == AugmentedImageTrackingMethod.FullTracking)
        {
            isFullTracked = true;
            InteractionNotice(true);
            if (mainTracker != null)
            {
                mainTracker.TrackingNotice("eggy", true);
            }
        }

        //user placed down the peppermint token and covered the tracked image
        if (thisTrackedImage.image.TrackingMethod == AugmentedImageTrackingMethod.LastKnownPose && isFullTracked)
        {
            timeSinceFullTrackingMethod += Time.deltaTime;
            if (timeSinceFullTrackingMethod > 1f)
            {
                isFullTracked = false;
                timeSinceFullTrackingMethod = 0f;
                InteractionNotice(false);
                if (mainTracker != null)
                {
                    mainTracker.TrackingNotice("eggy", false);
                }
            }
        }
        else
        {
            timeSinceFullTrackingMethod = 0f;
        }
    }