JudgeTrigger
外部区域判定区
This commit is contained in:
@@ -29,9 +29,10 @@ public class BasePrefabsCollection : SerializedScriptableObject
|
||||
public AudioClip holdNoteLoopSound;
|
||||
public AudioClip holdNoteEndSound;
|
||||
public AudioClip flickNoteSound;
|
||||
[Title("Note 判定UI")] public GameObject fullscreenNearTimeHint;
|
||||
[Title("Note 判定UI")]
|
||||
public GameObject fullscreenNearTimeHint;
|
||||
public GameObject areaHint;
|
||||
|
||||
public GameObject triggerHint;
|
||||
|
||||
[Title("Effect相关")]
|
||||
public GameObject bloomEffect;
|
||||
|
||||
@@ -157,19 +157,37 @@ namespace Ichni.Editor
|
||||
|
||||
private void CopyPasteDeleteOperation()
|
||||
{
|
||||
if (Keyboard.current.leftCtrlKey.isPressed)
|
||||
if (Keyboard.current.leftCtrlKey.isPressed) // TODO: 后续适应多选
|
||||
{
|
||||
if (Keyboard.current.cKey.wasPressedThisFrame) // Ctrl + C 复制
|
||||
{
|
||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.CopyElement(EditorManager.instance.operationManager.currentSelectedElement);
|
||||
if (EditorManager.instance.operationManager.currentSelectedElements.Count != 1) // TODO: 后续适应多选
|
||||
{
|
||||
LogWindow.Log("Please select only one Game Element to copy.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.CopyElement(EditorManager.instance.operationManager.currentSelectedElements[0]);
|
||||
}
|
||||
else if (Keyboard.current.vKey.wasPressedThisFrame) // Ctrl + V 粘贴
|
||||
{
|
||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.PasteElement(EditorManager.instance.operationManager.currentSelectedElement);
|
||||
if (EditorManager.instance.operationManager.currentSelectedElements.Count != 1)
|
||||
{
|
||||
LogWindow.Log("Please select only one Game Element to paste.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.PasteElement(EditorManager.instance.operationManager.currentSelectedElements[0]);
|
||||
}
|
||||
else if (Keyboard.current.dKey.wasPressedThisFrame) // Ctrl + D 删除
|
||||
{
|
||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.DeleteElement(EditorManager.instance.operationManager.currentSelectedElement);
|
||||
if (EditorManager.instance.operationManager.currentSelectedElements.Count != 1) // TODO: 后续适应多选,为同时选中了父物体和子物体做防呆设计
|
||||
{
|
||||
LogWindow.Log("Please select only one Game Element to copy.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
EditorManager.instance.operationManager.CopyPasteDeleteModule.DeleteElement(EditorManager.instance.operationManager.currentSelectedElements[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -189,7 +189,13 @@ namespace Ichni
|
||||
{
|
||||
LogWindow.Log("Start Saving Clip...");
|
||||
|
||||
GameElement selectedElement = EditorManager.instance.operationManager.currentSelectedElement;
|
||||
if (EditorManager.instance.operationManager.currentSelectedElements.Count != 1) // TODO: 后续适应多选
|
||||
{
|
||||
LogWindow.Log("Please select only one Game Element to save the beatmap clip.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
GameElement selectedElement = EditorManager.instance.operationManager.currentSelectedElements[0];
|
||||
|
||||
if (selectedElement is null)
|
||||
{
|
||||
@@ -211,8 +217,14 @@ namespace Ichni
|
||||
LogWindow.Log("Clip not found", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
if (EditorManager.instance.operationManager.currentSelectedElements.Count != 1) // TODO: 后续适应多选
|
||||
{
|
||||
LogWindow.Log("Please select only one Game Element to load the beatmap clip.", Color.red);
|
||||
return;
|
||||
}
|
||||
|
||||
GameElement selectedElement = EditorManager.instance.operationManager.currentSelectedElement;
|
||||
GameElement selectedElement = EditorManager.instance.operationManager.currentSelectedElements[0];
|
||||
|
||||
if (selectedElement is null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user