private void Start()
        {
            if (m_ARSpace == null)
            {
                m_ARSpace = GameObject.FindObjectOfType <Immersal.AR.ARSpace>();

                if (m_ARSpace == null)
                {
                    Debug.Log("No AR Space found");
                }
            }

            if (m_TargetsList != null)
            {
                m_TargetsList.SetActive(false);
            }

            if (m_StopNavigationButton != null)
            {
                m_StopNavigationButton.SetActive(false);
            }

            if (m_TargetsListIcon != null && m_SelectTargetIcon != null)
            {
                m_TargetsListIcon.sprite = m_ShowListIcon;
            }
            if (m_TargetsListText != null)
            {
                m_TargetsListText.text = "Show Navigation Targets";
            }

            DeletePath();
        }
Exemple #2
0
        void Awake()
        {
            if (instance == null)
            {
                instance = this;
            }
            if (instance != this)
            {
                Debug.LogError("There must be only one ContentStorageManager object in a scene.");
                UnityEngine.Object.DestroyImmediate(this);
                return;
            }

            if (m_ARSpace == null)
            {
                m_ARSpace = GameObject.FindObjectOfType <Immersal.AR.ARSpace>();
            }
        }
        public void BuildPath(NavigationTargetListButton button)
        {
            m_CameraTransform = Camera.main.transform;
            m_TargetTransform = button.targetObject.transform;

            // check if main camera exists
            if (m_CameraTransform == null)
            {
                Debug.Log("Could not find the main camera. Do you have the MainCamera tag applied?");
                return;
            }

            // check if target from button was found
            if (m_TargetTransform == null)
            {
                Debug.Log("Target not found");
                return;
            }

            // check if AR Space exists
            if (m_ARSpace == null)
            {
                m_ARSpace = gameObject.GetComponentInParent <Immersal.AR.ARSpace>();
                if (m_ARSpace == null)
                {
                    Debug.Log("No AR Space found. Does one exist in scene?");
                    return;
                }
            }

            m_IsInitialized     = true;
            m_NavigationArrived = false;
            UpdatePath(false);

            // create the compass m_Arrow
            if (m_ArrowPrefab != null)
            {
                m_Arrow          = Instantiate(m_ArrowPrefab, m_CameraTransform.transform);
                m_ArrowDirection = m_Arrow.GetComponent <LookTowardsTarget>();
                m_Arrow.SetActive(false);
            }
        }
Exemple #4
0
        void Start()
        {
            InitializeMeshRenderer();

            m_ArSpace = FindObjectOfType <Immersal.AR.ARSpace>();
        }