// Use this for initialization void Start() { if (!SaveLoad.started) { StaticInits.Start(); SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) { Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; } else { Misc.WindowName = ControlPanel.instance.WindowBasisName; } #endif SaveLoad.LoadAlMighty(); LuaScriptBinder.Set(null, "ModFolder", MoonSharp.Interpreter.DynValue.NewString("@Title")); UnitaleUtil.AddKeysToMapCorrespondanceList(); } Camera.main.GetComponent <AudioSource>().clip = AudioClipRegistry.GetMusic("mus_intro"); Camera.main.GetComponent <AudioSource>().Play(); if (imagePaths.Length != textsToDisplay.Length) { throw new Exception("You need to have the same number of images and lines of text."); } text = GameObject.FindObjectOfType <TextManager>(); img = GameObject.Find("CutsceneImages").GetComponent <Image>(); text.SetVerticalSpacing(6); text.SetHorizontalSpacing(6); if (SpriteRegistry.Get("Intro/mask") != null) { mask = true; GameObject.Find("Mask").GetComponent <Image>().sprite = SpriteRegistry.Get("Intro/mask"); GameObject.Find("Mask").GetComponent <Image>().color = new Color(1, 1, 1, 1); } TextMessage[] mess = new TextMessage[textsToDisplay.Length]; for (int i = 0; i < mess.Length; i++) { mess[i] = new TextMessage("[waitall:2]" + textsToDisplay[i], false, false); } text.SetTextQueue(mess); img.sprite = SpriteRegistry.Get("Intro/" + imagePaths[0]); img.SetNativeSize(); if (specialEffects[0] != string.Empty) { try { ApplyEffect((Effect)Enum.Parse(typeof(Effect), specialEffects[currentIndex].ToUpper())); } catch { UnitaleUtil.DisplayLuaError("IntroManager", "The effect " + specialEffects[currentIndex] + " doesn't exist."); } } if (goToNextDirect[0] == "Y") { timer = 0.5f; } }
public void Awake() { if (!awakened) { StaticInits.Start(); SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); SaveLoad.LoadAlMighty(); LuaScriptBinder.Set(null, "ModFolder", DynValue.NewString("@Title")); UnitaleUtil.AddKeysToMapCorrespondanceList(); //Use AlMightyGlobals to load Crate Your Frisk, Safe Mode, Retromode and Fullscreen mode preferences if (LuaScriptBinder.GetAlMighty(null, "CrateYourFrisk") != null && LuaScriptBinder.GetAlMighty(null, "CrateYourFrisk").Boolean) { crate = true; } #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN Misc.WindowName = crate ? ControlPanel.instance.WinodwBsaisNmae : ControlPanel.instance.WindowBasisName; #endif //Check if safe mode has a stored preference that is a boolean if (LuaScriptBinder.GetAlMighty(null, "CYFSafeMode") != null && LuaScriptBinder.GetAlMighty(null, "CYFSafeMode").Type == DataType.Boolean) { ControlPanel.instance.Safe = LuaScriptBinder.GetAlMighty(null, "CYFSafeMode").Boolean; } //Check if retro mode has a stored preference that is a boolean if (LuaScriptBinder.GetAlMighty(null, "CYFRetroMode") != null && LuaScriptBinder.GetAlMighty(null, "CYFRetroMode").Type == DataType.Boolean) { retroMode = LuaScriptBinder.GetAlMighty(null, "CYFRetroMode").Boolean; } //Check if fullscreen mode has a stored preference that is a boolean if (LuaScriptBinder.GetAlMighty(null, "CYFPerfectFullscreen") != null && LuaScriptBinder.GetAlMighty(null, "CYFPerfectFullscreen").Type == DataType.Boolean) { ScreenResolution.perfectFullscreen = LuaScriptBinder.GetAlMighty(null, "CYFPerfectFullscreen").Boolean; } //Check if window scale has a stored preference that is a number if (LuaScriptBinder.GetAlMighty(null, "CYFWindowScale") != null && LuaScriptBinder.GetAlMighty(null, "CYFWindowScale").Type == DataType.Number) { ScreenResolution.windowScale = (int)LuaScriptBinder.GetAlMighty(null, "CYFWindowScale").Number; } awakened = true; } }
private void Start() { if (!initial) { StaticInits.Start(); SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN if (GlobalControls.crate) { Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; } else { Misc.WindowName = ControlPanel.instance.WindowBasisName; } #endif SaveLoad.LoadAlMighty(); LuaScriptBinder.Set(null, "ModFolder", DynValue.NewString("@Title")); UnitaleUtil.AddKeysToMapCorrespondanceList(); initial = true; } if (LuaScriptBinder.GetAlMighty(null, "CrateYourFrisk") != null) { if (LuaScriptBinder.GetAlMighty(null, "CrateYourFrisk").Boolean) { GameObject.Find("Image").GetComponent <Image>().enabled = false; GameObject.Find("Image (1)").GetComponent <Image>().enabled = true; /*GameObject.Find("Description").GetComponent<Text>().text = "CRATE YOUR FRISK IS A FERE AND SUPER KEWL EJNINE!!!!1!!\n" + * "GO ON WWW.REDIDT.CMO/R/UNITLAE. FOR UPDTAES!!!!!\n" + * "NO RELESLING HERE!!! IT'S RFEE!!!\n" + * "OR TUBY FEX WILL BE ANGER!!!\n\n" + * "U'LL HVAE A BED TMIE!!!"; * GameObject.Find("Description (1)").GetComponent<Text>().text = "NU FEAUTRES IN EXAMPLES MODS!!!!! CHEKC IT OTU!!!!!\n" + * "REALLY!!!\n" + * "IF U DAD A # IN AN ECNOUNTRE NAME IT'LL NTO BE CHOSE NI\n" + * "ENCONUTERS ON THE PAMS!!!! SO COLO!!!";*/ GameObject.Find("Description").GetComponent <Text>().text = "GO TO /R/UNITLAE. FOR UPDTAES!!!!!"; GameObject.Find("Description (1)").GetComponent <Text>().text = "NO RELESLING HERE!!! IT'S RFEE!!! " + "OR TUBY FEX WILL BE ANGER!!! " + "U'LL HVAE A BED TMIE!!!"; GameObject.Find("Description (2)").GetComponent <Text>().text = "SPACE OR KLIK TO\n<color='#ff0000'>PALY MODS!!!!!</color>"; GameObject.Find("Description (3)").GetComponent <Text>().text = "PRSES O TO\n<color='#ffff00'>OOVERWURL!!!!!</color>"; GameObject.Find("Description (4)").GetComponent <Text>().text = "<b><color='red'>KNOW YUOR CODE</color> R U'LL HVAE A BED TMIE!!!</b>"; } } }
// Use this for initialization void Start() { if (!SaveLoad.started) { StaticInits.Start(); SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); #if UNITY_STANDALONE_WIN || UNITY_EDITOR if (GlobalControls.crate) { Misc.WindowName = ControlPanel.instance.WinodwBsaisNmae; } else { Misc.WindowName = ControlPanel.instance.WindowBasisName; } #endif SaveLoad.LoadAlMighty(); LuaScriptBinder.Set(null, "ModFolder", MoonSharp.Interpreter.DynValue.NewString("Title")); UnitaleUtil.AddKeysToMapCorrespondanceList(); } GameObject firstCamera = GameObject.Find("Main Camera"); firstCamera.SetActive(false); if (GameObject.Find("Main Camera")) { GameObject.Destroy(firstCamera); } else { firstCamera.SetActive(true); } tmName = GameObject.Find("TextManagerResetName").GetComponent <TextManager>(); tmName.SetHorizontalSpacing(2); tmName.SetFont(SpriteFontRegistry.Get(SpriteFontRegistry.UI_DEFAULT_NAME)); diff = calcTotalLength(tmName); actualX = tmName.transform.localPosition.x; actualY = tmName.transform.localPosition.y; if (GlobalControls.crate) { GameObject.Find("Title").GetComponent <SpriteRenderer>().enabled = false; GameObject.Find("Title (1)").GetComponent <SpriteRenderer>().enabled = true; } GameObject.DontDestroyOnLoad(Camera.main.gameObject); StartCoroutine(TitlePhase1()); }
private static bool awakened; // Used to only run Awake() once public void Awake() { if (awakened) { return; } // Create all singletons (classes that only have one instance across the entire app) StaticInits.Start(); SaveLoad.Start(); new ControlPanel(); new PlayerCharacter(); // Load AlMighty globals SaveLoad.LoadAlMighty(); LuaScriptBinder.Set(null, "ModFolder", DynValue.NewString("@Title")); // Load map names for the overworld UnitaleUtil.AddKeysToMapCorrespondanceList(); // Use AlMightyGlobals to load Crate Your Frisk, Safe Mode, Retromode and Fullscreen mode preferences // CrateYourFrisk if (LuaScriptBinder.GetAlMighty(null, "CrateYourFrisk") != null && LuaScriptBinder.GetAlMighty(null, "CrateYourFrisk").Boolean) { crate = true; } #if UNITY_STANDALONE_WIN || UNITY_EDITOR_WIN Misc.WindowName = crate ? ControlPanel.instance.WinodwBsaisNmae : ControlPanel.instance.WindowBasisName; #endif // Check if safe mode has a stored preference that is a boolean if (LuaScriptBinder.GetAlMighty(null, "CYFSafeMode") != null && LuaScriptBinder.GetAlMighty(null, "CYFSafeMode").Type == DataType.Boolean) { ControlPanel.instance.Safe = LuaScriptBinder.GetAlMighty(null, "CYFSafeMode").Boolean; } // Check if retro mode has a stored preference that is a boolean if (LuaScriptBinder.GetAlMighty(null, "CYFRetroMode") != null && LuaScriptBinder.GetAlMighty(null, "CYFRetroMode").Type == DataType.Boolean) { retroMode = LuaScriptBinder.GetAlMighty(null, "CYFRetroMode").Boolean; } // Check if fullscreen mode has a stored preference that is a boolean if (LuaScriptBinder.GetAlMighty(null, "CYFPerfectFullscreen") != null && LuaScriptBinder.GetAlMighty(null, "CYFPerfectFullscreen").Type == DataType.Boolean) { ScreenResolution.perfectFullscreen = LuaScriptBinder.GetAlMighty(null, "CYFPerfectFullscreen").Boolean; } // Check if window scale has a stored preference that is a number if (LuaScriptBinder.GetAlMighty(null, "CYFWindowScale") != null && LuaScriptBinder.GetAlMighty(null, "CYFWindowScale").Type == DataType.Number) { ScreenResolution.windowScale = (int)LuaScriptBinder.GetAlMighty(null, "CYFWindowScale").Number; } // Start Discord RPC (also checks for an AlMightyGlobal within) DiscordControls.Start(); awakened = true; }