93 lines
3.4 KiB
C#
93 lines
3.4 KiB
C#
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 : GameElement
|
|
{
|
|
public static EditorManager instance;
|
|
|
|
public ProjectManager projectManager;
|
|
public MusicPlayer musicPlayer;
|
|
public EditorUIManager uiManager;
|
|
public EditorSettings editorSettings;
|
|
public OperationManager operationManager;
|
|
public BackgroundController backgroundController;
|
|
public CameraManager cameraManager;
|
|
public PostProcessingManager postProcessingManager;
|
|
|
|
public Timeline timeline;
|
|
|
|
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();
|
|
operationManager = new OperationManager();
|
|
|
|
if (!ES3.FileExists(Application.streamingAssetsPath + "/EditorSettings.es3"))
|
|
{
|
|
editorSettings = new EditorSettings(300, 100, 100);
|
|
EditorSettings.SaveSettings(editorSettings);
|
|
}
|
|
else
|
|
{
|
|
EditorSettings.LoadSettings(ref editorSettings);
|
|
}
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
this.elementName = "EditorManager";
|
|
this.elementGuid = Guid.Empty;
|
|
uiManager.hierarchy.GenerateTab(this, null);
|
|
|
|
projectManager.loadManager.Load("TestProject");
|
|
musicPlayer.audioSource.clip = songInformation.song;
|
|
|
|
beatmapContainer.gameElementList.ForEach(gameElement =>
|
|
{
|
|
gameElement.AfterInitialize();
|
|
gameElement.Refresh();
|
|
});
|
|
}
|
|
|
|
public override void SetUpInspector()
|
|
{
|
|
IHaveInspection inspector = uiManager.inspector;
|
|
|
|
var container = inspector.GenerateContainer("Editor Manager");
|
|
var judgeTypeDropdown = inspector.GenerateDropdown(this, container, "Judge Type",
|
|
typeof(NoteBase.NoteJudgeType), nameof(currentJudgeType));
|
|
|
|
var generateFolderButton =
|
|
inspector.GenerateButton(this, container, "Generate Folder",
|
|
() => ElementFolder.GenerateElement("Folder", Guid.NewGuid(),
|
|
new List<string>(), true, null));
|
|
|
|
var generateBackgroundSetterButton =
|
|
inspector.GenerateButton(this, container, "Generate Background Setter",
|
|
() => BackgroundSetter.GenerateElement("Background Setter", Guid.NewGuid(),
|
|
new List<string>(), true, null, false,
|
|
"basic", "Skybox", "Background"));
|
|
|
|
projectInformation.SetUpInspector();
|
|
songInformation.SetUpInspector();
|
|
cameraManager.SetUpInspector();
|
|
}
|
|
}
|
|
} |