JudgeTrigger

外部区域判定区
This commit is contained in:
SoulliesOfficial
2025-04-02 18:18:25 -04:00
parent e528cdea9c
commit 5c0e9c5a76
39 changed files with 818 additions and 51 deletions

View File

@@ -8,29 +8,61 @@ namespace Ichni.Editor
{
public class OperationManager
{
public GameElement currentSelectedElement { get; private set; }
public List<GameElement> currentSelectedElements { get; private set; }
public CopyPasteDeleteModule CopyPasteDeleteModule;
public FindingModule FindingModule;
public OperationManager()
{
currentSelectedElements = new List<GameElement>();
CopyPasteDeleteModule = new CopyPasteDeleteModule();
FindingModule = new FindingModule();
}
public void SelectElement(GameElement gameElement)
public void AddSelectElement(GameElement gameElement)
{
if (currentSelectedElement != null)
currentSelectedElements.Add(gameElement);
gameElement.connectedTab.isSelected = true;
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0.2f);
}
public void RemoveSelectElement(GameElement gameElement)
{
currentSelectedElements.Remove(gameElement);
gameElement.connectedTab.isSelected = false;
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
}
public void ClearSelectedElements()
{
currentSelectedElements.ForEach(gameElement =>
{
currentSelectedElement.connectedTab.isSelected = false;
if (currentSelectedElement.connectedTab.BgImage != null)
gameElement.connectedTab.isSelected = false;
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
});
currentSelectedElements.Clear();
}
}
public class FindingModule
{
public GameElement FindGameElementByName(string elementName)
{
foreach (GameElement element in EditorManager.instance.beatmapContainer.gameElementList)
{
if (element.elementName == elementName)
{
currentSelectedElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
return element;
}
}
currentSelectedElement = gameElement;
currentSelectedElement.connectedTab.isSelected = true;
currentSelectedElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0.2f);
LogWindow.Log("Element not found: " + elementName, Color.red);
return null;
}
}