コード例 #1
0
    /// <summary>
    /// Internal callback when a permissions event happens.
    /// </summary>
    /// <param name="permissionsGranted">If set to <c>true</c> permissions granted.</param>
    private void _OnTangoApplicationPermissionsEvent(bool permissionsGranted)
    {
        if (permissionsGranted)
        {
            m_tangoApplication.InitApplication();

            // Load the most recent ADF.
            PoseProvider.RefreshADFList();
            UUIDUnityHolder latestAreaDescription = PoseProvider.GetLatestADFUUID();
            if (latestAreaDescription != null)
            {
                string uuid = latestAreaDescription.GetStringDataUUID();
                m_tangoApplication.InitProviders(uuid);
            }
            else
            {
                m_tangoApplication.InitProviders(null);
            }

            m_tangoApplication.ConnectToService();
        }
        else
        {
            AndroidHelper.ShowAndroidToastMessage("Motion Tracking and Area Learning Permissions Needed", true);
        }
    }
コード例 #2
0
    void Update()
    {
        if (startedSaving)
        {
            if (keyboard.done)
            {
                savedAdfHolder = new UUIDUnityHolder();
                keyboardString = keyboard.text;
                PoseProvider.SaveAreaDescription(savedAdfHolder);
                PoseProvider.GetAreaDescriptionMetaData(savedAdfHolder);
                PoseProvider.AreaDescriptionMetaData_set(Common.MetaDataKeyType.KEY_NAME, keyboardString, savedAdfHolder);
                PoseProvider.SaveAreaDescriptionMetaData(savedAdfHolder);

                // Null terminator will cause invalid argument in the file system.
                string uuid = savedAdfHolder.GetStringDataUUID().Replace("\0", "");
                string path = Application.persistentDataPath + "/" + uuid;
                FileParser.SaveBuildingDataToPath(BuildingManager.instance.buildingList, path);
                EventManager.instance.GameDataSaved(true);
                startedSaving = false;
            }
        }
    }