2023-11-11 14:56:43 -07:00
|
|
|
extends Node3D
|
|
|
|
|
|
|
|
func _ready():
|
|
|
|
set_charge(0.0)
|
|
|
|
|
2023-11-11 16:12:46 -07:00
|
|
|
var charge_amount: float = 0.0
|
|
|
|
|
2023-11-11 14:56:43 -07:00
|
|
|
func set_charge(amount: float):
|
2023-11-11 16:12:46 -07:00
|
|
|
charge_amount = amount
|
2023-11-11 14:56:43 -07:00
|
|
|
var mat: ShaderMaterial = $MeshInstance3D.get_active_material(0)
|
|
|
|
mat.set_shader_parameter("charge", amount)
|
2023-11-11 16:12:46 -07:00
|
|
|
|