Пример #1
0
    public static bool CopySoundbanks(bool generate, string platformName, ref string destinationFolder)
    {
        if (string.IsNullOrEmpty(platformName))
        {
            UnityEngine.Debug.LogError("WwiseUnity: Could not determine platform name for <" + platformName + "> platform");
        }
        else
        {
            if (generate)
            {
                var platforms = new System.Collections.Generic.List <string> {
                    platformName
                };
                AkUtilities.GenerateSoundbanks(platforms);
            }

            var sourceFolder = AkUtilities.GetPlatformBasePathEditor(platformName);
            if (string.IsNullOrEmpty(sourceFolder))
            {
                UnityEngine.Debug.LogError("WwiseUnity: Could not find source folder for <" + platformName +
                                           "> platform. Did you remember to generate your banks?");
            }
            else if (!SetDestinationPath(platformName, ref destinationFolder))
            {
                UnityEngine.Debug.LogError("WwiseUnity: Could not find destination folder for <" + platformName + "> platform");
            }
            else if (!AkUtilities.DirectoryCopy(sourceFolder, destinationFolder, true))
            {
                destinationFolder = null;
                UnityEngine.Debug.LogError("WwiseUnity: Could not copy soundbank folder for <" + platformName + "> platform");
            }
            else
            {
                UnityEngine.Debug.Log("WwiseUnity: Copied soundbank folder to streaming assets folder <" + destinationFolder +
                                      "> for <" + platformName + "> platform build");
                return(true);
            }
        }

        return(false);
    }