Functions
Function Registration
fn spawn_dialogue_runner(mut commands: Commands, project: Res<YarnProject>) {
let mut dialogue_runner = project.create_dialogue_runner();
// Add our custom function to the dialogue runner
dialogue_runner.library_mut().add_function("pow", pow);
dialogue_runner.start_node("Start");
commands.spawn(dialogue_runner);
}
fn pow(base: f32, exponent: f32) -> f32 {
base.powf(exponent)
}dialogue_runner.library_mut().add_function("pow", pow);
Allowed Signatures
Size constraints
Was this helpful?
