public async void OpenConfigScene()
    {
        IMixedRealitySceneSystem sceneSystem = MixedRealityToolkit.Instance.GetService <IMixedRealitySceneSystem>();
        await sceneSystem.LoadContent("ConfigScene", LoadSceneMode.Single);

        await sceneSystem.UnloadContent("MainScene");
    }
Example #2
0
    // unloads all listed scenes
    public void Unload(string[] SceneNames)
    {
        IMixedRealitySceneSystem sceneSystem = MixedRealityToolkit.Instance.GetService <IMixedRealitySceneSystem>();

        sceneSystem.UnloadContent(SceneNames);
        return;
    }
    private async void AcceptInput(string ip, string azureId, string azureKey, string azureDomain)
    {
#if WINDOWS_UWP
        if (String.IsNullOrEmpty(azureId) || String.IsNullOrEmpty(azureKey) || String.IsNullOrEmpty(azureDomain))
        {
            //Load from document.
            string filename = "asa_account_config.json";
            string path     = Application.persistentDataPath;
            string filePath = Path.Combine(path, filename);

            if (!File.Exists(filePath))
            {
                Toolkit.singleton.TriggerEvent("message_box_service",
                                               new MessageBoxContent(120, "Config file not found!", $"The path {filePath} does not lead to an existing file.\nYour input was:\nAure Id: {azureId}\nAure Key: {azureKey}\nAzure Domain: {azureDomain}", AcceptLastSubmittedInput, "Try again"));
                return;
            }

            string json = File.ReadAllText(filePath);

            try
            {
                AzureConfig config = JsonConvert.DeserializeObject <AzureConfig>(json);
                azureId     = config.AccountId;
                azureKey    = config.AccountKey;
                azureDomain = config.AccountDomain;
            }
            catch (Exception ex)
            {
                Toolkit.singleton.TriggerEvent("message_box_service",
                                               new MessageBoxContent(6, "Deserialiation failed!", $"An error occurred", AcceptLastSubmittedInput, "Try again"));
                return;
            }
        }
#endif

        PlayerPrefs.SetString("server_address", ip);
        PlayerPrefs.SetString("asa_account_id", azureId);
        PlayerPrefs.SetString("asa_account_key", azureKey);
        PlayerPrefs.SetString("asa_account_domain", azureDomain);

        PlayerPrefs.Save();

        IMixedRealitySceneSystem sceneSystem = MixedRealityToolkit.Instance.GetService <IMixedRealitySceneSystem>();
        await sceneSystem.LoadContent(SceneToLoadAfterConfiguration, LoadSceneMode.Single);

        await sceneSystem.UnloadContent("ConfigScene");
    }
 private async void ServiceContentUnload(IMixedRealitySceneSystem sceneSystem, string sceneName)
 {
     await sceneSystem.UnloadContent(sceneName);
 }