using UnityEngine; using GadgetCore.API; using UnityEngine.SceneManagement; using GadgetCore.API.ConfigMenu; namespace PlatformBlock { [Gadget("PlatformBlock")] public class PlatformBlock : Gadget { public const string MOD_VERSION = "1.1"; // Set this to the version of your mod. public const string CONFIG_VERSION = "1.0"; // Increment this whenever you change your mod's config file. public override IGadgetConfigMenu GetConfigMenu() { return null; } public override string GetModDescription() { return "A mod that adds a platform block for your ship."; } protected override void Initialize() { Logger.Log("Platform Block v" + Info.Mod.Version); Core.logger = Logger; Core.itemPlatformId = ItemUtil.CreatePlacablePlatformItem("cPlatform.png", "iPlatform.png", "Platform Block"); // SceneManager.sceneLoaded += OnSceneLoaded; } internal static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (scene.buildIndex == 1) { // GadgetCoreAPI.CreateMarketStand(ItemRegistry.GetItem(Core.itemPlatformId), new Vector2(-138f - 3 * 4, -7.49f), 500); } } } }