//------------------------------------------------------------------------------------------------------------ protected static void generateAdapter(Type type, string nameSpace = "HotFix") { string prePath = FrameDefine.P_SCRIPT_GAME_PATH + "ILRuntime/GeneratedCrossBinding/"; string fullFileName = prePath + type.Name + "Adapter.cs"; FileUtility.createDir(prePath); using (StreamWriter sw = new StreamWriter(fullFileName)) { sw.WriteLine(CrossBindingCodeGenerator.GenerateCrossBindingAdapterCode(type, nameSpace)); } // 生成热更工程中对应的派生类,用于重写所有的虚函数,只是因为ILR本身的原因需要对虚函数进行重写 ClassTypeGenerator generator = new ClassTypeGenerator(); generator.generateILRClass(type, FrameDefine.F_HOT_FIX_PATH + "Game/ILRInherit_AutoGenerated/"); }
public void NullDataTest() { var generator = new ClassTypeGenerator(); Assert.Throws(typeof(ArgumentNullException), () => generator.Generate(null)); }
public void InvalidDataTypeTest() { var generator = new ClassTypeGenerator(); Assert.Throws(typeof(InvalidOperationException), () => generator.Generate("Invalid")); }
public string AccessSpecifierConvertTest(ClassType classType) { var generator = new ClassTypeGenerator(); return(generator.Generate(classType)); }