LoopPortal.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. using UnityEngine;
  2. using GadgetCore.API;
  3. using GadgetCore.API.ConfigMenu;
  4. namespace LoopPortal
  5. {
  6. [Gadget("LoopPortal")]
  7. public class LoopPortal : Gadget<LoopPortal>
  8. {
  9. public const string MOD_VERSION = "1.3"; // Set this to the version of your mod.
  10. public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
  11. public override IGadgetConfigMenu GetConfigMenu() { return null; }
  12. public override string GetModDescription()
  13. {
  14. return "Adds a 4th portal to the end of every level that is guaranteed to loop to the current planet.";
  15. }
  16. protected override void Initialize()
  17. {
  18. Logger.Log("Loop Portal v" + Info.Mod.Version);
  19. Core.logger = Logger;
  20. ItemInfo itemInfo = new ItemInfo(ItemType.GENERIC, "port4", "", null as Texture2D).Register("port4");
  21. TileInfo tile = new TileInfo(TileType.INTERACTIVE, null as Texture2D, new GameObject("port4"), itemInfo).Register("port4");
  22. Core.npcId = tile.GetID();
  23. }
  24. }
  25. }