MakeRelativePath() public static method

public static MakeRelativePath ( string fromPath, string toPath ) : string
fromPath string
toPath string
return string
Esempio n. 1
0
    // Modify the .wproj file to set needed soundbank settings
    private static bool SetSoundbankSettings()
    {
        if (string.IsNullOrEmpty(Settings.WwiseProjectPath))
        {
            return(true);
        }

        var r             = new System.Text.RegularExpressions.Regex("_WwiseIntegrationTemp.*?([/\\\\])");
        var SoundbankPath = AkUtilities.GetFullPath(r.Replace(UnityEngine.Application.streamingAssetsPath, "$1"),
                                                    Settings.SoundbankPath);
        var WprojPath = AkUtilities.GetFullPath(UnityEngine.Application.dataPath, Settings.WwiseProjectPath);

#if UNITY_EDITOR_OSX
        SoundbankPath = "Z:" + SoundbankPath;
#endif

        SoundbankPath = AkUtilities.MakeRelativePath(System.IO.Path.GetDirectoryName(WprojPath), SoundbankPath);
        if (AkUtilities.EnableBoolSoundbankSettingInWproj("SoundBankGenerateHeaderFile", WprojPath))
        {
            if (AkUtilities.SetSoundbankHeaderFilePath(WprojPath, SoundbankPath))
            {
                return(AkUtilities.EnableBoolSoundbankSettingInWproj("SoundBankGenerateMaxAttenuationInfo", WprojPath));
            }
        }

        return(false);
    }
Esempio n. 2
0
    // Load the WwiseSettings structure from a serialized XML file
    public static WwiseSettings LoadSettings(bool ForceLoad = false)
    {
        if (s_Instance != null && !ForceLoad)
        {
            return(s_Instance);
        }

        WwiseSettings Settings = new WwiseSettings();

        try
        {
            if (File.Exists(Path.Combine(Application.dataPath, WwiseSettingsFilename)))
            {
                XmlSerializer xmlSerializer = new XmlSerializer(Settings.GetType());
                FileStream    xmlFileStream = new FileStream(Application.dataPath + "/" + WwiseSettingsFilename, FileMode.Open, FileAccess.Read);
                Settings = (WwiseSettings)xmlSerializer.Deserialize(xmlFileStream);
                xmlFileStream.Close();
            }
            else
            {
                string   projectDir         = Path.GetDirectoryName(Application.dataPath);
                string[] foundWwiseProjects = Directory.GetFiles(projectDir, "*.wproj", SearchOption.AllDirectories);

                if (foundWwiseProjects.Length == 0)
                {
                    Settings.WwiseProjectPath = "";
                }
                else
                {
                    // MONO BUG: https://github.com/mono/mono/pull/471
                    // In the editor, Application.dataPath returns <Project Folder>/Assets. There is a bug in
                    // mono for method Uri.GetRelativeUri where if the path ends in a folder, it will
                    // ignore the last part of the path. Thus, we need to add fake depth to get the "real"
                    // relative path.
                    Settings.WwiseProjectPath = AkUtilities.MakeRelativePath(Application.dataPath + "/fake_depth", foundWwiseProjects[0]);
                }

                Settings.SoundbankPath = AkInitializer.c_DefaultBasePath;
            }

            s_Instance = Settings;
        }
        catch (Exception)
        {
        }

        return(Settings);
    }
