点击选中

This commit is contained in:
SoulliesOfficial
2025-04-16 08:33:34 -04:00
parent 11543b4997
commit 97427b0bf3
24 changed files with 634 additions and 139 deletions

View File

@@ -92,6 +92,7 @@ namespace Ichni
beatmapContainer.gameElementList.ForEach(gameElement =>
{
gameElement.AfterInitialize();
gameElement.Refresh();
});
}

View File

@@ -35,6 +35,7 @@ namespace Ichni.Editor
ResolutionHintsOperation();
UIOperation();
SwitchCameraOperation();
ClickSelectElement();
}
}
@@ -232,6 +233,20 @@ namespace Ichni.Editor
}
}
}
private void ClickSelectElement()
{
if (Mouse.current.leftButton.wasPressedThisFrame && !isPointerOverUI)
{
Vector2 mousePosition = Mouse.current.position.ReadValue();
Ray ray = EditorManager.instance.cameraManager.currentCamera.ScreenPointToRay(mousePosition);
if (Physics.Raycast(ray, out RaycastHit hit, float.MaxValue, LayerMask.GetMask("Selectable")))
{
GameElement clickedElement = hit.collider.GetComponent<GameElement>();//TODO: 对于Hold这种复杂的元素需要使用连接脚本进行获取
(clickedElement as IHaveSelectSubmodule)?.selectSubmodule.SelectGameElement();
}
}
}
}
public partial class InputListener

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using Ichni.RhythmGame;
using Ichni.RhythmGame.Beatmap;
using UnityEngine;
using UnityEngine.InputSystem;
namespace Ichni.Editor
{