HideDress/SkinHide/Patches/PlayerPatch.cs
2022-08-29 08:18:34 +08:00

32 lines
819 B
C#

using Aki.Reflection.Patching;
using Aki.Reflection.Utils;
using System.Reflection;
using System.Threading.Tasks;
using EFT;
namespace SkinHide.Patches
{
public class PlayerPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return typeof(Player).GetMethod("Init", PatchConstants.PrivateFlags);
}
[PatchPostfix]
private async static void PatchPostfix(Task __result, Player __instance)
{
await __result;
if (__instance.IsYourPlayer)
{
SkinHidePlugin.Player = __instance.GetComponentInChildren<PlayerBody>();
}
else
{
SkinHidePlugin.Bot.Add(__instance.GetComponentInChildren<PlayerBody>());
}
}
}
}