mirror of
http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite.git
synced 2025-11-20 13:57:12 +08:00
(client) feat:健康给予,路径优化,结算界面,商店界面 (#60)
Co-authored-by: m0_75251201 <m0_75251201@noreply.gitcode.com> Reviewed-on: http://47.107.252.169:3000/Roguelite-Game-Developing-Team/Gen_Hack-and-Slash-Roguelite/pulls/60
This commit is contained in:
@@ -5,7 +5,7 @@ namespace Utils
|
||||
public static class MousePosition
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取鼠标的屏幕位置(以像素为单位)。
|
||||
/// 获取鼠标的屏幕位置(以像素为单位)。
|
||||
/// </summary>
|
||||
/// <returns>鼠标的屏幕位置 (Vector2)。</returns>
|
||||
public static Vector2 GetScreenPosition()
|
||||
@@ -14,17 +14,14 @@ namespace Utils
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取鼠标的二维世界位置(基于主摄像机的屏幕到世界转换)。
|
||||
/// 获取鼠标的二维世界位置(基于主摄像机的屏幕到世界转换)。
|
||||
/// </summary>
|
||||
/// <param name="camera">用于计算的摄像机,默认为主摄像机。</param>
|
||||
/// <returns>鼠标的二维世界位置 (Vector2)。</returns>
|
||||
public static Vector2 GetWorldPosition(Camera camera = null)
|
||||
{
|
||||
// 如果未指定摄像机,则使用主摄像机
|
||||
if (!camera)
|
||||
{
|
||||
camera = Camera.main;
|
||||
}
|
||||
if (!camera) camera = Camera.main;
|
||||
|
||||
// 获取鼠标屏幕位置
|
||||
var mouseScreenPosition = Input.mousePosition;
|
||||
@@ -37,7 +34,7 @@ namespace Utils
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取鼠标的二维世界位置并进行整数吸附(基于主摄像机的屏幕到世界转换)。
|
||||
/// 获取鼠标的二维世界位置并进行整数吸附(基于主摄像机的屏幕到世界转换)。
|
||||
/// </summary>
|
||||
/// <param name="camera">用于计算的摄像机,默认为主摄像机。</param>
|
||||
/// <returns>吸附后的二维世界位置 (Vector2Int)。</returns>
|
||||
|
||||
Reference in New Issue
Block a user