Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        shapeManager = GetComponent <CustomShapeManager>();

        Input.location.Start();

        mSession = UnityARSessionNativeInterface.GetARSessionNativeInterface();
        StartARKit();
        FeaturesVisualizer.EnablePointcloud();
        LibPlacenote.Instance.RegisterListener(this);
    }
Exemplo n.º 2
0
    //private string mSaveMapId = null;
    // Use this for initialization
    void Start()
    {
        MAP_NAME     = PlayerPrefs.GetString("mapname");
        shapeManager = GetComponent <CustomShapeManager>();

        Input.location.Start();

        mSession = UnityARSessionNativeInterface.GetARSessionNativeInterface();
        UnityARSessionNativeInterface.ARFrameUpdatedEvent += ARFrameUpdated;
        StartARKit();
        FeaturesVisualizer.EnablePointcloud();
        LibPlacenote.Instance.RegisterListener(this);
    }
    void Start()
    {
        mShapeManager = GetComponent <CustomShapeManager>();
        Debug.Assert(mShapeManager != null, "shapeManager is missing.");
        Debug.Assert(mLabelText != null, "debugText is missing.");
        Debug.Assert(mStartBtn != null, "startBtn is missing.");
        Debug.Assert(mNavController != null, "navController is missing.");

        mNavController.OnStartedEvent.AddListener(ActivateStartBtn);
        mLabelText.text = "Initializing...";

        Input.location.Start();
        Application.targetFrameRate = 60;
        StartCoroutine(WaitForARSessionThenDo(() =>
        {
            // Activate placenote
            LibPlacenote.Instance.RegisterListener(this); // Register listener for onStatusChange OnPose
            FeaturesVisualizer.EnablePointcloud();        // Optional - to see the point features
            // AR Session has started tracking here. Now start the session
            ARSessionReady  = true;
            mLabelText.text = "Ready to Start";
            FindMap();
        }));

        // Localization thumbnail handler.
        mLocalizationThumbnail.gameObject.SetActive(false);

        // Set up the localization thumbnail texture event.
        LocalizationThumbnailSelector.Instance.TextureEvent += (thumbnailTexture) =>
        {
            if (mLocalizationThumbnail == null)
            {
                return;
            }

            RectTransform rectTransform = mLocalizationThumbnail.rectTransform;
            if (thumbnailTexture.width != (int)rectTransform.rect.width)
            {
                rectTransform.SetSizeWithCurrentAnchors(
                    RectTransform.Axis.Horizontal, thumbnailTexture.width * 2);
                rectTransform.SetSizeWithCurrentAnchors(
                    RectTransform.Axis.Vertical, thumbnailTexture.height * 2);
                rectTransform.ForceUpdateRectTransforms();
            }
            mLocalizationThumbnail.texture = thumbnailTexture;
        };
    }
    void Start()
    {
        mShapeManager = GetComponent <CustomShapeManager>();
        Debug.Assert(mShapeManager != null, "shapeManager is missing.");
        Debug.Assert(mLabelText != null, "mLabelText is missing.");
        Debug.Assert(mBackBtn != null, "backBtn is missing.");
        mLabelText.text = "Initializing...";

        Input.location.Start();
        Application.targetFrameRate = 60;
        StartCoroutine(WaitForARSessionThenDo(() =>
        {
            // activate placenote SDK
            LibPlacenote.Instance.RegisterListener(this); //Register listener for onStatusChange, OnPose, OnLocalized
            FeaturesVisualizer.EnablePointcloud();        //Optional - to see the point features
            ARSessionReady  = true;
            mLabelText.text = "Ready to Start";
        }));
    }