static void Postfix(UniqueIdentifier __instance)
 {
     if (__instance is PrefabIdentifier && DebrisPatcher.isValidPrefab(__instance.ClassId))
     {
         track(__instance.gameObject);
     }
 }
        public static void untrackInvalid()
        {
            if (!ResourceTracker.resources.TryGetValue(SalvageableDebrisDR.TechType, out var trackedResources))
            {
                return;
            }

            var toRemove = new List <ResourceTracker.ResourceInfo>();

            foreach (var info in trackedResources)
            {
                if (trackedDebris.TryGetValue(info.Key, out string prefabID) && !DebrisPatcher.isValidPrefab(prefabID))
                {
                    toRemove.Add(info.Value);
                }
            }

            var onResourceRemoved = typeof(ResourceTracker).evnt("onResourceRemoved").wrap();             // don't make it static

            foreach (var info in toRemove)
            {
                trackedResources.Remove(info.uniqueId);
                onResourceRemoved.raise(info);
            }
        }