Esempio n. 3
0
    // Load the WwiseSettings structure from a serialized XML file
    public static WwiseSettings LoadSettings(bool ForceLoad = false)
    {
        if (s_Instance != null && !ForceLoad)
        {
            return(s_Instance);
        }

        var Settings = new WwiseSettings();

        try
        {
            if (System.IO.File.Exists(System.IO.Path.Combine(UnityEngine.Application.dataPath, WwiseSettingsFilename)))
            {
                var xmlSerializer = new System.Xml.Serialization.XmlSerializer(Settings.GetType());
                var xmlFileStream = new System.IO.FileStream(UnityEngine.Application.dataPath + "/" + WwiseSettingsFilename,
                                                             System.IO.FileMode.Open, System.IO.FileAccess.Read);
                Settings = (WwiseSettings)xmlSerializer.Deserialize(xmlFileStream);
                xmlFileStream.Close();
            }
            else
            {
                var projectDir         = System.IO.Path.GetDirectoryName(UnityEngine.Application.dataPath);
                var foundWwiseProjects = System.IO.Directory.GetFiles(projectDir, "*.wproj", System.IO.SearchOption.AllDirectories);

                if (foundWwiseProjects.Length == 0)
                {
                    Settings.WwiseProjectPath = "";
                }
                else
                {
                    Settings.WwiseProjectPath =
                        AkUtilities.MakeRelativePath(UnityEngine.Application.dataPath, foundWwiseProjects[0]);
                }

                Settings.SoundbankPath = AkSoundEngineController.s_DefaultBasePath;
            }

            s_Instance = Settings;
        }
        catch (System.Exception)
        {
        }

        return(Settings);
    }
            public override void OnGUI(string searchContext)

            {
                bool changed = false;

                var labelWidth = UnityEditor.EditorGUIUtility.labelWidth;

                UnityEditor.EditorGUIUtility.labelWidth += 100;

                var settings = Instance;

                UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);
                UnityEngine.GUILayout.Label(Styles.AddressablesSettings, UnityEditor.EditorStyles.boldLabel);
                UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);

                UnityEditor.EditorGUI.BeginChangeCheck();

                using (new UnityEngine.GUILayout.VerticalScope("box"))
                {
                    bool newValue = UnityEditor.EditorGUILayout.Toggle(Styles.UseSampleMetadataPreserver, settings.UseSampleMetadataPreserver);
                    if (settings.UseSampleMetadataPreserver != newValue)
                    {
                        settings.UseSampleMetadataPreserver = newValue;
                        if (settings.UseSampleMetadataPreserver)
                        {
                            WwiseAddressableAssetMetadataPreserver.BindMetadataDelegate();
                        }
                        else
                        {
                            WwiseAddressableAssetMetadataPreserver.UnbindMetaDataDelegate();
                        }
                    }
                    UnityEngine.GUILayout.Space(UnityEditor.EditorGUIUtility.standardVerticalSpacing);

                    using (new UnityEngine.GUILayout.HorizontalScope())
                    {
                        if (settings.UseSampleMetadataPreserver)
                        {
                            UnityEditor.EditorGUILayout.PrefixLabel(Styles.MetadataPath);
                            UnityEditor.EditorGUILayout.SelectableLabel(settings.MetadataPath, Styles.TextField, UnityEngine.GUILayout.Height(17));
                            if (Ellipsis())
                            {
                                var OpenInPath      = System.IO.Path.GetDirectoryName(AkUtilities.GetFullPath(UnityEngine.Application.dataPath, settings.MetadataPath));
                                var MetadataPathNew = UnityEditor.EditorUtility.OpenFolderPanel("Select your metadata Project", OpenInPath, "WwiseAddressableMetadata");
                                if (MetadataPathNew.Length != 0)
                                {
                                    settings.MetadataPath = AkUtilities.MakeRelativePath(UnityEngine.Application.dataPath, MetadataPathNew);
                                    changed = true;
                                }
                            }
                        }
                    }
                }


                if (UnityEditor.EditorGUI.EndChangeCheck())
                {
                    changed = true;
                }

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

                UnityEditor.EditorGUIUtility.labelWidth = labelWidth;

                if (changed)
                {
                    settings.SaveSettings();
                }
            }
