1
Fork 0
mirror of https://github.com/Steffo99/swear-jar.git synced 2024-11-25 17:14:20 +00:00
swear-jar/color/Colored.gd

15 lines
306 B
GDScript3
Raw Normal View History

2023-10-02 13:45:13 +00:00
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