效果模块,以及代码位置整理
This commit is contained in:
105
Assets/Scripts/Manager/EditorManager.cs
Normal file
105
Assets/Scripts/Manager/EditorManager.cs
Normal file
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.Editor;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using Ichni.RhythmGame.ThemeBundles.Basic;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Ichni
|
||||
{
|
||||
public class EditorManager : SerializedMonoBehaviour
|
||||
{
|
||||
public static EditorManager instance;
|
||||
|
||||
public ProjectManager projectManager;
|
||||
public EditorUIManager uiManager;
|
||||
public EditorSettings editorSettings;
|
||||
|
||||
public ProjectInformation projectInformation;
|
||||
public SongInformation songInformation;
|
||||
public BeatmapContainer beatmapContainer;
|
||||
public CommandScripts commandScripts;
|
||||
|
||||
public NoteBase.NoteJudgeType currentJudgeType;
|
||||
public BasePrefabsCollection basePrefabs;
|
||||
|
||||
private void Awake()
|
||||
{
|
||||
instance = this;
|
||||
projectManager = new ProjectManager();
|
||||
if (!ES3.FileExists(Application.streamingAssetsPath + "/EditorSettings.es3"))
|
||||
{
|
||||
editorSettings = new EditorSettings(300, 100, 100);
|
||||
EditorSettings.SaveSettings(editorSettings);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorSettings.LoadSettings(ref editorSettings);
|
||||
}
|
||||
}
|
||||
|
||||
private void Start()
|
||||
{
|
||||
//CreateNew();
|
||||
projectManager.loadManager.Load("TestProject");
|
||||
uiManager.timeline.musicPlayer.audioSource.clip = songInformation.song;
|
||||
|
||||
beatmapContainer.gameElementList.ForEach(gameElement =>
|
||||
{
|
||||
if (gameElement is IHaveTransformSubmodule transformedElement)
|
||||
{
|
||||
transformedElement.SetTransformObserver();
|
||||
}
|
||||
|
||||
gameElement.AfterInitialize();
|
||||
gameElement.Refresh();
|
||||
});
|
||||
|
||||
// projectManager.saveManager.Save();
|
||||
// projectManager.exportManager.Export();
|
||||
}
|
||||
|
||||
private void CreateNew()
|
||||
{
|
||||
projectManager.GenerateProject("TestProject");
|
||||
|
||||
var f0 = ElementFolder.GenerateElement("Folder", Guid.NewGuid(), new List<string>(), true, null);
|
||||
var dis0 = Displacement.GenerateElement("Displacement-0",Guid.NewGuid(), new List<string>(),true, f0,
|
||||
new FlexibleFloat(),
|
||||
new FlexibleFloat(new List<AnimatedFloat>(){new (0,2,0,10, AnimationCurveType.Linear)}),
|
||||
new FlexibleFloat());
|
||||
var dis1 = Displacement.GenerateElement("Displacement-1", Guid.NewGuid(), new List<string>(), true, f0,
|
||||
new FlexibleFloat(new List<AnimatedFloat>()
|
||||
{
|
||||
new(0, 0.5f, 0, -4, AnimationCurveType.OutQuad),
|
||||
new(0.5f, 1, -4, 0, AnimationCurveType.InQuad),
|
||||
new(1, 1.5f, 0, 4, AnimationCurveType.OutQuad),
|
||||
new(1.5f, 2, 4, 0, AnimationCurveType.InQuad),
|
||||
}),
|
||||
new FlexibleFloat(new List<AnimatedFloat>(){new (0,2,0,-10, AnimationCurveType.Linear)}),
|
||||
new FlexibleFloat());
|
||||
|
||||
var t0 = Track.GenerateElement("Track", Guid.NewGuid(), new List<string>(), true, f0);
|
||||
t0.trackPathSubmodule = new TrackPathSubmodule(t0, Track.TrackSpaceType.Linear, Track.TrackSamplingType.TimeDistributed, false);
|
||||
t0.submoduleList.Add(t0.trackPathSubmodule);
|
||||
t0.trackTimeSubmodule = new TrackTimeSubmoduleMovable(t0, 0, 2, 1, AnimationCurveType.OutQuad);
|
||||
t0.submoduleList.Add(t0.trackTimeSubmodule);
|
||||
var pp0 = TrackPercentPoint.GenerateElement("TrackPercentPoint-0", Guid.NewGuid(), new List<string>(), true, t0,
|
||||
new FlexibleFloat(new List<AnimatedFloat>() { new(0, 2, 0, 1, AnimationCurveType.OutQuad) }));
|
||||
var tr0 = Trail.GenerateElement("Trail-0", Guid.NewGuid(), new List<string>(), true, pp0, 5);
|
||||
// t0.trackRendererSubmodule = new TrackRendererSubmoduleAutoOrient(t0);
|
||||
var p0 = PathNode.GenerateElement("PathNode-0", Guid.NewGuid(), new List<string>(), true, t0);
|
||||
p0.transformSubmodule = new TransformSubmodule(p0, new Vector3(-5, 5, 10), Vector3.zero, Vector3.one);
|
||||
p0.colorSubmodule = new ColorSubmodule(p0, Color.white);
|
||||
var p1 = PathNode.GenerateElement("PathNode-1", Guid.NewGuid(), new List<string>(), true, t0);
|
||||
p1.transformSubmodule = new TransformSubmodule(p1, new Vector3(5, -5, 10), Vector3.zero, Vector3.one);
|
||||
p1.colorSubmodule = new ColorSubmodule(p1, Color.red);
|
||||
var n0 = Tap.GenerateElement("Note-0", Guid.NewGuid(), new List<string>(), true, t0, 1f);
|
||||
var n0v = BasicNoteVisual.GenerateElement("Note-0-V", Guid.NewGuid(), new List<string>(), true, n0,
|
||||
"basic", "BasicNoteTap3D");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user