feat: evaluation context
This commit is contained in:
parent
bda4b6383e
commit
ffb3657ad8
|
@ -83,6 +83,7 @@ room.on('entityAdded', (entity) => {
|
|||
if ('string' === typeof selfEntity) {
|
||||
if (entity === room.findEntity(selfEntity)) {
|
||||
selfEntity = entity;
|
||||
evaluationContext.selfEntity = selfEntity;
|
||||
// Add back our self entity traits.
|
||||
for (const type of selfEntityOnlyTraits) {
|
||||
entity.addTrait(type);
|
||||
|
@ -270,3 +271,11 @@ const UiComponent = <Ui
|
|||
throughputTicker={throughputTicker}
|
||||
/>;
|
||||
ReactDOM.render(UiComponent, stage.ui);
|
||||
// Eval.
|
||||
const evaluationContext = {
|
||||
room,
|
||||
selfEntity,
|
||||
stage,
|
||||
};
|
||||
// Just inject it into global for now.
|
||||
window.humus = evaluationContext;
|
||||
|
|
Loading…
Reference in New Issue
Block a user