点击选中
This commit is contained in:
@@ -92,6 +92,7 @@ namespace Ichni
|
||||
beatmapContainer.gameElementList.ForEach(gameElement =>
|
||||
{
|
||||
gameElement.AfterInitialize();
|
||||
|
||||
gameElement.Refresh();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using Ichni.RhythmGame;
|
||||
using Ichni.RhythmGame.Beatmap;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
namespace Ichni.Editor
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user