|
@@ -28,7 +28,7 @@ export function registerDefault(ctx: PluginContext) {
|
|
|
export function SyncBehaviors(ctx: PluginContext) {
|
|
|
ctx.events.state.object.created.subscribe(o => {
|
|
|
if (!SO.isBehavior(o.obj)) return;
|
|
|
- o.obj.data.register();
|
|
|
+ o.obj.data.register(o.ref);
|
|
|
});
|
|
|
|
|
|
ctx.events.state.object.removed.subscribe(o => {
|
|
@@ -39,7 +39,7 @@ export function SyncBehaviors(ctx: PluginContext) {
|
|
|
ctx.events.state.object.updated.subscribe(o => {
|
|
|
if (o.action === 'recreate') {
|
|
|
if (o.oldObj && SO.isBehavior(o.oldObj)) o.oldObj.data.unregister();
|
|
|
- if (o.obj && SO.isBehavior(o.obj)) o.obj.data.register();
|
|
|
+ if (o.obj && SO.isBehavior(o.obj)) o.obj.data.register(o.ref);
|
|
|
}
|
|
|
});
|
|
|
}
|