@@ -23,6 +23,17 @@ public static class Binder
2323 public static CSharpDecompiler Decompiler ;
2424 public static DecompilerSettings DecompilerSetting ;
2525
26+ private static string [ ] IcallSupportTypes = new string [ ]
27+ {
28+ "Object" ,
29+ "Application" ,
30+ "Debug" ,
31+ "Vector3" ,
32+ "Vector2" ,
33+ "Quaternion" ,
34+ "Color" ,
35+ "Color32" ,
36+ } ;
2637
2738 private static string [ ] IgnorTypes = new string [ ]
2839 {
@@ -55,6 +66,9 @@ public static void Init(string outDir)
5566 FuncDefineWriter = new CodeWriter ( File . CreateText ( Path . Combine ( outDir , "Binder.define.cs" ) ) ) ;
5667 FuncSerWriter = new CodeWriter ( File . CreateText ( Path . Combine ( outDir , "Binder.funcser.cs" ) ) ) ;
5768 FuncDeSerWriter = new CodeWriter ( File . CreateText ( Path . Combine ( outDir , "Binder.funcdeser.cs" ) ) ) ;
69+
70+ Utils . IgnoreTypeSet . UnionWith ( IgnorTypes ) ;
71+ Utils . IcallSupportClass . UnionWith ( IcallSupportTypes ) ;
5872 }
5973
6074 public static void End ( )
@@ -82,26 +96,13 @@ public static void Bind(string dllPath)
8296 ModuleDefinition module = ModuleDefinition . ReadModule ( dllPath , parameters ) ;
8397
8498 moduleTypes = new HashSet < TypeReference > ( module . Types ) ;
85- var ignorSet = Utils . IgnoreTypeSet ;
86- foreach ( var type in IgnorTypes )
87- {
88- ignorSet . Add ( type ) ;
89- }
90-
91- //var typeSet = new HashSet<string>(BindTypes);
9299
93100 foreach ( TypeDefinition type in moduleTypes )
94101 {
95102 if ( ! type . IsPublic )
96103 continue ;
97104
98105 AddType ( type ) ;
99-
100- /* Console.WriteLine(type.FullName);
101- if (typeSet.Contains(type.Name))
102- {
103- AddType(type);
104- }*/
105106 }
106107
107108 TypeResolver . WrapperSide = true ;
@@ -126,34 +127,7 @@ public static void AddType(TypeDefinition type)
126127 return ;
127128
128129 generaters . Enqueue ( new ClassGenerater ( type ) ) ;
129-
130- /*CodeGenerater gener = null;
131- if (type.IsValueType || type.IsEnum || type.IsDelegate())
132- {
133- CopyGenerater.AddTpe(type);
134- }
135- else if (type.IsClass)
136- {
137- var baseType = type.BaseType;
138- var bt = baseType.Resolve();
139- if (baseType.Resolve().IsAbstract)
140- baseType = bt.BaseType;
141- while (baseType != null && baseType.FullName != "System.Object")
142- {
143- bt = baseType.Resolve();
144- AddType(bt);
145- baseType = bt.BaseType;
146- }
147-
148- gener = new ClassGenerater(type);
149- }
150- else if(type.IsInterface)
151- {
152- gener = new ClassGenerater(type);
153- }
154130
155- if(gener != null)
156- generaters.Enqueue(gener);*/
157131 }
158132 }
159133}
0 commit comments