DeactivateAllPlugins() public static method

public static DeactivateAllPlugins ( ) : void
return void
Ejemplo n.º 1
0
    public static void PerformMigration(int migrateStart, int migrateStop)
    {
        UpdateProgressBar(0f);

        UnityEngine.Debug.Log("WwiseUnity: Migrating incrementally to versions " + migrateStart + " up to " + migrateStop);

        AkPluginActivator.DeactivateAllPlugins();
        AkPluginActivator.Update();
        AkPluginActivator.ActivatePluginsForEditor();

        // Get the name of the currently opened scene.
        var currentScene = AkSceneUtils.GetCurrentScene().Replace('/', '\\');

        var files =
            new System.IO.DirectoryInfo(UnityEngine.Application.dataPath + "/Wwise/Deployment/Components").GetFiles("*.cs",
                                                                                                                    System.IO.SearchOption.AllDirectories);
        var sceneInfo =
            new System.IO.DirectoryInfo(UnityEngine.Application.dataPath).GetFiles("*.unity",
                                                                                   System.IO.SearchOption.AllDirectories);
        var scenes = new string[sceneInfo.Length];

        AkSceneUtils.CreateNewScene();
        AkUtilities.IsMigrating = true;

        for (var i = 0; i < scenes.Length; i++)
        {
            UpdateProgressBar((float)i / scenes.Length);

            var scene = "Assets" + sceneInfo[i].FullName.Substring(UnityEngine.Application.dataPath.Length);
            UnityEngine.Debug.Log("WwiseUnity: Migrating scene " + scene);

            AkSceneUtils.OpenExistingScene(scene);
            MigrateCurrentScene(files, migrateStart - 1, migrateStop - 1);
            AkSceneUtils.SaveCurrentScene(null);
        }

        UpdateProgressBar(1.0f);

        AkSceneUtils.CreateNewScene();

        AkUtilities.IsMigrating = false;

        // Reopen the scene that was opened before the migration process started.
        AkSceneUtils.OpenExistingScene(currentScene);

        UnityEngine.Debug.Log("WwiseUnity: Removing lock for launcher.");

        // TODO: Moving one folder up is not nice at all. How to find the current project path?
        try
        {
            System.IO.File.Delete(UnityEngine.Application.dataPath + "/../.WwiseLauncherLockFile");
        }
        catch (System.Exception)
        {
            // Ignore if not present.
        }

        UnityEditor.EditorUtility.ClearProgressBar();
    }
    public static void PerformMigration(int migrateStart)
    {
        UpdateProgressBar(0);

        UnityEngine.Debug.Log("WwiseUnity: Migrating from Unity Integration Version " + migrateStart + " to " + AkUtilities.MigrationStopIndex);

        AkPluginActivator.DeactivateAllPlugins();
        AkPluginActivator.Update();
        AkPluginActivator.ActivatePluginsForEditor();

        // Get the name of the currently opened scene.
        var activeScene     = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
        var loadedScenePath = activeScene.path;

        if (!string.IsNullOrEmpty(loadedScenePath))
        {
            AkBasePathGetter.FixSlashes(ref loadedScenePath, '\\', '/', false);
        }

        UnityEditor.SceneManagement.EditorSceneManager.NewScene(UnityEditor.SceneManagement.NewSceneSetup.DefaultGameObjects);

        // obtain a list of ScriptableObjects before any migration is performed
        ScriptableObjectGuids = UnityEditor.AssetDatabase.FindAssets("t:ScriptableObject", new[] { "Assets" });

        AkUtilities.BeginMigration(migrateStart);
        AkWwiseProjectInfo.GetData().Migrate();
        AkWwiseWWUBuilder.UpdateWwiseObjectReferenceData();

        MigratePrefabs();
        MigrateScenes();
        MigrateScriptableObjects();

        UnityEditor.EditorUtility.UnloadUnusedAssetsImmediate();

        UnityEditor.SceneManagement.EditorSceneManager.NewScene(UnityEditor.SceneManagement.NewSceneSetup.DefaultGameObjects);
        AkUtilities.EndMigration();

        UpdateProgressBar(TotalNumberOfSections);

        // Reopen the scene that was opened before the migration process started.
        if (!string.IsNullOrEmpty(loadedScenePath))
        {
            UnityEditor.SceneManagement.EditorSceneManager.OpenScene(loadedScenePath);
        }

        UnityEngine.Debug.Log("WwiseUnity: Removing lock for launcher.");

        // TODO: Moving one folder up is not nice at all. How to find the current project path?
        try
        {
            System.IO.File.Delete(UnityEngine.Application.dataPath + "/../.WwiseLauncherLockFile");
        }
        catch (System.Exception)
        {
            // Ignore if not present.
        }

        UnityEditor.EditorUtility.ClearProgressBar();
    }
