submodule bug fix & Clip extend
移除submodule重复引用的问题, Clip现在可以保存任意GameElement,且任意指定物体作为父物体加载
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
using Sirenix.OdinInspector;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -18,20 +19,80 @@ namespace Ichni.Editor
|
||||
public Button clipLoadButton;
|
||||
|
||||
[Title("Windows")]
|
||||
public ClipManagementWindow clipManagementWindow;
|
||||
public GeneralSecondaryWindow clipManagementWindow;
|
||||
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
saveButton.onClick.AddListener(EditorManager.instance.projectManager.saveManager.Save);
|
||||
exportButton.onClick.AddListener(EditorManager.instance.projectManager.exportManager.Export);
|
||||
clipSaveButton.onClick.AddListener(clipManagementWindow.InitializeAsSaveClip);
|
||||
clipLoadButton.onClick.AddListener(clipManagementWindow.InitializeAsLoadClip);
|
||||
clipSaveButton.onClick.AddListener(GenerateSaveClipWindow);
|
||||
clipLoadButton.onClick.AddListener(GenerateLoadClipWindow);
|
||||
}
|
||||
}
|
||||
|
||||
public partial class ToolBar
|
||||
{
|
||||
|
||||
private void GenerateSaveClipWindow()
|
||||
{
|
||||
GameElement currentElement = EditorManager.instance.operationManager.currentSelectedElement;
|
||||
|
||||
if (currentElement == null)
|
||||
{
|
||||
LogWindow.Log("No Game Element selected.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (clipManagementWindow != null)
|
||||
{
|
||||
LogWindow.Log("Clip Management Window already exists.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralSecondaryWindow saveClipWindow =
|
||||
Instantiate(EditorManager.instance.basePrefabs.generalSecondaryWindow,
|
||||
EditorManager.instance.uiManager.mainPage.mainCanvas.GetComponent<RectTransform>()).GetComponent<GeneralSecondaryWindow>();
|
||||
clipManagementWindow = saveClipWindow;
|
||||
saveClipWindow.Initialize("Save Clip: " + currentElement.elementName, () => clipManagementWindow = null);
|
||||
|
||||
var container = saveClipWindow.GenerateContainer();
|
||||
var clipNameInputField = saveClipWindow.GenerateInputField(container, "Clip Name", currentElement.elementName);
|
||||
var applyClipButton = saveClipWindow.GenerateButton(container, "Apply", () =>
|
||||
{
|
||||
EditorManager.instance.projectManager.beatmapClipManager.SaveClip(clipNameInputField.GetValue<string>());
|
||||
});
|
||||
}
|
||||
|
||||
private void GenerateLoadClipWindow()
|
||||
{
|
||||
GameElement currentElement = EditorManager.instance.operationManager.currentSelectedElement;
|
||||
|
||||
if (currentElement == null)
|
||||
{
|
||||
LogWindow.Log("No Game Element selected.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
GameElement loadTarget = currentElement == EditorManager.instance ? null : currentElement.parentElement;
|
||||
|
||||
if (clipManagementWindow != null)
|
||||
{
|
||||
LogWindow.Log("Clip Management Window already exists.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
GeneralSecondaryWindow loadClipWindow =
|
||||
Instantiate(EditorManager.instance.basePrefabs.generalSecondaryWindow,
|
||||
EditorManager.instance.uiManager.mainPage.mainCanvas.GetComponent<RectTransform>()).GetComponent<GeneralSecondaryWindow>();
|
||||
clipManagementWindow = loadClipWindow;
|
||||
loadClipWindow.Initialize("Load Clip", () => clipManagementWindow = null);
|
||||
|
||||
var container = loadClipWindow.GenerateContainer();
|
||||
var clipNameInputField = loadClipWindow.GenerateInputField(container, "Clip Name");
|
||||
var applyClipButton = loadClipWindow.GenerateButton(container, "Apply", () =>
|
||||
{
|
||||
EditorManager.instance.projectManager.beatmapClipManager.LoadClip(clipNameInputField.GetValue<string>());
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user