Skip to content

Instantly share code, notes, and snippets.

@asm256
Last active October 4, 2015 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asm256/2a4fd9aa9be9cf3c4ba3 to your computer and use it in GitHub Desktop.
Save asm256/2a4fd9aa9be9cf3c4ba3 to your computer and use it in GitHub Desktop.
YASDをUnityInjector 1.0.3.0以上でコンパイルする方法
using System.Reflection;
//以上をusingなんたらの一番下にでも置く
//以下をnamespace なんとかの{の直下に置く
static internal class LINQExt {
public static void ForEach<T>(this IEnumerable<T> self , Action<T> act) {
foreach(var cur in self) act(cur);
}
}
public static class UnityExtensionsBridge {
static UnityExtensionsBridge() {
klass = Type.GetType("UnityInjector.Extensions,UnityInjector");
}
static Type klass = null;
public static string UserDataPath {
get {
return (string)klass.GetMethod("get_UserDataPath").Invoke(null,null);
}
}
}
// UnityInjector.Extensions.UserDataPath を UnityExtensionsBridge.UserDataPath で置換する
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment