Test with generated hooks
This commit is contained in:
@ -72,6 +72,7 @@ public static class Engine
|
||||
AudioDevice = new AudioDevice();
|
||||
|
||||
OnInitialize?.Invoke();
|
||||
Nerfed.Runtime.Generator.Hook.InvokeHooks();
|
||||
|
||||
while (!quit)
|
||||
{
|
||||
|
7
Nerfed.Runtime/Hook/HookAttribute.cs
Normal file
7
Nerfed.Runtime/Hook/HookAttribute.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Nerfed.Runtime.Hook
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
|
||||
public class HookAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
11
Nerfed.Runtime/Hook/HookTest.cs
Normal file
11
Nerfed.Runtime/Hook/HookTest.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Nerfed.Runtime.Hook
|
||||
{
|
||||
public static class HookTest
|
||||
{
|
||||
[Hook]
|
||||
public static void Test()
|
||||
{
|
||||
Log.Info("Hook!");
|
||||
}
|
||||
}
|
||||
}
|
@ -11,6 +11,7 @@
|
||||
<IsPackable>false</IsPackable>
|
||||
<Configurations>Debug;Test;Release</Configurations>
|
||||
<Platforms>x64</Platforms>
|
||||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
@ -40,4 +41,10 @@
|
||||
<Compile Include="Libraries\ImGui.NET\src\ImGui.NET\**\*.cs" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Nerfed.Runtime.Generator\Nerfed.Runtime.Generator.csproj"
|
||||
OutputItemType="Analyzer"
|
||||
ReferenceOutputAssembly="false" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
Reference in New Issue
Block a user