rimworld-animations/1.3/Source/Patches/RimworldPatches/HarmonyPatch_Thing.cs
2022-01-24 18:17:49 -08:00

31 lines
690 B
C#

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HarmonyLib;
using RimWorld;
using Verse;
namespace Rimworld_Animations
{
[HarmonyPatch(typeof(Thing), "DrawAt")]
public static class HarmonyPatch_Thing
{
public static bool Prefix(Thing __instance)
{
CompThingAnimator thingAnimator = __instance.TryGetComp<CompThingAnimator>();
if (thingAnimator != null && thingAnimator.isAnimating)
{
thingAnimator.AnimateThing(__instance);
return false;
}
return true;
}
}
}