using System.IO;
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
public class fmod_dll_fix
{
//Callback to the build path.
[PostProcessBuildAttribute(999)]
public static void OnPostprocessBuild(BuildTarget target, string pathToBuiltProject)
{
var fixedPath = pathToBuiltProject.Replace(".exe", "_Data/Plugins");
var newDllPath = Path.Combine(fixedPath, "x86_64");
string[] dllsToMove = new string[]
{
"fmodstudio.dll",
"fmodstudiol.dll",
"resonanceaudio.dll"
};
foreach (var dll in dllsToMove)
{
var oldPath = Path.Combine(fixedPath, dll);
var newPath = Path.Combine(newDllPath, dll);
File.Move(oldPath, newPath);
Debug.Log(string.Format("Moved {0} from old path: {1} to new path: {2}", dll, oldPath, newPath));
}
}
}
Add a code snippet to your website: www.paste.org