Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | VarionDrakon |
Guys, help out, I don’t know how to rewrite this code in C#…
signal health_updated(health)
signal killed ()
export (float) var max_health = 100
onready var health = max_health
func kill():
pass
func _set_health(value):
var prev_health = health
health = clamp(value, 0, max_health)
health i= prev_health:
emit_signal("health_updated", health)
health == 0:
kill()
emit
I partially know how this miracle will look in C#, but it turns out crooked, can you recommend something?
Code by the way is not Mine, so do not scold