-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
using HarmonyLib; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Reflection; | ||
|
||
namespace SkinManagerMod.Patches | ||
{ | ||
[HarmonyPatch] | ||
internal static class LocoMeshSplitterPatches | ||
{ | ||
private static Type _paintSetupClass = AccessTools.TypeByName("LocoMeshSplitter.MeshLoaders.TrainCarPaintSetup"); | ||
|
||
public static bool Prepare() | ||
{ | ||
return (_paintSetupClass is not null); | ||
} | ||
|
||
public static IEnumerable<MethodBase> TargetMethods() | ||
{ | ||
if (_paintSetupClass is not null) | ||
{ | ||
var methods = AccessTools.GetDeclaredMethods(_paintSetupClass); | ||
foreach (var method in methods) | ||
{ | ||
yield return method; | ||
} | ||
} | ||
} | ||
|
||
[HarmonyPrefix] | ||
public static bool SkipMethod() | ||
{ | ||
return false; | ||
} | ||
} | ||
} |