Skip to content

Commit ada4029

Browse files
committed
* mix - class/method wrapper generater
1 parent 60ef0d8 commit ada4029

11 files changed

Lines changed: 468 additions & 192 deletions

BindGenerater/Generater/AstNodeExtensions.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ public static T GetParentOf<T>(this AstNode node) where T : AstNode
5252
AstNode m = node as AstNode;
5353
while (m.Parent != null)
5454
{
55-
if (m.Parent.GetType() == typeof(T))
56-
{
57-
return m.Parent as T;
58-
}
55+
var p = m.Parent as T;
56+
if (p != null)
57+
return p;
58+
5959
m = m.Parent;
6060
}
6161
return default(T);

BindGenerater/Generater/Binder.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ public static class Binder
3434
{
3535
"System.Collections",
3636
"UnityEditor",
37-
"UnityEngine.Experimental",
38-
"LowLevel.Unsafe",
3937
"UnityEngine.TestTools",
4038

4139
//platform specific
@@ -60,6 +58,17 @@ public static class Binder
6058
"UnityEngine.Bindings",
6159
"Unity.IL2CPP.CompilerServices",
6260
"Unity.Burst",
61+
"UnityEngine.Bindings"
62+
};
63+
64+
public static HashSet<string> retainTypes = new HashSet<string>()
65+
{
66+
"UnityEngine.Transform",
67+
"UnityEngine.Texture",
68+
"UnityEngine.UnityException",
69+
"UnityEngine.UnityString",
70+
"UnityEngine.CastHelper`1",
71+
"UnityEngineInternal.MathfInternal"
6372
};
6473

6574
public static void Init(string outDir)
@@ -98,6 +107,7 @@ public static void Bind(string dllPath)
98107

99108
DecompilerSetting = new DecompilerSettings(LanguageVersion.CSharp7);
100109
DecompilerSetting.ThrowOnAssemblyResolveErrors = false;
110+
DecompilerSetting.UseExpressionBodyForCalculatedGetterOnlyProperties = false;
101111

102112
ManagedDir = Path.GetDirectoryName(dllPath);
103113
DefaultAssemblyResolver resolver = new DefaultAssemblyResolver();

0 commit comments

Comments
 (0)