加载工程
This commit is contained in:
@@ -11,6 +11,8 @@ namespace Ichni
|
||||
public static InformationTransistor instance;
|
||||
|
||||
public bool isLoadedProject;
|
||||
public string loadedProjectName;
|
||||
|
||||
public ProjectInformation_BM projectInfo_BM;
|
||||
public SongInformation_BM songInfo_BM;
|
||||
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using TMPro;
|
||||
using UniRx;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Ichni.StartMenu
|
||||
@@ -23,13 +26,24 @@ namespace Ichni.StartMenu
|
||||
loadButton.onClick.AddListener(LoadProject);
|
||||
}
|
||||
|
||||
public void LoadProject()
|
||||
private void LoadProject()
|
||||
{
|
||||
// var b = IchniApp.instance.GetModel<InformationTransistor>();
|
||||
// if (b == null) Debug.LogError("XXX");
|
||||
// b.isLoadedProject = true;
|
||||
// IchniApp.instance.GetModel<InformationTransistor>().loadingFolder = projectName;
|
||||
// StartPageManager.startPageManager.GoToEditScene();
|
||||
InformationTransistor.instance.isLoadedProject = true;
|
||||
InformationTransistor.instance.loadedProjectName = projectName;
|
||||
|
||||
string projectPath = Application.streamingAssetsPath + "/Projects/" + projectName;
|
||||
InformationTransistor.instance.projectInfo_BM = ES3.Load<ProjectInformation_BM>("ProjectInformation", projectPath + "/ProjectInfo.json");
|
||||
InformationTransistor.instance.songInfo_BM = ES3.Load<SongInformation_BM>("SongInformation", projectPath + "/SongInfo.json");
|
||||
|
||||
ThemeBundleManager.instance.LoadThemeBundles(InformationTransistor.instance.projectInfo_BM.selectedThemeBundleList);
|
||||
ThemeBundleManager.instance.waitingBundleAmount
|
||||
.Where(amount => amount == 0) // 当 waitingAmount 变为 0 时触发
|
||||
.First()
|
||||
.Subscribe(_ =>
|
||||
{
|
||||
Debug.Log("All AssetBundles are loaded. Switching scene.");
|
||||
SceneManager.LoadScene("EditorScene");
|
||||
}).AddTo(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user