1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

feat(相机): 添加鼠标位置对相机偏移的影响

实现鼠标位置影响相机偏移的功能,使相机能够根据鼠标在屏幕上的位置进行轻微偏移,提升游戏交互体验
This commit is contained in:
2026-05-05 12:37:06 +08:00
parent 15e5bcb5bc
commit 0d3c1790af
4 changed files with 9 additions and 0 deletions
+1
View File
@@ -17,6 +17,7 @@ func _physics_process(_delta):
if is_instance_valid(UIState.player):
position = UIState.player.position + constantOffset
position += MathTool.sampleInCircle(shakeIntensity)
position += MouseTool.getPositionByScreen(Vector2.ONE * 0.5, self ) / 2
static func shake(millseconds: float, intensity: float = 10, steper: Callable = func(currentValue, _totalValue, _restPercent): return currentValue):
if StarterPanel.buildingShader: return