SetSoundbankHeaderFilePath() public static method

public static SetSoundbankHeaderFilePath ( string WwiseProjectPath, string SoundbankPath ) : bool
WwiseProjectPath string
SoundbankPath string
return bool
Example #1
0
    // Modify the .wproj file to set needed soundbank settings
    private static bool SetSoundbankSettings()
    {
        if (string.IsNullOrEmpty(Settings.WwiseProjectPath))
        {
            // Nothing to do here, because setup should succees if Wwise project is not given
            return(true);
        }

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

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

        if (AkUtilities.EnableBoolSoundbankSettingInWproj("SoundBankGenerateHeaderFile", WprojPath))
        {
            if (AkUtilities.SetSoundbankHeaderFilePath(WprojPath, SoundbankPath))
            {
                return(AkUtilities.EnableBoolSoundbankSettingInWproj("SoundBankGenerateMaxAttenuationInfo", WprojPath));
            }
        }
        return(false);
    }
    // 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);
    }