Esempio n. 5
0
    public void DrawSettingsPart()
    {
        string description;
        string tooltip;

        GUILayout.Label("Wwise Project", EditorStyles.boldLabel);
        GUILayout.BeginHorizontal("box");
        description = "Wwise Project Path*:";
        tooltip     = "Location of the Wwise project associated with this game. It is recommended to put it in the Unity Project root folder, outside the Assets folder.";
        GUILayout.Label(new GUIContent(description, tooltip), GUILayout.Width(330));
        EditorGUILayout.SelectableLabel(WwiseSetupWizard.Settings.WwiseProjectPath, "textfield", GUILayout.Height(17));
        if (GUILayout.Button("...", GUILayout.Width(30)))
        {
            string OpenInPath          = Path.GetDirectoryName(AkUtilities.GetFullPath(Application.dataPath, WwiseSetupWizard.Settings.WwiseProjectPath));
            string WwiseProjectPathNew = EditorUtility.OpenFilePanel("Select your Wwise Project", OpenInPath, "wproj");
            if (WwiseProjectPathNew.Length != 0)
            {
                if (WwiseProjectPathNew.EndsWith(".wproj") == false)
                {
                    EditorUtility.DisplayDialog("Error", "Please select a valid .wproj file", "Ok");
                }
                else
                {
                    // No need to check if the file exists (the FilePanel does it for us).

                    // MONO BUG: https://github.com/mono/mono/pull/471
                    // In the editor, Application.dataPath returns <Project Folder>/Assets. There is a bug in
                    // mono for method Uri.GetRelativeUri where if the path ends in a folder, it will
                    // ignore the last part of the path. Thus, we need to add fake depth to get the "real"
                    // relative path.
                    WwiseSetupWizard.Settings.WwiseProjectPath = AkUtilities.MakeRelativePath(Application.dataPath + "/fake_depth", WwiseProjectPathNew);
                }
            }
            Repaint();
        }

        GUILayout.EndHorizontal();

        string labelTitle;

#if UNITY_EDITOR_OSX
        description = "Wwise Application:";
        tooltip     = "Location of the Wwise Application. This is required to generate the SoundBanks in Unity.";
        labelTitle  = "Wwise Application";
#else
        description = "Wwise Windows Installation Path:";
        tooltip     = "Location of the Wwise Windows Installation Path. This is required to generate the SoundBanks in Unity.";
        labelTitle  = "Wwise Windows Installation Path";
#endif

        GUILayout.Label(labelTitle);

        GUILayout.BeginHorizontal("box");


        GUILayout.Label(new GUIContent(description, tooltip), GUILayout.Width(330));

        string wwiseInstallationPath;

#if UNITY_EDITOR_OSX
        wwiseInstallationPath = WwiseSetupWizard.Settings.WwiseInstallationPathMac;
#else
        wwiseInstallationPath = WwiseSetupWizard.Settings.WwiseInstallationPathWindows;
#endif

        EditorGUILayout.SelectableLabel(wwiseInstallationPath, "textfield", GUILayout.Height(17));

        if (GUILayout.Button("...", GUILayout.Width(30)))
        {
#if UNITY_EDITOR_OSX
            string installationPathNew = EditorUtility.OpenFilePanel("Select your Wwise application.", "/Applications/", "");
#else
            string installationPathNew = EditorUtility.OpenFolderPanel("Select your Wwise application.", Environment.GetEnvironmentVariable("ProgramFiles(x86)"), "");
#endif

            if (installationPathNew.Length != 0)
            {
                wwiseInstallationPath = Path.GetFullPath(installationPathNew);

#if UNITY_EDITOR_OSX
                WwiseSetupWizard.Settings.WwiseInstallationPathMac = wwiseInstallationPath;
#else
                WwiseSetupWizard.Settings.WwiseInstallationPathWindows = wwiseInstallationPath;
#endif
            }

            Repaint();
        }

        GUILayout.EndHorizontal();

        GUILayout.Label("Asset Management", EditorStyles.boldLabel);
        GUILayout.BeginVertical("box");
        GUILayout.BeginHorizontal();
        description = "SoundBanks Path* (relative to StreamingAssets folder):";
        tooltip     = "Location of the SoundBanks are for the game. This has to reside within the StreamingAssets folder.";
        GUILayout.Label(new GUIContent(description, tooltip), GUILayout.Width(330));
        EditorGUILayout.SelectableLabel(WwiseSetupWizard.Settings.SoundbankPath, "textfield", GUILayout.Height(17));
        if (GUILayout.Button("...", GUILayout.Width(30)))
        {
            string OpenInPath       = Path.GetDirectoryName(AkUtilities.GetFullPath(Application.streamingAssetsPath, WwiseSetupWizard.Settings.SoundbankPath));
            string SoundbankPathNew = EditorUtility.OpenFolderPanel("Select your SoundBanks destination folder", OpenInPath, "");
            if (SoundbankPathNew.Length != 0)
            {
                int      stremingAssetsIndex = Application.dataPath.Split('/').Length;
                string[] folders             = SoundbankPathNew.Split('/');

                if (folders.Length - 1 < stremingAssetsIndex || !String.Equals(folders[stremingAssetsIndex], "StreamingAssets", StringComparison.OrdinalIgnoreCase))
                {
                    EditorUtility.DisplayDialog("Error", "The soundbank destination folder must be located within the Unity project 'StreamingAssets' folder.", "Ok");
                }
                else
                {
                    // MONO BUG: https://github.com/mono/mono/pull/471
                    // Need to add fake depth to the streaming assets path because of this bug. Directories should end in /.
                    WwiseSetupWizard.Settings.SoundbankPath = AkUtilities.MakeRelativePath(Application.streamingAssetsPath + "/fake_depth", SoundbankPathNew) + "/";
                }
            }
            Repaint();
        }
        GUILayout.EndHorizontal();
        description = "Create WwiseGlobal GameObject";
        tooltip     = "The WwiseGlobal object is a GameObject that contains the Initializing and Terminating scripts for the Wwise Sound Engine. In the Editor workflow, it is added to every scene, so that it can be properly be previewed in the Editor. In the game, only one instance is created, in the first scene, and it is persisted throughout the game. It is recommended to leave this box checked.";
        WwiseSetupWizard.Settings.CreateWwiseGlobal = GUILayout.Toggle(WwiseSetupWizard.Settings.CreateWwiseGlobal, new GUIContent(description, tooltip));

        description = "Add Ak Audio Listener to Main Camera";
        tooltip     = "In order for positioning to work, the Ak Audio Listener script needs to be attached to the main camera in every scene. If you wish for your listener to be attached to another GameObject, uncheck this box";
        WwiseSetupWizard.Settings.CreateWwiseListener = GUILayout.Toggle(WwiseSetupWizard.Settings.CreateWwiseListener, new GUIContent(description, tooltip));

        GUILayout.EndVertical();


        GUILayout.BeginHorizontal();
        GUILayout.Label("* Mandatory settings");
        GUILayout.EndHorizontal();

        GUILayout.BeginHorizontal();
        GUILayout.EndHorizontal();
    }
