StartWWUWatcher() public static method

public static StartWWUWatcher ( ) : void
return void
コード例 #1
0
    private static void PostImportFunction()
    {
        EditorApplication.hierarchyWindowChanged += CheckWwiseGlobalExistance;
        EditorApplication.delayCall += CheckPicker;

        if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling)
        {
            return;
        }

        try
        {
            if (File.Exists(Application.dataPath + Path.DirectorySeparatorChar + WwiseSettings.WwiseSettingsFilename))
            {
                WwiseSetupWizard.Settings = WwiseSettings.LoadSettings();
                AkWwiseProjectInfo.GetData();
            }

            if (!string.IsNullOrEmpty(WwiseSetupWizard.Settings.WwiseProjectPath))
            {
                AkWwisePicker.PopulateTreeview();
                if (AkWwiseProjectInfo.GetData().autoPopulateEnabled)
                {
                    AkWwiseWWUBuilder.StartWWUWatcher();
                }
            }
        }
        catch (Exception e)
        {
            Debug.Log(e.ToString());
        }

        //Check if a WwiseGlobal object exists in the current scene
        CheckWwiseGlobalExistance();
    }
コード例 #2
0
    private static void PostImportFunction()
    {
#if UNITY_2018_1_OR_NEWER
        UnityEditor.EditorApplication.hierarchyChanged += CheckWwiseGlobalExistance;
#else
        UnityEditor.EditorApplication.hierarchyWindowChanged += CheckWwiseGlobalExistance;
#endif
        UnityEditor.EditorApplication.delayCall += CheckPicker;

        if (UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode || UnityEditor.EditorApplication.isCompiling)
        {
            return;
        }

        try
        {
            if (!string.IsNullOrEmpty(AkWwiseEditorSettings.Instance.WwiseProjectPath))
            {
                AkWwisePicker.PopulateTreeview();
                if (AkWwiseProjectInfo.GetData().autoPopulateEnabled)
                {
                    AkWwiseWWUBuilder.StartWWUWatcher();
                }
            }
        }
        catch (System.Exception e)
        {
            UnityEngine.Debug.Log(e.ToString());
        }

        //Check if a WwiseGlobal object exists in the current scene
        CheckWwiseGlobalExistance();
    }
コード例 #3
0
    public static void CheckPicker()
    {
        if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling)
        {
            // Skip if not in the right mode, wait for the next callback to see if we can proceed then.
            EditorApplication.delayCall += CheckPicker;
            return;
        }

        WwiseSettings settings = WwiseSettings.LoadSettings();

        if (!settings.CreatedPicker)
        {
            // Delete all the ghost tabs (Failed to load).
            EditorWindow[] windows = Resources.FindObjectsOfTypeAll <EditorWindow>();
            if (windows != null && windows.Length > 0)
            {
                foreach (EditorWindow window in windows)
                {
                    string windowTitle = window.titleContent.text;

                    if (windowTitle.Equals("Failed to load") || windowTitle.Equals("AkWwisePicker"))
                    {
                        try
                        {
                            window.Close();
                        }
                        catch (Exception)
                        {
                            // Do nothing here, this shoudn't cause any problem, however there has been
                            // occurences of Unity crashing on a null reference inside that method.
                        }
                    }
                }
            }

            ClearConsole();

            // TODO: If no scene is loaded and we are using the demo scene, automatically load it to display it.

            // Populate the picker
            AkWwiseProjectInfo.GetData();             // Load data
            if (!String.IsNullOrEmpty(settings.WwiseProjectPath))
            {
                AkWwiseProjectInfo.Populate();
                AkWwisePicker.init();

                if (AkWwiseProjectInfo.GetData().autoPopulateEnabled)
                {
                    AkWwiseWWUBuilder.StartWWUWatcher();
                }

                settings.CreatedPicker = true;
                WwiseSettings.SaveSettings(settings);
            }
        }

        EditorApplication.delayCall += CheckPendingExecuteMethod;
    }
