2025-08-26 22:31:28 +08:00
|
|
|
@tool
|
2025-08-26 20:46:02 +08:00
|
|
|
extends Control
|
2025-08-26 22:31:28 +08:00
|
|
|
class_name FullscreenPanelBase
|
|
|
|
|
|
2026-05-03 11:09:12 +08:00
|
|
|
@onready var animator: AnimationPlayer = $"%animator"
|
2025-08-26 22:31:28 +08:00
|
|
|
|
|
|
|
|
func hidePanel():
|
2026-01-25 21:18:25 +08:00
|
|
|
beforeClose()
|
2025-08-26 22:31:28 +08:00
|
|
|
animator.play("hide")
|
|
|
|
|
await animator.animation_finished
|
|
|
|
|
visible = false
|
|
|
|
|
afterClose()
|
2025-09-07 13:39:50 +08:00
|
|
|
func showPanel(args: Array = []):
|
|
|
|
|
beforeOpen(args)
|
2025-08-26 22:31:28 +08:00
|
|
|
visible = true
|
|
|
|
|
animator.play("show")
|
|
|
|
|
await animator.animation_finished
|
2026-01-25 21:18:25 +08:00
|
|
|
afterOpen(args)
|
2025-08-26 22:31:28 +08:00
|
|
|
|
|
|
|
|
# 钩子
|
2025-09-07 13:39:50 +08:00
|
|
|
func beforeOpen(_args: Array = []):
|
2025-08-26 22:31:28 +08:00
|
|
|
pass
|
2026-01-25 21:18:25 +08:00
|
|
|
func afterOpen(_args: Array = []):
|
|
|
|
|
pass
|
|
|
|
|
func beforeClose():
|
|
|
|
|
pass
|
2025-08-26 22:31:28 +08:00
|
|
|
func afterClose():
|
|
|
|
|
pass
|