Esempio n. 6
0
    public void DrawSettingsPart()
    {
        string description;
        string tooltip;
        string labelTitle;

        description = "Wwise Project Path*:";
        tooltip     =
            "Location of the Wwise project associated with this game. It is recommended to put it in the Unity Project root folder, outside the Assets folder.";
        labelTitle = "Wwise Project";

        UnityEngine.GUILayout.Label(labelTitle, UnityEditor.EditorStyles.boldLabel);

        using (new UnityEngine.GUILayout.HorizontalScope("box"))
        {
            UnityEngine.GUILayout.Label(new UnityEngine.GUIContent(description, tooltip), UnityEngine.GUILayout.Width(330));
            UnityEditor.EditorGUILayout.SelectableLabel(WwiseSetupWizard.Settings.WwiseProjectPath, "textfield",
                                                        UnityEngine.GUILayout.Height(17));
            if (UnityEngine.GUILayout.Button("...", UnityEngine.GUILayout.Width(30)))
            {
                var OpenInPath = System.IO.Path.GetDirectoryName(AkUtilities.GetFullPath(UnityEngine.Application.dataPath,
                                                                                         WwiseSetupWizard.Settings.WwiseProjectPath));
                var WwiseProjectPathNew = UnityEditor.EditorUtility.OpenFilePanel("Select your Wwise Project", OpenInPath, "wproj");
                if (WwiseProjectPathNew.Length != 0)
                {
                    if (WwiseProjectPathNew.EndsWith(".wproj") == false)
                    {
                        UnityEditor.EditorUtility.DisplayDialog("Error", "Please select a valid .wproj file", "Ok");
                    }
                    else
                    {
                        WwiseSetupWizard.Settings.WwiseProjectPath =
                            AkUtilities.MakeRelativePath(UnityEngine.Application.dataPath, WwiseProjectPathNew);
                    }
                }

                Repaint();
            }
        }

#if UNITY_EDITOR_OSX
        description = "Wwise Application:";
        tooltip     = "Location of the Wwise Application. This is required to generate the SoundBanks in Unity.";
        labelTitle  = "Wwise Application";
#else
        description = "Wwise Windows Installation Path:";
        tooltip     = "Location of the Wwise Windows Installation Path. This is required to generate the SoundBanks in Unity.";
        labelTitle  = "Wwise Windows Installation Path";
#endif

        UnityEngine.GUILayout.Label(labelTitle, UnityEditor.EditorStyles.boldLabel);

        using (new UnityEngine.GUILayout.HorizontalScope("box"))
        {
            UnityEngine.GUILayout.Label(new UnityEngine.GUIContent(description, tooltip), UnityEngine.GUILayout.Width(330));

            string wwiseInstallationPath;

#if UNITY_EDITOR_OSX
            wwiseInstallationPath = WwiseSetupWizard.Settings.WwiseInstallationPathMac;
#else
            wwiseInstallationPath = WwiseSetupWizard.Settings.WwiseInstallationPathWindows;
#endif

            UnityEditor.EditorGUILayout.SelectableLabel(wwiseInstallationPath, "textfield", UnityEngine.GUILayout.Height(17));

            if (UnityEngine.GUILayout.Button("...", UnityEngine.GUILayout.Width(30)))
            {
#if UNITY_EDITOR_OSX
                var installationPathNew = UnityEditor.EditorUtility.OpenFilePanel("Select your Wwise application.",
                                                                                  "/Applications/", "");
#else
                var installationPathNew = UnityEditor.EditorUtility.OpenFolderPanel("Select your Wwise application.",
                                                                                    System.Environment.GetEnvironmentVariable("ProgramFiles(x86)"), "");
#endif

                if (installationPathNew.Length != 0)
                {
                    wwiseInstallationPath = System.IO.Path.GetFullPath(installationPathNew);

#if UNITY_EDITOR_OSX
                    WwiseSetupWizard.Settings.WwiseInstallationPathMac = wwiseInstallationPath;
#else
                    WwiseSetupWizard.Settings.WwiseInstallationPathWindows = wwiseInstallationPath;
#endif
                }

                Repaint();
            }
        }

        description = "SoundBanks Path* (relative to StreamingAssets folder):";
        tooltip     = "Location of the SoundBanks are for the game. This has to reside within the StreamingAssets folder.";
        labelTitle  = "Asset Management";

        UnityEngine.GUILayout.Label(labelTitle, UnityEditor.EditorStyles.boldLabel);

        using (new UnityEngine.GUILayout.VerticalScope("box"))
        {
            using (new UnityEngine.GUILayout.HorizontalScope())
            {
                UnityEngine.GUILayout.Label(new UnityEngine.GUIContent(description, tooltip), UnityEngine.GUILayout.Width(330));
                UnityEditor.EditorGUILayout.SelectableLabel(WwiseSetupWizard.Settings.SoundbankPath, "textfield",
                                                            UnityEngine.GUILayout.Height(17));

                if (UnityEngine.GUILayout.Button("...", UnityEngine.GUILayout.Width(30)))
                {
                    var OpenInPath = System.IO.Path.GetDirectoryName(
                        AkUtilities.GetFullPath(UnityEngine.Application.streamingAssetsPath, WwiseSetupWizard.Settings.SoundbankPath));
                    var SoundbankPathNew =
                        UnityEditor.EditorUtility.OpenFolderPanel("Select your SoundBanks destination folder", OpenInPath, "");
                    if (SoundbankPathNew.Length != 0)
                    {
                        var stremingAssetsIndex = UnityEngine.Application.dataPath.Split('/').Length;
                        var folders             = SoundbankPathNew.Split('/');

                        if (folders.Length - 1 < stremingAssetsIndex || !string.Equals(folders[stremingAssetsIndex], "StreamingAssets",
                                                                                       System.StringComparison.OrdinalIgnoreCase))
                        {
                            UnityEditor.EditorUtility.DisplayDialog("Error",
                                                                    "The soundbank destination folder must be located within the Unity project 'StreamingAssets' folder.", "Ok");
                        }
                        else
                        {
                            WwiseSetupWizard.Settings.SoundbankPath =
                                AkUtilities.MakeRelativePath(UnityEngine.Application.streamingAssetsPath, SoundbankPathNew) +
                                "/";
                        }
                    }

                    Repaint();
                }
            }

#if UNITY_5_6_OR_NEWER
            description = "Enable copying of soundbanks at pre-Build step";
            tooltip     =
                "Copies the soundbanks in the appropriate location for building and deployment. It is recommended to leave this box checked.";
            WwiseSetupWizard.Settings.CopySoundBanksAsPreBuildStep = UnityEngine.GUILayout.Toggle(
                WwiseSetupWizard.Settings.CopySoundBanksAsPreBuildStep, new UnityEngine.GUIContent(description, tooltip));

            UnityEngine.GUI.enabled = WwiseSetupWizard.Settings.CopySoundBanksAsPreBuildStep;

            description = "Enable soundbank generation at pre-Build step";
            tooltip     =
                "Generates the soundbanks before copying them during pre-Build step. It is recommended to leave this box unchecked if soundbanks are generated on a specific build machine.";
            WwiseSetupWizard.Settings.GenerateSoundBanksAsPreBuildStep = UnityEngine.GUILayout.Toggle(
                WwiseSetupWizard.Settings.GenerateSoundBanksAsPreBuildStep, new UnityEngine.GUIContent(description, tooltip));

            UnityEngine.GUI.enabled = true;
#endif

            description = "Create WwiseGlobal GameObject";
            tooltip     =
                "The WwiseGlobal object is a GameObject that contains the Initializing and Terminating scripts for the Wwise Sound Engine. In the Editor workflow, it is added to every scene, so that it can be properly previewed in the Editor. In the game, only one instance is created, in the first scene, and it is persisted throughout the game. It is recommended to leave this box checked.";
            WwiseSetupWizard.Settings.CreateWwiseGlobal =
                UnityEngine.GUILayout.Toggle(WwiseSetupWizard.Settings.CreateWwiseGlobal,
                                             new UnityEngine.GUIContent(description, tooltip));

            description = "Automatically add Listener to Main Camera";
            tooltip     =
                "In order for positioning to work, the Ak Audio Listener script needs to be attached to the main camera in every scene. If you wish for your listener to be attached to another GameObject, uncheck this box";
            WwiseSetupWizard.Settings.CreateWwiseListener = UnityEngine.GUILayout.Toggle(
                WwiseSetupWizard.Settings.CreateWwiseListener, new UnityEngine.GUIContent(description, tooltip));
        }

        UnityEngine.GUILayout.Label("In Editor Warnings", UnityEditor.EditorStyles.boldLabel);

        using (new UnityEngine.GUILayout.VerticalScope("box"))
        {
            description = "Show Warning for Missing RigidBody";
            tooltip     =
                "Interactions between AkGameObj and AkEnvironment or AkRoom require a Rigidbody component on the object or the environment/room. It is recommended to leave this box checked.";
            WwiseSetupWizard.Settings.ShowMissingRigidBodyWarning = UnityEngine.GUILayout.Toggle(
                WwiseSetupWizard.Settings.ShowMissingRigidBodyWarning, new UnityEngine.GUIContent(description, tooltip));
        }

        using (new UnityEngine.GUILayout.HorizontalScope())
        {
            UnityEngine.GUILayout.Label("* Mandatory settings");
        }

        UnityEngine.GUILayout.FlexibleSpace();
    }
