public static void InvokeDestroy(FurnaceVolume __instance, EntityManager entityManager, Entity entity, StructurePart part) { if (destroyPartMethod == null) { destroyPartMethod = typeof(FurnaceVolume).GetMethod("DestroyPart", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy); } var destroyPartResult = (IEnumerator)destroyPartMethod.Invoke(__instance, new object[] { Main.Instance.MainSettings.SalvageSettings.ObjectDestructionDelay, part, entityManager, entity }); __instance.StartCoroutine(destroyPartResult); }
public static bool Prefix(ref FurnaceVolume __instance, ref EntityCommandBuffer commandBuffer, ref EntityManager entityManager, ref Entity entity, ref StructurePart part) { FurnaceVolumePatch1.InvokeDestroy(__instance, entityManager, entity, part); SalvageableUtility.MarkAsDestroyed(commandBuffer, entityManager, entity, SalvagedBy.Furnace); return(false); }