Welcome, guest! Login / Register - Why register?
[email protected] webmail now available. Want one? Go here.
You will not find us on Bing and you will get a bounce when you try registering with an outlook/live.com email address here. Not our fault. Blame the corporate bully. #deeznutsmicrosoft

Paste

Pasted as C# by nicks000 ( 2 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: