added entity script example

This commit is contained in:
Antoine Pilote
2021-06-13 18:27:41 -04:00
parent 6134437d86
commit 43297e2752

View File

@@ -1,2 +1,31 @@
Entity scripts
==============
==============
Entity scripts are Wren scripts that are attached to an entity using the WrenScript component.
After attaching the WrenScript component on an entity, you can select the script file directly.
In addition to pointing to the script file, you need to specify which class in the script is considered as the
entity script.
The class chosen must inherite from ScriptableEntity.
Here is an example of a barebone entity scripts::
import "Scripts/ScriptableEntity" for ScriptableEntity
class TestScript is ScriptableEntity {
construct new() {
}
init() {
}
update(ts) {
}
exit() {
}
}