示例#1
0
    // 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;
        }
    }
示例#2
0
    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>";
            }
        }
    }
示例#4
0
 private void Start()
 {
     if (!initial)
     {
         StaticInits.Start();
         SaveLoad.Start();
         new ControlPanel();
         new PlayerCharacter();
         SaveLoad.LoadAlMighty();
         StaticInits.MODFOLDER = "Undertale Disbelief Papyrus";
         StaticInits.ENCOUNTER = "by Cezar Andrade";
         StartCoroutine(LaunchMod());
     }
 }
示例#5
0
 // 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());
 }
示例#6
0
    // Use this for initialization
    void Start()
    {
        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();
        MisriHalek       = GameObject.Find("MisriHalek").GetComponent <Image>();
        MainText         = FindObjectOfType <Text>();
        MainAudio        = Camera.main.GetComponent <AudioSource>();
        SubAudio         = GameObject.Find("SubAudio").GetComponent <AudioSource>();
        MainSprite       = ((LuaSpriteController)SpriteUtil.MakeIngameSprite("empty", "none", -1).UserData.Object);
        MainSprite.alpha = 0;
        MainSprite.SetPivot(.5f, 0);
        MainSprite.absy = 260;

        Sprite[] sprs = Resources.LoadAll <Sprite>("Sprites/Punder");
        foreach (Sprite spr in sprs)
        {
            Sprites.Add(spr.name, spr);
        }
        AudioClip[] adcs = Resources.LoadAll <AudioClip>("Audios");
        foreach (AudioClip adc in adcs)
        {
            Audios.Add(adc.name, adc);
        }
        MainAudio.clip = Audios["MisriHalek"];
        MainAudio.loop = false;
        MainAudio.Play();
        //MainAudio.time = 137;
        clipSampleData = new float[sampleDataLength];
    }
    // Use this for initialization
    void Start()
    {
        // Load CYF's save file
        StaticInits.Start();
        SaveLoad.Start();

        // Set up CYF's basic objects
        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
        // Load CYF's AlMighty save file
        SaveLoad.LoadAlMighty();

        // Store useful scene objects
        misriHalek = GameObject.Find("MisriHalek").GetComponent <Image>();
        mainText   = GameObject.Find("MainText").GetComponent <Text>();
        subText    = GameObject.Find("SubText").GetComponent <Text>();
        mainAudio  = Camera.main.GetComponent <AudioSource>();
        subAudio   = GameObject.Find("SubAudio").GetComponent <AudioSource>();

        // Load all resources needed for this animation to play
        Sprite[] punderSprs = Resources.LoadAll <Sprite>("Sprites/Punder");
        foreach (Sprite spr in punderSprs)
        {
            punderSprites.Add(spr.name, spr);
        }

        Sprite[] luSprs = Resources.LoadAll <Sprite>("Sprites/Lu");
        foreach (Sprite spr in luSprs)
        {
            luSprites.Add(spr.name, spr);
        }

        AudioClip[] adcs = Resources.LoadAll <AudioClip>("Audios");
        foreach (AudioClip adc in adcs)
        {
            audioFiles.Add(adc.name, adc);
        }

        // Create all sprites needed for the animation
        mainSprite       = (LuaSpriteController)SpriteUtil.MakeIngameSprite("empty", "Default", -1).UserData.Object;
        mainSprite.alpha = 0;
        mainSprite.SetPivot(.5f, 0);
        mainSprite.x = 0;
        mainSprite.y = 20;

        fadeSprite       = (LuaSpriteController)SpriteUtil.MakeIngameSprite("black", "Default", -1).UserData.Object;
        fadeSprite.alpha = 0;

        pauseSprite = (LuaSpriteController)SpriteUtil.MakeIngameSprite("empty", "Default", -1).UserData.Object;
        SetSprite(Resources.Load <Sprite>("Sprites/pause"), "", pauseSprite);
        pauseSprite.alpha = 0;

        subSprite   = (LuaSpriteController)SpriteUtil.MakeIngameSprite("empty", "Lu", -1).UserData.Object;
        subSprite.x = 0;
        subSprite.y = -400;
        SetSprite("HoldNormal0", false);

        // Preload all other audio files to prevent lag spikes
        foreach (AudioClip clip in audioFiles.Values)
        {
            mainAudio.clip = clip;
            mainAudio.Play();
        }
        mainAudio.clip = audioFiles["MisriHalek"];
        mainAudio.loop = false;
        mainAudio.Play();

        clipSampleData = new float[sampleDataLength];
    }
示例#8
0
    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;
    }