mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-10 13:47:12 +08:00
refactor(UI): 优化字段显示逻辑并添加平滑相机移动
将字段显示和隐藏逻辑提取为独立方法 为相机添加位置平滑效果 在游戏重启时重置初始饲料选择状态
This commit is contained in:
@@ -17,7 +17,6 @@ func _physics_process(_delta):
|
||||
if is_instance_valid(UIState.player):
|
||||
position = UIState.player.position + constantOffset
|
||||
position += MathTool.sampleInCircle(shakeIntensity)
|
||||
offset += ((get_global_mouse_position() - UIState.player.position).clampf(-100, 100) - offset) * 0.15
|
||||
|
||||
static func shake(millseconds: float, intensity: float = 10, steper: Callable = func(currentValue, _totalValue, _restPercent): return currentValue):
|
||||
if StarterPanel.buildingShader: return
|
||||
|
||||
@@ -10,8 +10,10 @@ static func restart(tree: SceneTree):
|
||||
for item in tree.get_nodes_in_group("items"):
|
||||
item.queue_free()
|
||||
|
||||
UIState.hideFields()
|
||||
OutGameStorage.saveInventory()
|
||||
CameraManager.shakeStop()
|
||||
WorldManager.timeRestart()
|
||||
StarterPanel.selectingFeed = true
|
||||
|
||||
UIState.setPanel("Starter")
|
||||
|
||||
Reference in New Issue
Block a user