📝Behavior Scripts
Behavior Scripts are ‘plugins’ of Morpheus.
Behavior Scripts are programs external to Morpheus Platform. They implement behaviors — event-based interactivity of Artifacts. Artifact developers can extend platform functionality using Behavior Scripts to make complex features out of simple blocks.
For example, a Scoreboard is a Content Display that changes its text every time it is hit by a Boxing Glove.
Hosting of Behavior Scripts
Behavior Scripts are designed to be developed by third parties as well as in-house. There are several options of where Behavior Scripts can be hosted:
Hosting | Pros | Cons |
---|---|---|
Local machine of a developer using | Quick turnaround for developing and debugging. |
|
Proprietary hosting of the developer | Host a script that integrates with custom products or services of the developer. |
|
Google Cloud account of the developer. | Same as above, but faster as it is uses same Google infrastructure. |
|
Morpheus Google Cloud, separate VM or part of Morpheus Backend. | Implement close-to-realtime behaviors. |
|
Same VM as Unity Server of a Place | Achieve better close-to-realtime performance |
|
Implemented as part of the app |
|
|
Assigning Behavior Scripts
For a Behavior Script to work, it must be associated with a certain behavior. In other words, a behavior must be created in a Place and then connected with Objects via Behaviors.
It could be done by several ways:
When an object is spawned, it can be already inhabited by a behavior (or behaviors).
behaviors can be specified either in Module Manifest or in Module Config.
Behavior Script URL
is provided in the spec.same specification may contain two filters —
listen
andcontrol
— which will serve as dynamic connectors of this particular.
place
messages can be sent with hope there is a Place Script which listens to them and enacts.
Behavior can change their sources
and subordinates
dynamically by sending messages as described above.
END
Last updated