加载工程

This commit is contained in:
SoulliesOfficial
2025-03-08 18:19:32 -05:00
parent e0ae43c25c
commit baa5453d89
11 changed files with 629 additions and 52 deletions

View File

@@ -59,9 +59,10 @@ namespace Ichni
this.elementName = "EditorManager";
this.elementGuid = Guid.Empty;
uiManager.hierarchy.GenerateTab(this, null);
if (InformationTransistor.instance.isLoadedProject)
{
LoadProject("TestProject");
LoadProject(InformationTransistor.instance.loadedProjectName);
}
else
{

View File

@@ -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;

View File

@@ -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);
}
}
}

Binary file not shown.

View File

@@ -3,7 +3,47 @@
"__type" : "Ichni.RhythmGame.Beatmap.BeatmapContainer_BM,Assembly-CSharp",
"value" : {
"elementList" : [
{
"__type" : "Ichni.RhythmGame.Beatmap.ElementFolder_BM,Assembly-CSharp",
"elementName" : "Folder",
"tags" : [
],
"elementGuid" : {
"value" : "f9699e9b-12ce-4f53-bf11-2d63c748edb4"
},
"attachedElementGuid" : {
"value" : "00000000-0000-0000-0000-000000000000"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TransformSubmodule_BM,Assembly-CSharp",
"originalPosition" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalEulerAngles" : {
"x" : 0,
"y" : 0,
"z" : 0
},
"originalScale" : {
"x" : 1,
"y" : 1,
"z" : 1
},
"attachedElementGuid" : {
"value" : "f9699e9b-12ce-4f53-bf11-2d63c748edb4"
}
},{
"__type" : "Ichni.RhythmGame.Beatmap.TimeDurationSubmodule_BM,Assembly-CSharp",
"isOverridingDuration" : false,
"startTime" : -32767,
"endTime" : 32767,
"attachedElementGuid" : {
"value" : "f9699e9b-12ce-4f53-bf11-2d63c748edb4"
}
}
],
"attachedElementGuid" : {
"value" : "00000000-0000-0000-0000-000000000000"

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b2cabbb688cb54529acc02a54919c608
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e67d80f608567461399657da11aaef80
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 69f89b3025bd74fb0a60fd05b0c6784a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 085869d7f099845cd87bf954b91ebd9c
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -2,7 +2,7 @@
"SongInformation" : {
"__type" : "Ichni.RhythmGame.Beatmap.SongInformation_BM,Assembly-CSharp",
"value" : {
"songName" : "TestSong",
"songName" : "TestSong.wav",
"bpm" : 120,
"delay" : 2,
"attachedElementGuid" : {

File diff suppressed because one or more lines are too long