IsTangoCorePresent() публичный статический Метод

Check if the Tango Core package is installed.
public static IsTangoCorePresent ( ) : bool
Результат bool
Пример #1
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.
    /// </summary>
    public void Start()
    {
        m_meshSavePath = Application.persistentDataPath + "/meshes";
        Directory.CreateDirectory(m_meshSavePath);

        m_arPoseController = FindObjectOfType <TangoARPoseController>();
        m_tangoDynamicMesh = FindObjectOfType <TangoDynamicMesh>();

        m_areaDescriptionLoaderPanel.SetActive(true);
        m_meshBuildPanel.SetActive(false);
        m_meshInteractionPanel.SetActive(false);
        m_relocalizeImage.gameObject.SetActive(false);

        // Initialize tango application.
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }

            m_bloonController.Init(m_tangoApplication);
            m_bloonController.SetOnBalloonAddedListener((marker) => {
                Debug.Log("added ballon ctrl");
//				m_markerList.Add(marker);
            });
            m_bloonController.SetOnBalloonPoppedListener((marker) => {
                Debug.Log("popped ballon ctrl");
//				m_markerList.Remove(marker);
            });
        }
    }
Пример #2
0
    /// <summary>
    /// Start this instance.
    /// </summary>
    private void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
                m_tangoApplication.RequestNecessaryPermissionsAndConnect();
                m_tangoApplication.Register(this);
                m_tangoServiceVersionName = TangoApplication.GetTangoServiceVersion();
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it!
                StartCoroutine(_InformUserNoTangoCore());
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
    /// <summary>
    /// Start is called on the frame when a script is enabled.
    /// </summary>
    public void Start()
    {
        m_tangoApplication    = FindObjectOfType <TangoApplication>();
        m_characterController = GetComponent <CharacterController>();

        if (m_tangoApplication != null)
        {
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
                m_tangoApplication.RequestNecessaryPermissionsAndConnect();
                m_tangoApplication.Register(this);
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it!
                StartCoroutine(_InformUserNoTangoCore());
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }

        SetPose(transform.position, transform.rotation);
    }
Пример #4
0
	void Start(){
		if (AndroidHelper.IsTangoCorePresent ()) {
			transform.parent = TangoDeltaPoseController.Player.gameObject.transform;
		} else {
			transform.parent = Cardboard.SDK.transform;
		}

	}
Пример #5
0
    /// <summary>
    /// Chooses manager on initalization. The only difference right now, is whether the device is a Tango or not.
    /// NOTE: These managers must inherit from TransformManagerInterface so that the proper Instance variable is accessed
    /// </summary>
    void Awake()
    {
        if (AndroidHelper.IsTangoCorePresent())
        {
            this.gameObject.AddComponent <PoseManager> ();
        }
        else
        {
            this.gameObject.AddComponent <GyroManager> ();
        }

        this.enabled = false;         //this script is no longer needed so we can disable ourselves
    }
