PlatformBlock.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using UnityEngine;
  2. using GadgetCore.API;
  3. using UnityEngine.SceneManagement;
  4. using GadgetCore.API.ConfigMenu;
  5. namespace PlatformBlock
  6. {
  7. [Gadget("PlatformBlock")]
  8. public class PlatformBlock : Gadget<PlatformBlock>
  9. {
  10. public const string MOD_VERSION = "1.1"; // Set this to the version of your mod.
  11. public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file.
  12. public override IGadgetConfigMenu GetConfigMenu() { return null; }
  13. public override string GetModDescription()
  14. {
  15. return "A mod that adds a platform block for your ship.";
  16. }
  17. protected override void Initialize()
  18. {
  19. Logger.Log("Platform Block v" + Info.Mod.Version);
  20. Core.logger = Logger;
  21. Core.itemPlatformId = ItemUtil.CreatePlacablePlatformItem("cPlatform.png", "iPlatform.png", "Platform Block");
  22. // SceneManager.sceneLoaded += OnSceneLoaded;
  23. }
  24. internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
  25. {
  26. if (scene.buildIndex == 1)
  27. {
  28. // GadgetCoreAPI.CreateMarketStand(ItemRegistry.GetItem(Core.itemPlatformId), new Vector2(-138f - 3 * 4, -7.49f), 500);
  29. }
  30. }
  31. }
  32. }