mirror of
https://github.com/Steffo99/swear-jar.git
synced 2024-11-25 00:54:19 +00:00
15 lines
306 B
GDScript3
15 lines
306 B
GDScript3
|
extends Node
|
||
|
class_name Colored
|
||
|
|
||
|
@export var shader: Shader
|
||
|
|
||
|
@onready var hue: float = Randomizer.rng.randf()
|
||
|
@onready var parent: Sprite2D = get_parent()
|
||
|
|
||
|
|
||
|
func _ready():
|
||
|
var material = ShaderMaterial.new()
|
||
|
material.shader = shader
|
||
|
material.set_shader_parameter("hue", hue)
|
||
|
parent.material = material
|