public override void PostDestroy(DestroyMode mode, Map previousMap) { Pawn pawn = this.parent as Pawn; string graphicPath = pawn.Drawer.renderer.graphics.nakedGraphic.path; AnimalCollectionClass.RemoveGraphicPathFromList(pawn, graphicPath); }
public override void CompTick() { base.CompTick(); if (this.parent.IsHashIntervalTick(1000)) { Faction faction = this.parent.Faction; if (faction != oldFaction) { Pawn pawn = this.parent as Pawn; string graphicPath = pawn.Drawer.renderer.graphics.nakedGraphic.path; if (faction == Faction.OfPlayer) { AnimalCollectionClass.AddGraphicPathToList(pawn, graphicPath); } else { AnimalCollectionClass.RemoveGraphicPathFromList(pawn, graphicPath); } oldFaction = faction; } } }