All
This commit is contained in:
parent
7a8ee29dcb
commit
0fe23420ab
800 changed files with 16547 additions and 0 deletions
22
scenes/scripts/wood_pile.gd
Normal file
22
scenes/scripts/wood_pile.gd
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
extends Sprite2D
|
||||
|
||||
@export var fade_duration: float = 0.5
|
||||
var tween: Tween
|
||||
|
||||
func _ready():
|
||||
# Start with outline invisible
|
||||
material.set_shader_parameter("outline_alpha", 0.0)
|
||||
start_continuous_fade()
|
||||
|
||||
func start_continuous_fade():
|
||||
tween = create_tween()
|
||||
tween.set_loops() # Makes it loop infinitely
|
||||
tween.tween_method(set_outline_alpha, 0.0, 1.0, fade_duration)
|
||||
tween.tween_method(set_outline_alpha, 1.0, 0.0, fade_duration)
|
||||
|
||||
func set_outline_alpha(value: float):
|
||||
material.set_shader_parameter("outline_alpha", value)
|
||||
|
||||
func stop_fade():
|
||||
if tween:
|
||||
tween.kill()
|
||||
Loading…
Add table
Add a link
Reference in a new issue