// called whenever starting a new game public void mutate(XRL.World.GameObject player) { // add part unconditionally player.AddPart <HZMapPinTogglePart>(); // also set up ability HZMapPinTogglePart.AddAbility(player); }
public static void GameLoadHandler() { XRL.World.GameObject player = XRL.Core.XRLCore.Core?.Game?.Player?.Body; if (player == null) { return; } // add part only if it's not already present player.RequirePart <HZMapPinTogglePart>(); // also set up ability if needed HZMapPinTogglePart.AddAbility(player); }