Skip to content

on_load

fun <reified T : Entity> on_load(behaviour: T.(subject: T) -> Unit)
T.(subject: T) -> Unit
Example
on_load<Actor> { player ->
if (player.findComponent<AttackSettings>() == null) player.addComponent(AttackSettings())
}