Skip to content

Commit

Permalink
make scripts a resource
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Jun 12, 2024
1 parent 8265b2b commit 9fc9aa8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions spatial/wit/wired-script/world.wit
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
package wired:script;

world script {
export lifecycle;
export types;
}

interface lifecycle {
// Arbitrary script data persisted between updates.
resource data {}
interface types {
// Script resource that will be instantiated by the host.
resource script {
constructor();

// Called once to initialize the script.
init: func() -> data;

// Called every tick.
update: func(delta: f32, data: borrow<data>);
// Called every tick.
update: func(delta: f32);
}
}

0 comments on commit 9fc9aa8

Please sign in to comment.