Ejemplo n.º 3
0
    public static void ModifySetup()
    {
        string currentConfig = AkPluginActivator.GetCurrentConfig();

        if (String.IsNullOrEmpty(currentConfig))
        {
            currentConfig = AkPluginActivator.CONFIG_PROFILE;
        }

        AkPluginActivator.DeactivateAllPlugins();
        AkPluginActivator.Update();
        AkPluginActivator.ActivatePlugins(currentConfig, true);
    }
Ejemplo n.º 4
0
    // Perform all necessary steps to use the Wwise Unity integration.
    private static void Setup()
    {
        UnityEditor.SceneManagement.EditorSceneManager.NewScene(UnityEditor.SceneManagement.NewSceneSetup.DefaultGameObjects);

        AkPluginActivator.DeactivateAllPlugins();

        // 0. Make sure the SoundBank directory exists
        var sbPath = AkUtilities.GetFullPath(UnityEngine.Application.streamingAssetsPath, AkWwiseEditorSettings.Instance.SoundbankPath);

        if (!System.IO.Directory.Exists(sbPath))
        {
            System.IO.Directory.CreateDirectory(sbPath);
        }

        // 1. Disable built-in audio
        if (!DisableBuiltInAudio())
        {
            UnityEngine.Debug.LogWarning(
                "WwiseUnity: Could not disable built-in audio. Please disable built-in audio by going to Project->Project Settings->Audio, and check \"Disable Audio\".");
        }

        // 2. Create a "WwiseGlobal" game object and set the AkSoundEngineInitializer and terminator scripts
        // 3. Set the SoundBank path property on AkSoundEngineInitializer
        CreateWwiseGlobalObject();

        // 5. Disable the built-in audio listener, and add AkAudioListener component to camera
        if (AkWwiseEditorSettings.Instance.CreateWwiseListener)
        {
            AddAkAudioListenerToMainCamera();
        }

        // 6. Enable "Run In Background" in PlayerSettings (PlayerSettings.runInbackground property)
        UnityEditor.PlayerSettings.runInBackground = true;

        AkPluginActivator.Update();
        AkPluginActivator.ActivatePluginsForEditor();

        // 9. Activate WwiseIDs file generation, and point Wwise to the Assets/Wwise folder
        // 10. Change the SoundBanks options so it adds Max Radius information in the Wwise project
        if (!SetSoundbankSettings())
        {
            UnityEngine.Debug.LogWarning("WwiseUnity: Could not modify Wwise Project to generate the header file!");
        }

        // 11. Activate XboxOne network sockets.
        AkXboxOneUtils.EnableXboxOneNetworkSockets();
    }
Ejemplo n.º 5
0
    // Perform all necessary steps to use the Wwise Unity integration.
    private static void Setup()
    {
        AkPluginActivator.DeactivateAllPlugins();

        // 0. Make sure the soundbank directory exists
        string sbPath = AkUtilities.GetFullPath(Application.streamingAssetsPath, Settings.SoundbankPath);

        if (!Directory.Exists(sbPath))
        {
            Directory.CreateDirectory(sbPath);
        }

        // 1. Disable built-in audio
        if (!DisableBuiltInAudio())
        {
            Debug.LogWarning("WwiseUnity: Could not disable built-in audio. Please disable built-in audio by going to Project->Project Settings->Audio, and check \"Disable Audio\".");
        }

        // 2. Create a "WwiseGlobal" game object and set the AkSoundEngineInitializer and terminator scripts
        // 3. Set the SoundBank path property on AkSoundEngineInitializer
        CreateWwiseGlobalObject();

        // 5. Add AkAudioListener component to camera
        SetListener();

        // 6. Enable "Run In Background" in PlayerSettings (PlayerSettings.runInbackground property)
        PlayerSettings.runInBackground = true;

        AkPluginActivator.Update();
        AkPluginActivator.ActivatePlugins(AkPluginActivator.CONFIG_PROFILE, true);

        // 9. Activate WwiseIDs file generation, and point Wwise to the Assets/Wwise folder
        // 10. Change the SoundBanks options so it adds Max Radius information in the Wwise project
        if (!SetSoundbankSettings())
        {
            Debug.LogWarning("WwiseUnity: Could not modify Wwise Project to generate the header file!");
        }

        // 11. Activate XboxOne network sockets.
        AkXboxOneUtils.EnableXboxOneNetworkSockets();
    }