Beispiel #1
0
    // Parses the .wproj to find out where soundbanks are generated for the given path
    public static string GetWwiseSoundBankDestinationFolder(string Platform, string WwiseProjectPath)
    {
        try
        {
            if (WwiseProjectPath.Length == 0)
            {
                return("");
            }

            XmlDocument doc = new XmlDocument();
            doc.Load(WwiseProjectPath);
            XPathNavigator Navigator = doc.CreateNavigator();

            // Navigate the wproj file (XML format) to where generated soundbank paths are stored
            string          PathExpression = string.Format("//Property[@Name='SoundBankPaths']/ValueList/Value[@Platform='{0}']", Platform);
            XPathExpression expression     = XPathExpression.Compile(PathExpression);
            XPathNavigator  node           = Navigator.SelectSingleNode(expression);
            string          Path           = "";
            if (node != null)
            {
                Path = node.Value;
                                #if !(UNITY_EDITOR_WIN || UNITY_XBOX360 || UNITY_XBOXONE || UNITY_METRO)
                AkBankPathUtil.ConvertToPosixPath(ref Path);
                                #endif // #if !(UNITY_EDITOR_WIN || UNITY_XBOX360 || UNITY_XBOXONE || UNITY_METRO)
            }

            return(Path);
        }
        catch (Exception)
        {
            // Error happened, return empty string
            return("");
        }
    }
Beispiel #2
0
 public static void LazyConvertPathConvention(ref string path)
 {
     if (AkBankPathUtil.isToUsePosixPathSeparator)
     {
         AkBankPathUtil.ConvertToPosixPath(ref path);
     }
     else if (Path.DirectorySeparatorChar == '/')
     {
         AkBankPathUtil.ConvertToPosixPath(ref path);
     }
     else
     {
         AkBankPathUtil.ConvertToWindowsPath(ref path);
     }
 }