Beispiel #1
0
        internal static void PostFix(ref ResourceTracker __instance)
        {
            bool isDataBox = __instance.overrideTechType == TechType.Databox || __instance.techType == TechType.Databox;

            if (!isDataBox)
            {
                return; // Not a data box, early exit
            }
            BlueprintHandTarget blueprint = __instance.GetComponentInParent <BlueprintHandTarget>();

            if (blueprint == null)
            {
                return; // safety check, but shouldn't happen
            }
            if (!blueprint.used)
            {
                return;                   // blueprint still unused
            }
            __instance.OnBreakResource(); // call this to invoke the "Unregister" method
        }