Esempio n. 7
0
    public static bool MoveAssetsFromDirectory(string sourceDirName, string destDirName, bool copySubDirs)
    {
        var dir = new System.IO.DirectoryInfo(sourceDirName);

        if (!dir.Exists)
        {
            UnityEngine.Debug.LogError("WwiseUnity: Source directory doesn't exist");
            return(false);
        }

        if (!System.IO.Directory.Exists(destDirName))
        {
            AssetDatabase.CreateFolder(System.IO.Path.GetDirectoryName(destDirName), System.IO.Path.GetFileName(destDirName));
        }

        var    files = dir.GetFiles();
        string error, source, destFilePath;

        foreach (var file in files)
        {
            if (file.Extension == ".meta")
            {
                continue;
            }

            destFilePath = System.IO.Path.Combine(destDirName, file.Name);
            if (System.IO.File.Exists(destFilePath))
            {
                UnityEngine.Debug.LogWarningFormat("WwiseUnity: Destination file path will be overwritten: {0}", destFilePath);
            }

            source = System.IO.Path.Combine("Assets", AkUtilities.MakeRelativePath(UnityEngine.Application.dataPath, file.FullName));
            source = source.Replace(System.IO.Path.AltDirectorySeparatorChar, System.IO.Path.DirectorySeparatorChar);

            error = AssetDatabase.MoveAsset(source, destFilePath);
            if (!string.IsNullOrEmpty(error))
            {
                UnityEngine.Debug.LogErrorFormat("WwiseUnity: Error while attempting to move <{0}> to <{1}>: {2}", source, destFilePath, error);
            }
        }

        if (!copySubDirs)
        {
            return(true);
        }

        var dirs = dir.GetDirectories();

        foreach (var subdir in dirs)
        {
            source = System.IO.Path.Combine("Assets", AkUtilities.MakeRelativePath(UnityEngine.Application.dataPath, subdir.FullName));
            source = source.Replace(System.IO.Path.AltDirectorySeparatorChar, System.IO.Path.DirectorySeparatorChar);

            var destSubDirName = System.IO.Path.Combine(destDirName, subdir.Name);
            error = UnityEditor.AssetDatabase.MoveAsset(source, destSubDirName);

            if (!string.IsNullOrEmpty(error))
            {
                UnityEngine.Debug.LogErrorFormat("WwiseUnity: Error while attempting to move <{0}> to <{1}>: {2}", source, destSubDirName, error);
            }
        }

        return(true);
    }