コード例 #1
0
ファイル: HZMapPinToggle.cs プロジェクト: HunterZ/qudmods
 // 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);
 }
コード例 #2
0
ファイル: HZMapPinToggle.cs プロジェクト: HunterZ/qudmods
 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);
 }