add: Item Manager
This commit is contained in:
@@ -33,7 +33,6 @@ public class Program
|
|||||||
AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(dllPath, new ReaderParameters { });
|
AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly(dllPath, new ReaderParameters { });
|
||||||
TypeDefinition targetType = assembly.MainModule.Types.First(t => t.Name == "ProjectUtils");
|
TypeDefinition targetType = assembly.MainModule.Types.First(t => t.Name == "ProjectUtils");
|
||||||
MethodDefinition method = targetType.Methods.First(m => m.Name == "EnsureGodotSdkIsUpToDate");
|
MethodDefinition method = targetType.Methods.First(m => m.Name == "EnsureGodotSdkIsUpToDate");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
TypeReference? stringType = assembly.MainModule.ImportReference(typeof(string));
|
TypeReference? stringType = assembly.MainModule.ImportReference(typeof(string));
|
||||||
@@ -69,7 +68,6 @@ public class Program
|
|||||||
method.Body.Variables.Clear();
|
method.Body.Variables.Clear();
|
||||||
ILProcessor il = method.Body.GetILProcessor();
|
ILProcessor il = method.Body.GetILProcessor();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//VariableDefinition root = new VariableDefinition(projectRootElementTypeDef);
|
//VariableDefinition root = new VariableDefinition(projectRootElementTypeDef);
|
||||||
method.Body.Variables.Add(root);
|
method.Body.Variables.Add(root);
|
||||||
@@ -139,9 +137,7 @@ public class Program
|
|||||||
|
|
||||||
il.Append(il.Create(OpCodes.Ret));
|
il.Append(il.Create(OpCodes.Ret));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
assembly.Write($"{dllPath}.2.dll");
|
assembly.Write($"{dllPath}.2.dll");
|
||||||
File.Replace($"{dllPath}.2.dll", dllPath, null);
|
File.Replace($"{dllPath}.2.dll", dllPath, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user