优化hierarchyab和consolemethod,然后是粒子追踪
Signed-off-by: TRADER_FOER <lhf190@outlook.com>
This commit is contained in:
@@ -2,40 +2,41 @@ using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using DG.Tweening;
|
||||
using Ichni.Editor.Commands;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
public class OperationManager
|
||||
{
|
||||
public List<GameElement> currentSelectedElements { get; private set; }
|
||||
public TempOutlineModule TempOutlineModule = new TempOutlineModule();
|
||||
public CopyPasteDeleteModule CopyPasteDeleteModule;
|
||||
|
||||
public FindingModule FindingModule;
|
||||
|
||||
public OperationManager()
|
||||
{
|
||||
currentSelectedElements = new List<GameElement>();
|
||||
CopyPasteDeleteModule = new CopyPasteDeleteModule();
|
||||
FindingModule = new FindingModule();
|
||||
}
|
||||
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
public class OperationManager
|
||||
{
|
||||
public List<GameElement> currentSelectedElements { get; private set; }
|
||||
public TempOutlineModule TempOutlineModule = new TempOutlineModule();
|
||||
public CopyPasteDeleteModule CopyPasteDeleteModule;
|
||||
|
||||
public FindingModule FindingModule;
|
||||
|
||||
public OperationManager()
|
||||
{
|
||||
currentSelectedElements = new List<GameElement>();
|
||||
CopyPasteDeleteModule = new CopyPasteDeleteModule();
|
||||
FindingModule = new FindingModule();
|
||||
}
|
||||
|
||||
public void AddSelectElement(GameElement gameElement)
|
||||
{
|
||||
if (gameElement == null || gameElement.connectedTab == null) return;
|
||||
if (currentSelectedElements.Contains(gameElement)) return;
|
||||
|
||||
currentSelectedElements.Add(gameElement);
|
||||
|
||||
gameElement.connectedTab.isSelected = true;
|
||||
if (gameElement.connectedTab.BgImage != null)
|
||||
{
|
||||
gameElement.connectedTab.BgImage.color = new Color(0f, 0f, 0f, 0.8f);
|
||||
|
||||
currentSelectedElements.Add(gameElement);
|
||||
|
||||
gameElement.connectedTab.isSelected = true;
|
||||
if (gameElement.connectedTab.BgImage != null)
|
||||
{
|
||||
gameElement.connectedTab.BgImage.DOColor(new Color(0f, 0f, 0f, 0.8f), 0.2f);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,75 +94,78 @@ namespace Ichni.Editor
|
||||
public void RemoveSelectElement(GameElement gameElement)
|
||||
{
|
||||
if (gameElement == null) return;
|
||||
|
||||
currentSelectedElements.Remove(gameElement);
|
||||
|
||||
if (gameElement.connectedTab == null) return;
|
||||
|
||||
gameElement.connectedTab.isSelected = false;
|
||||
if (gameElement.connectedTab.BgImage != null)
|
||||
{
|
||||
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearSelectedElements()
|
||||
{
|
||||
currentSelectedElements.RemoveAll(gameElement => gameElement == null);
|
||||
currentSelectedElements.ForEach(gameElement =>
|
||||
{
|
||||
if (gameElement == null || gameElement.connectedTab == null) return;
|
||||
gameElement.connectedTab.isSelected = false;
|
||||
if (gameElement.connectedTab.BgImage != null)
|
||||
{
|
||||
gameElement.connectedTab.BgImage.color = new Color(0.5f, 0.5f, 0.5f, 0);
|
||||
}
|
||||
});
|
||||
|
||||
currentSelectedElements.Clear();
|
||||
}
|
||||
}
|
||||
public class TempOutlineModule
|
||||
{
|
||||
public List<GameElement> outlinedElements;
|
||||
public Material outlineMaterial => EditorManager.instance.basePrefabs.outlineShaderMaterial;
|
||||
public TempOutlineModule()
|
||||
{
|
||||
outlinedElements = new List<GameElement>();
|
||||
}
|
||||
|
||||
public void AddOutline(GameElement gameElement)
|
||||
{
|
||||
outlinedElements.Add(gameElement);
|
||||
}
|
||||
|
||||
public void RemoveOutline(GameElement gameElement)
|
||||
{
|
||||
outlinedElements.Remove(gameElement);
|
||||
}
|
||||
|
||||
public void ClearOutline()
|
||||
{
|
||||
outlinedElements.Clear();
|
||||
}
|
||||
}
|
||||
public class FindingModule
|
||||
{
|
||||
public GameElement FindGameElementByName(string elementName)
|
||||
{
|
||||
foreach (GameElement element in EditorManager.instance.beatmapContainer.gameElementList)
|
||||
{
|
||||
if (element.elementName == elementName)
|
||||
{
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
LogWindow.Log("Element not found: " + elementName, Color.red);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
currentSelectedElements.Remove(gameElement);
|
||||
|
||||
if (gameElement.connectedTab == null) return;
|
||||
|
||||
gameElement.connectedTab.isSelected = false;
|
||||
if (gameElement.connectedTab.BgImage != null)
|
||||
{
|
||||
gameElement.connectedTab.BgImage.DOColor(new Color(0, 0, 0, 0), 0.2f);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void ClearSelectedElements()
|
||||
{
|
||||
currentSelectedElements.RemoveAll(gameElement => gameElement == null);
|
||||
currentSelectedElements.ForEach(gameElement =>
|
||||
{
|
||||
if (gameElement == null || gameElement.connectedTab == null) return;
|
||||
gameElement.connectedTab.isSelected = false;
|
||||
if (gameElement.connectedTab.BgImage != null)
|
||||
{
|
||||
gameElement.connectedTab.BgImage.DOColor(new Color(0, 0, 0, 0), 0.2f);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
currentSelectedElements.Clear();
|
||||
}
|
||||
}
|
||||
public class TempOutlineModule
|
||||
{
|
||||
public List<GameElement> outlinedElements;
|
||||
public Material outlineMaterial => EditorManager.instance.basePrefabs.outlineShaderMaterial;
|
||||
public TempOutlineModule()
|
||||
{
|
||||
outlinedElements = new List<GameElement>();
|
||||
}
|
||||
|
||||
public void AddOutline(GameElement gameElement)
|
||||
{
|
||||
outlinedElements.Add(gameElement);
|
||||
}
|
||||
|
||||
public void RemoveOutline(GameElement gameElement)
|
||||
{
|
||||
outlinedElements.Remove(gameElement);
|
||||
}
|
||||
|
||||
public void ClearOutline()
|
||||
{
|
||||
outlinedElements.Clear();
|
||||
}
|
||||
}
|
||||
public class FindingModule
|
||||
{
|
||||
public GameElement FindGameElementByName(string elementName)
|
||||
{
|
||||
foreach (GameElement element in EditorManager.instance.beatmapContainer.gameElementList)
|
||||
{
|
||||
if (element.elementName == elementName)
|
||||
{
|
||||
return element;
|
||||
}
|
||||
}
|
||||
|
||||
LogWindow.Log("Element not found: " + elementName, Color.red);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public class CopyPasteDeleteModule
|
||||
{
|
||||
public GameElement copiedElement;
|
||||
@@ -220,8 +224,8 @@ namespace Ichni.Editor
|
||||
public void PasteElement(GameElement parentElement)
|
||||
{
|
||||
if (parentElement == null)
|
||||
{
|
||||
LogWindow.Log("No parent element selected to paste.", Color.red);
|
||||
{
|
||||
LogWindow.Log("No parent element selected to paste.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user