Пример #6
0
    /// <summary>
    /// Initialize the AR Screen.
    /// </summary>
    private void Start()
    {
        // Constant matrix converting start of service frame to Unity world frame.
        m_uwTss = new Matrix4x4();
        m_uwTss.SetColumn(0, new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
        m_uwTss.SetColumn(1, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
        m_uwTss.SetColumn(2, new Vector4(0.0f, 1.0f, 0.0f, 0.0f));
        m_uwTss.SetColumn(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

        // Constant matrix converting Unity world frame frame to device frame.
        m_cTuc.SetColumn(0, new Vector4(1.0f, 0.0f, 0.0f, 0.0f));
        m_cTuc.SetColumn(1, new Vector4(0.0f, -1.0f, 0.0f, 0.0f));
        m_cTuc.SetColumn(2, new Vector4(0.0f, 0.0f, 1.0f, 0.0f));
        m_cTuc.SetColumn(3, new Vector4(0.0f, 0.0f, 0.0f, 1.0f));

        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
                m_tangoApplication.RequestNecessaryPermissionsAndConnect();
                m_tangoApplication.Register(this);
                m_renderCamera.clearFlags = CameraClearFlags.SolidColor;
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it.
                Debug.Log("Tango Core is outdated.");
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
        if (m_tangoApplication != null)
        {
            m_textures = m_tangoApplication.GetVideoOverlayTextureYUV();

            // Pass YUV textures to shader for process.
            m_screenMaterial.SetTexture("_YTex", m_textures.m_videoOverlayTextureY);
            m_screenMaterial.SetTexture("_UTex", m_textures.m_videoOverlayTextureCb);
            m_screenMaterial.SetTexture("_VTex", m_textures.m_videoOverlayTextureCr);
        }

        m_tangoApplication.Register(this);
    }
Пример #7
0
    /// <summary>
    /// Unity Start function.
    ///
    /// This function is responsible for connecting callbacks, set up TangoApplication and initialize the data list.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
Пример #8
0
 /// <summary>
 /// Use this to initialize.
 /// </summary>
 private void Start()
 {
     tangoApplication = FindObjectOfType <TangoApplication>();
     if (tangoApplication != null)
     {
         if (AndroidHelper.IsTangoCorePresent())
         {
             // Request Tango permissions
             tangoApplication.RegisterPermissionsCallback(_OnTangoApplicationPermissionsEvent);
             tangoApplication.RequestNecessaryPermissionsAndConnect();
         }
     }
     else
     {
         Debug.Log("No Tango Manager found in scene.");
     }
 }
Пример #9
0
    // Use this for initialization
    void Start()
    {
        GameObject temp;

        if (AndroidHelper.IsTangoCorePresent())
        {
            temp = Instantiate(TangoPrefab) as GameObject;
            NaviConnectionSDK.OnResetHMD += ResetTangoHMD;
        }
        else
        {
            temp = Instantiate(CardboardPrefab) as GameObject;
            NaviConnectionSDK.OnResetHMD += ResetCardboardHMD;
        }

        temp.transform.parent = this.transform.parent;
    }
Пример #10
0
 public override void OnInit()
 {
     m_tangoApplication       = GetComponent <TangoApplication> ();
     vAreaDescription         = new List <AreaDescription> ();
     m_needNewAreaDescription = true;
     if (m_tangoApplication != null)
     {
         m_tangoApplication.Register(this);
         if (AndroidHelper.IsTangoCorePresent())
         {
             m_tangoApplication.RequestPermissions();
         }
     }
     else
     {
         Debug.Log("No Tango Manager found in scene.");
     }
 }
    /// <summary>
    /// Unity Start function.
    ///
    /// This function is responsible for connecting callbacks, set up TangoApplication and initialize the data list.
    /// </summary>
    void Start()
    {
        // The PlaceMenu start closed.
        isPlaceMenuOpen = false;

        // Tango Initialization
        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
Пример #12
0
    /// <summary>
    /// Unity Start function.
    /// </summary>
    public void Start()
    {
        TangoApplication tangoApplication = FindObjectOfType <TangoApplication>();

        if (tangoApplication != null)
        {
            tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.LogError("No Tango Manager found in scene." + Environment.StackTrace);
            return;
        }
#if UNITY_EDITOR
        PhotonNetwork.ConnectUsingSettings("0.1");
#endif
    }
    /// <summary>
    /// Awake is called when the script instance is being loaded.
    /// </summary>
    public void Awake()
    {
        TangoState tangoState;

#if UNITY_EDITOR
        tangoState = m_editorPlayModeState;
#else
        if (!AndroidHelper.IsTangoCorePresent())
        {
            tangoState = TangoState.NotPresent;
            download.SetActive(true);
        }
        else if (!AndroidHelper.IsTangoCoreUpToDate())
        {
            tangoState = TangoState.OutOfDate;
            download.SetActive(true);
        }
        else
        {
            tangoState = TangoState.Present;
            start.SetActive(true);
        }
#endif

        foreach (GameObject obj in m_enableIfTangoPresent)
        {
            obj.SetActive(tangoState == TangoState.Present);
        }

        foreach (GameObject obj in m_enableIfTangoOutOfDate)
        {
            obj.SetActive(tangoState == TangoState.OutOfDate);
        }

        foreach (GameObject obj in m_disableIfTangoPresent)
        {
            obj.SetActive(tangoState == TangoState.NotPresent);
        }
    }
Пример #14
0
    /// <summary>
    /// Start is called on the frame when a script is enabled just before any of the Update methods is called the first time.
    /// </summary>
    public void Start()
    {
        m_adfMeshSavePath = Application.persistentDataPath + "/ADFMeshes";

        m_arPoseController = FindObjectOfType <TangoARPoseController>();
        m_tangoDynamicMesh = FindObjectOfType <TangoDynamicMesh>();

        m_areaDescriptionLoaderPanel.SetActive(true);
        m_meshBuildPanel.SetActive(false);
        m_meshInteractionPanel.SetActive(false);
        m_relocalizeImage.gameObject.SetActive(false);

        // Initialize tango application.
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);
            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
    }
Пример #15
0
    /// <summary>
    /// Use this for initialization.
    /// </summary>
    public void Start()
    {
#if UNITY_EDITOR
        // We must initialize this on the main Unity thread, since the value
        // is sometimes used within a separate saving thread.
        AreaDescription.GenerateEmulatedSavePath();
#endif

        m_tangoApplication = FindObjectOfType <TangoApplication>();

        if (m_tangoApplication != null)
        {
            m_tangoApplication.Register(this);

            if (AndroidHelper.IsTangoCorePresent())
            {
                m_tangoApplication.RequestPermissions();
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }
Пример #16
0
    /// <summary>
    /// Start is called on the frame when a script is enabled.
    /// </summary>
    public void Start()
    {
        m_tangoApplication = FindObjectOfType <TangoApplication>();
        m_tangoARScreen    = GetComponent <TangoARScreen>();

        if (m_tangoApplication != null)
        {
            if (AndroidHelper.IsTangoCorePresent())
            {
                // Request Tango permissions
                m_tangoApplication.Register(this);
                m_tangoApplication.RequestPermissions();
            }
            else
            {
                // If no Tango Core is present let's tell the user to install it!
                StartCoroutine(_InformUserNoTangoCore());
            }
        }
        else
        {
            Debug.Log("No Tango Manager found in scene.");
        }
    }