Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
[email protected] webmail now available. Want one? Go here.
Cannot use outlook/hotmail/live here to register as they blocking our mail servers. #microsoftdeez
Obey the Epel!

Paste

Pasted as C# by nicks000 ( 4 years ago )
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));
        }
    }
}

 

Revise this Paste

Your Name: Code Language: