Esempio n. 1
0
 public void EndGameOver()
 {
     if (!GlobalControls.modDev)
     {
         SaveLoad.Load(false);
     }
     if (!UnitaleUtil.IsOverworld)
     {
         UIController.EndBattle(true);
         Destroy(gameObject);
         if (GlobalControls.modDev)
         {
             SceneManager.LoadScene("ModSelect");
         }
     }
     else
     {
         EndGameOverRevive();
     }
     if (!GlobalControls.modDev)
     {
         TPHandler tp = Instantiate(Resources.Load <TPHandler>("Prefabs/TP On-the-fly"));
         tp.sceneName = LuaScriptBinder.Get(null, "PlayerMap").String;
         tp.position  = new Vector3((float)LuaScriptBinder.Get(null, "PlayerPosX").Number, (float)LuaScriptBinder.Get(null, "PlayerPosY").Number, LuaScriptBinder.Get(null, "PlayerPosZ") == null ? 0 : (float)LuaScriptBinder.Get(null, "PlayerPosZ").Number);
         tp.direction = 2;
         tp.noFadeIn  = true;
         tp.noFadeOut = false;
         GameObject.DontDestroyOnLoad(tp);
         tp.LaunchTPInternal();
     }
 }
    public void EndGameOver()
    {
        if (!GlobalControls.modDev)
        {
            SaveLoad.Load(false);
        }
        if (!UnitaleUtil.IsOverworld)
        {
            UIController.EndBattle(true);
            Destroy(gameObject);
            if (GlobalControls.modDev)
            {
                SceneManager.LoadScene("ModSelect");
            }
            else
            {
                foreach (string str in NewMusicManager.audioname.Keys)
                {
                    if (str == "StaticKeptAudio")
                    {
                        NewMusicManager.Stop(str);
                        ((AudioSource)NewMusicManager.audiolist[str]).clip = null;
                        ((AudioSource)NewMusicManager.audiolist[str]).time = 0;
                    }
                }
            }
        }
        else
        {
            EndGameOverRevive();
        }
        if (!GlobalControls.modDev)
        {
            TPHandler tp = Instantiate(Resources.Load <TPHandler>("Prefabs/TP On-the-fly"));
            tp.sceneName = LuaScriptBinder.Get(null, "PlayerMap").String;

            if (UnitaleUtil.MapCorrespondanceList.ContainsValue(tp.sceneName))
            {
                foreach (KeyValuePair <string, string> entry in UnitaleUtil.MapCorrespondanceList)
                {
                    if (entry.Value == tp.sceneName)
                    {
                        tp.sceneName = entry.Key;
                        break;
                    }
                }
            }

            tp.position  = new Vector3((float)LuaScriptBinder.Get(null, "PlayerPosX").Number, (float)LuaScriptBinder.Get(null, "PlayerPosY").Number, LuaScriptBinder.Get(null, "PlayerPosZ") == null ? 0 : (float)LuaScriptBinder.Get(null, "PlayerPosZ").Number);
            tp.direction = 2;
            tp.noFadeIn  = true;
            tp.noFadeOut = false;
            GameObject.DontDestroyOnLoad(tp);
            tp.LaunchTPInternal();
        }
    }