コード例 #4
0
ファイル: AkWwisePicker.cs プロジェクト: frankvega2010/Fee
    public void OnGUI()
    {
        using (new UnityEngine.GUILayout.HorizontalScope("box"))
        {
            AkWwiseProjectInfo.GetData().autoPopulateEnabled =
                UnityEngine.GUILayout.Toggle(AkWwiseProjectInfo.GetData().autoPopulateEnabled, "Auto populate");

            if (AkWwiseProjectInfo.GetData().autoPopulateEnabled&& AkUtilities.IsWwiseProjectAvailable)
            {
                AkWwiseWWUBuilder.StartWWUWatcher();
            }
            else
            {
                AkWwiseWWUBuilder.StopWWUWatcher();
            }
            UnityEngine.GUILayout.FlexibleSpace();
            if (UnityEngine.GUILayout.Button("Refresh Project", UnityEngine.GUILayout.Width(200)))
            {
                treeView.SaveExpansionStatus();
                if (AkWwiseProjectInfo.Populate())
                {
                    PopulateTreeview();
                }
            }

            if (UnityEngine.GUILayout.Button("Generate SoundBanks", UnityEngine.GUILayout.Width(200)))
            {
                if (AkUtilities.IsSoundbankGenerationAvailable())
                {
                    AkUtilities.GenerateSoundbanks();
                }
                else
                {
                    string errorMessage;

#if UNITY_EDITOR_WIN
                    errorMessage =
                        "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Windows Installation Path from the Edit > Wwise Settings... menu.";
#elif UNITY_EDITOR_OSX
                    errorMessage =
                        "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Application from the Edit > Wwise Settings... menu.";
#endif

                    UnityEngine.Debug.LogError(errorMessage);
                }
            }
        }

        UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);

        treeView.DisplayTreeView(AK.Wwise.TreeView.TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

        if (UnityEngine.GUI.changed && AkUtilities.IsWwiseProjectAvailable)
        {
            UnityEditor.EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
        // TODO: RTP Parameters List
    }
コード例 #5
0
    public void OnGUI()
    {
        GUILayout.BeginHorizontal("Box");

        AkWwiseProjectInfo.GetData().autoPopulateEnabled = GUILayout.Toggle(AkWwiseProjectInfo.GetData().autoPopulateEnabled, "Auto populate");

        if (AkWwiseProjectInfo.GetData().autoPopulateEnabled&& WwiseProjectFound)
        {
            AkWwiseWWUBuilder.StartWWUWatcher();
        }
        else
        {
            AkWwiseWWUBuilder.StopWWUWatcher();
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Refresh Project", GUILayout.Width(200)))
        {
            treeView.SaveExpansionStatus();
            if (AkWwiseProjectInfo.Populate())
            {
                PopulateTreeview();
            }
        }

        if (GUILayout.Button("Generate SoundBanks", GUILayout.Width(200)))
        {
            if (AkUtilities.IsSoundbankGenerationAvailable())
            {
                AkUtilities.GenerateSoundbanks();
            }
            else
            {
                string errorMessage;

#if UNITY_EDITOR_WIN
                errorMessage = "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Windows Installation Path from the Edit > Wwise Settings... menu.";
#elif UNITY_EDITOR_OSX
                errorMessage = "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Application from the Edit > Wwise Settings... menu.";
#endif

                Debug.LogError(errorMessage);
            }
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        treeView.DisplayTreeView(TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

        if (GUI.changed && WwiseProjectFound)
        {
            EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
        // TODO: RTP Parameters List
    }
コード例 #6
0
    static void PostImportFunction()
    {
        EditorApplication.hierarchyWindowChanged += CheckWwiseGlobalExistance;

        if (EditorApplication.isPlayingOrWillChangePlaymode || EditorApplication.isCompiling)
        {
            return;
        }

        // Do nothing in batch mode
        string[] arguments = Environment.GetCommandLineArgs();
        if (Array.IndexOf(arguments, "-nographics") != -1)
        {
            return;
        }

        try
        {
            if (!File.Exists(Application.dataPath + Path.DirectorySeparatorChar + WwiseSettings.WwiseSettingsFilename))
            {
                WwiseSetupWizard.Init();
                return;
            }
            else
            {
                WwiseSetupWizard.Settings = WwiseSettings.LoadSettings();
                AkWwiseProjectInfo.GetData();
            }

            if (!string.IsNullOrEmpty(WwiseSetupWizard.Settings.WwiseProjectPath))
            {
                AkWwiseProjectInfo.Populate();
                AkWwisePicker.PopulateTreeview();
                if (AkWwiseProjectInfo.GetData().autoPopulateEnabled)
                {
                    AkWwiseWWUBuilder.StartWWUWatcher();
                }
            }
        }
        catch (Exception e)
        {
            Debug.Log(e.ToString());
        }

        //Check if a WwiseGlobal object exists in the current scene
        CheckWwiseGlobalExistance();

        // If demo scene, remove file that should only be there on import
        string filename = Path.Combine(Path.Combine(Path.Combine(Path.Combine(Application.dataPath, "Wwise"), "Editor"), "WwiseSetupWizard"), "AkWwisePopPicker.cs");

        if (File.Exists(filename))
        {
            EditorApplication.delayCall += DeletePopPicker;
        }
    }
コード例 #7
0
    public void OnGUI()
    {
        using (new UnityEngine.GUILayout.HorizontalScope("box"))
        {
            AkWwiseProjectInfo.GetData().autoPopulateEnabled =
                UnityEngine.GUILayout.Toggle(AkWwiseProjectInfo.GetData().autoPopulateEnabled, "Auto populate");

            if (AkWwiseProjectInfo.GetData().autoPopulateEnabled&& AkUtilities.IsWwiseProjectAvailable)
            {
                AkWwiseWWUBuilder.StartWWUWatcher();
            }
            else
            {
                AkWwiseWWUBuilder.StopWWUWatcher();
            }
            UnityEngine.GUILayout.FlexibleSpace();
            if (UnityEngine.GUILayout.Button("Refresh Project", UnityEngine.GUILayout.Width(200)))
            {
                treeView.SaveExpansionStatus();
                if (AkWwiseProjectInfo.Populate())
                {
                    PopulateTreeview();
                }
            }

            if (UnityEngine.GUILayout.Button("Generate SoundBanks", UnityEngine.GUILayout.Width(200)))
            {
                if (AkUtilities.IsSoundbankGenerationAvailable())
                {
                    AkUtilities.GenerateSoundbanks();
                }
                else
                {
                    UnityEngine.Debug.LogError("Access to Wwise is required to generate the SoundBanks. Please go to Edit > Project Settings... and set the Wwise Application Path found in the Wwise Editor view.");
                }
            }
        }

        UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);

        treeView.DisplayTreeView(AK.Wwise.TreeView.TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

        if (UnityEngine.GUI.changed && AkUtilities.IsWwiseProjectAvailable)
        {
            UnityEditor.EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
    }
コード例 #8
0
    public void OnGUI()
    {
        GUILayout.BeginHorizontal("Box");

        AkWwiseProjectInfo.GetData().autoPopulateEnabled = GUILayout.Toggle(AkWwiseProjectInfo.GetData().autoPopulateEnabled, "Auto populate");

        if (AkWwiseProjectInfo.GetData().autoPopulateEnabled&& WwiseProjectFound)
        {
            AkWwiseWWUBuilder.StartWWUWatcher();
        }
        else
        {
            AkWwiseWWUBuilder.StopWWUWatcher();
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Refresh Project", GUILayout.Width(200)))
        {
            treeView.SaveExpansionStatus();
            if (AkWwiseProjectInfo.Populate())
            {
                PopulateTreeview();
            }
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        treeView.DisplayTreeView(TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

        if (GUI.changed && WwiseProjectFound)
        {
            EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
        // TODO: RTP Parameters List
    }
コード例 #9
0
    public void OnGUI()
    {
        AkWwiseProjectInfo.DataSourceType ds;
        var buttonWidth = 150;

        using (new UnityEngine.GUILayout.HorizontalScope("box"))
        {
            ds = (AkWwiseProjectInfo.DataSourceType)UnityEditor.EditorGUILayout.EnumPopup(
                AkWwiseProjectInfo.GetData().currentDataSource, UnityEngine.GUILayout.Width(buttonWidth));
            UnityEngine.GUILayout.Space(5);

            var projectData = AkWwiseProjectInfo.GetData();

            if (ds != projectData.currentDataSource)
            {
                projectData.currentDataSource = ds;
                m_treeView.SetDataSource(AkWwiseProjectInfo.GetTreeData());
            }

            if (ds == AkWwiseProjectInfo.DataSourceType.FileSystem)
            {
                projectData.autoPopulateEnabled =
                    UnityEngine.GUILayout.Toggle(projectData.autoPopulateEnabled, "Auto populate");
            }
            else
            {
                projectData.AutoSyncSelection =
                    UnityEngine.GUILayout.Toggle(projectData.AutoSyncSelection, "Autosync selection");
                AkWwiseProjectInfo.WaapiPickerData.AutoSyncSelection = projectData.AutoSyncSelection;
            }

            UnityEngine.GUILayout.FlexibleSpace();

            if (UnityEngine.GUILayout.Button("Refresh Project", UnityEngine.GUILayout.Width(buttonWidth)))
            {
                if (ds == AkWwiseProjectInfo.DataSourceType.FileSystem)
                {
                    AkWwiseProjectInfo.Populate();
                }
                Refresh();
            }


            if (UnityEngine.GUILayout.Button("Generate SoundBanks", UnityEngine.GUILayout.Width(buttonWidth)))
            {
                if (AkUtilities.IsSoundbankGenerationAvailable())
                {
                    AkUtilities.GenerateSoundbanks();
                }
                else
                {
                    UnityEngine.Debug.LogError("Access to Wwise is required to generate the SoundBanks. Please go to Edit > Project Settings... and set the Wwise Application Path found in the Wwise Editor view.");
                }
            }

            if (projectData.autoPopulateEnabled && AkUtilities.IsWwiseProjectAvailable)
            {
                AkWwiseWWUBuilder.StartWWUWatcher();
            }
            else
            {
                AkWwiseWWUBuilder.StopWWUWatcher();
            }
        }

        using (new UnityEngine.GUILayout.HorizontalScope("box"))
        {
            var search_width = System.Math.Max(position.width / 3, buttonWidth * 2);

            if (ds == AkWwiseProjectInfo.DataSourceType.FileSystem)
            {
                m_treeView.StoredSearchString = m_SearchField.OnGUI(UnityEngine.GUILayoutUtility.GetRect(search_width, 20), m_treeView.StoredSearchString);
                UnityEngine.GUILayout.FlexibleSpace();
            }

            else
            {
                m_treeView.StoredSearchString = m_SearchField.OnGUI(UnityEngine.GUILayoutUtility.GetRect(search_width, 20), m_treeView.StoredSearchString);
                UnityEngine.GUILayout.FlexibleSpace();

                var labelStyle = new UnityEngine.GUIStyle();
                labelStyle.richText = true;
                UnityEngine.GUILayout.Label(AkWaapiUtilities.GetStatusString(), labelStyle);
            }
        }

        UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);


        UnityEngine.GUILayout.FlexibleSpace();
        UnityEngine.Rect lastRect = UnityEngine.GUILayoutUtility.GetLastRect();
        m_treeView.OnGUI(new UnityEngine.Rect(lastRect.x, lastRect.y, position.width, lastRect.height));

        if (UnityEngine.GUI.changed && AkUtilities.IsWwiseProjectAvailable)
        {
            UnityEditor.EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
    }
コード例 #10
0
    // Perform all necessary steps to use the Wwise Unity integration.
    public bool Setup()
    {
        bool NoErrorHappened = true;

        // 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())
        {
            EditorUtility.DisplayDialog("Warning", "Could not disable built-in audio. Please disable built-in audio by going to Project->Project Settings->Audio, and check \"Disable Audio\".", "Ok");
        }

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

        // 4. Set the script order of AkInitializer, AkTerminator, AkGameObj, AkBankLoad (before default time), AkAudioListener by changing the .meta file
        if (!SetAllScriptExecutionOrder())
        {
            EditorUtility.DisplayDialog("Error", "Could not change script exec order!", "Ok");
            NoErrorHappened = false;
        }

        // 5. Add AkAudioListener component to camera
        if (!Settings.OldProject)
        {
            SetListener();
        }

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

#if !UNITY_5
        // 7. Install the Profile libraries of the installed platforms. This should actually be a change in the way we build unitypackages.
        if (!InstallAllPlatformProfilePlugins())
        {
            EditorUtility.DisplayDialog("Error", "Could not install some platform plugins!", "Ok");
            NoErrorHappened = false;
        }
#else
        AkPluginActivator.ActivatePlugins(AkPluginActivator.CONFIG_PROFILE, true);
#endif

        // 8. Verify DirectX is installed (windows only)
#if UNITY_EDITOR_WIN
        Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\DirectX\\");
        if (key == null)
        {
            EditorUtility.DisplayDialog("Warning", "Detected the DirectX End-User Runtime is not installed. You might have issues using the Windows version of the plugin", "Ok");
        }
#endif
        // 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())
        {
            EditorUtility.DisplayDialog("Warning", "Could not modify Wwise Project to generate the header file!", "Ok");
        }

        // 11. Generate the WwiseIDs.cs file from the .h file
        // GenerateWwiseIDsCsFile();

        // 12. Refresh UI/Settings files.
        Repaint();

        // 13. Make sure the installed SDK matches the one that was build on the machine
        string[] arguments = Environment.GetCommandLineArgs();
        if (Array.IndexOf(arguments, "-nographics") == -1)
        {
            ValidateVersion();
        }

        // 14. Enable Xbox One profiling sockets
        AkXboxOneUtils.EnableXboxOneNetworkSockets();

        // 15. Populate the picker
        AkWwiseProjectInfo.GetData(); // Load data
        if (!String.IsNullOrEmpty(Settings.WwiseProjectPath))
        {
            AkWwiseProjectInfo.Populate();
            AkWwisePicker.PopulateTreeview();
            if (AkWwiseProjectInfo.GetData().autoPopulateEnabled)
            {
                AkWwiseWWUBuilder.StartWWUWatcher();
            }
        }

        return(NoErrorHappened);
    }