mirror of
https://github.com/Steffo99/swear-jar.git
synced 2024-11-28 18:34:18 +00:00
14 lines
306 B
GDScript
14 lines
306 B
GDScript
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
|