using System.Collections; using UnityEngine; using UnityEngine.AzureSky; using UnityEngine.SceneManagement; [ModTitle("NoNight")] [ModDescription("Skips the spooky night")] [ModAuthor(". Marsh.Mello .")] [ModIconUrl("https://i.imgur.com/XPnc659.jpg")] [ModWallpaperUrl("https://i.imgur.com/F0YINHe.jpg")] [ModVersion("1.1.0")] [RaftVersion("Update 9.05 (3847312)")] [ModVersionCheckUrl("https://raftmodding.com/api/v1/mods/nonight/version.txt")] public class NoNight : Mod { private AzureSkyController skyController; private RNotify notify; private readonly string prefix = "[" + "NoNight" + "] "; private void Start() { notify = FindObjectOfType(); RConsole.Log(prefix + " Loaded!"); } public void Update() { if (SceneManager.GetActiveScene().buildIndex == 1 && skyController == null) skyController = FindObjectOfType(); if (SceneManager.GetActiveScene().buildIndex == 1 && BedManager.BedTime() && skyController != null) { skyController.timeOfDay.GotoTime(4.5f); WorldManager.DayCounter++; notify.AddNotification(RNotify.NotificationType.normal, "Skipping Night!").SetCloseDelay(5).SetTextColor(Color.green); } } public void OnModUnload() { RConsole.Log(prefix + "Unloaded!"); Destroy(gameObject); } }