@vyr/remote 0.0.2 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/RemoteExecutor.ts +11 -6
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@vyr/remote","version":"0.0.
|
|
1
|
+
{"name":"@vyr/remote","version":"0.0.4","description":"","main":"./src/index.ts","author":"","license":"MIT","dependencies":{"dom-to-image":"^2.6.0","@vyr/locale":"0.0.4","@vyr/declare":"0.0.4","@vyr/engine":"0.0.4"},"files":["package.json","src/"]}
|
package/src/RemoteExecutor.ts
CHANGED
|
@@ -21,6 +21,7 @@ class RemoteExecutor {
|
|
|
21
21
|
|
|
22
22
|
this.process.scene = task.params.url
|
|
23
23
|
await Asset.loadAll(task.params.url)
|
|
24
|
+
await Asset.compileDataset(task.params.url, this.process.engine)
|
|
24
25
|
|
|
25
26
|
//渲染新场景
|
|
26
27
|
const scheduler = Asset.get<ServiceSchedulerDescriptor>(task.params.url)
|
|
@@ -82,6 +83,7 @@ class RemoteExecutor {
|
|
|
82
83
|
}
|
|
83
84
|
|
|
84
85
|
await Asset.loadAll(this.process.scene)
|
|
86
|
+
await Asset.compileDataset(this.process.scene, this.process.engine)
|
|
85
87
|
this.sendAnimationUnitToRemote(0, getAnimationUnit(this.process.scheduler))
|
|
86
88
|
}
|
|
87
89
|
async removeyScene(task: InstanceType<typeof Job['scene']['remove']['Task']>) {
|
|
@@ -133,6 +135,7 @@ class RemoteExecutor {
|
|
|
133
135
|
this.updateOtherUpdateJob(target, task.params.content)
|
|
134
136
|
target.syncWith(task.params.content)
|
|
135
137
|
await Asset.loadAll(this.process.scene)
|
|
138
|
+
await Asset.compileDataset(this.process.scene, this.process.engine)
|
|
136
139
|
|
|
137
140
|
this.sendAnimationUnitToRemote(0, getAnimationUnit(this.process.scheduler))
|
|
138
141
|
|
|
@@ -147,6 +150,7 @@ class RemoteExecutor {
|
|
|
147
150
|
|
|
148
151
|
this.process.asset = task.params.url
|
|
149
152
|
await Asset.loadAll(task.params.url)
|
|
153
|
+
await Asset.compileDataset(task.params.url, this.process.engine)
|
|
150
154
|
|
|
151
155
|
const scheduler = new ServiceSchedulerDescriptor()
|
|
152
156
|
const descriptor = Asset.get<Descriptor>(task.params.url)
|
|
@@ -219,6 +223,7 @@ class RemoteExecutor {
|
|
|
219
223
|
|
|
220
224
|
await Asset.loadAll(task.params.url)
|
|
221
225
|
Asset.graph.update(this._defaultScheduleUrl)
|
|
226
|
+
await Asset.compileDataset(task.params.url, this.process.engine)
|
|
222
227
|
|
|
223
228
|
this.sendAnimationUnitToRemote(0, getAnimationUnitByAsset(task.params.url))
|
|
224
229
|
}
|
|
@@ -272,6 +277,7 @@ class RemoteExecutor {
|
|
|
272
277
|
target.syncWith(task.params.content)
|
|
273
278
|
await Asset.loadAll(task.params.url)
|
|
274
279
|
Asset.graph.update(this._defaultScheduleUrl)
|
|
280
|
+
await Asset.compileDataset(this.process.scene, this.process.engine)
|
|
275
281
|
|
|
276
282
|
this.sendAnimationUnitToRemote(0, getAnimationUnitByAsset(task.params.url))
|
|
277
283
|
|
|
@@ -387,15 +393,14 @@ class RemoteExecutor {
|
|
|
387
393
|
}
|
|
388
394
|
}
|
|
389
395
|
|
|
390
|
-
enhance(process: RemoteProcess, schedulerWrapper: ((
|
|
396
|
+
enhance(process: RemoteProcess, schedulerWrapper: ((graphics: Graphics) => void) | null = null) {
|
|
391
397
|
const executor = process.getExecutor()
|
|
392
398
|
const listen = Compilation.prototype.listen
|
|
393
399
|
|
|
394
|
-
Compilation.prototype.listen = function (
|
|
395
|
-
if (schedulerWrapper !== null) schedulerWrapper(
|
|
396
|
-
listen.call(this,
|
|
397
|
-
|
|
398
|
-
if (graphics === null || graphics.__VYR_REMOTE_WRAPPER === true) return graphics
|
|
400
|
+
Compilation.prototype.listen = function (graphics: Graphics) {
|
|
401
|
+
if (schedulerWrapper !== null) schedulerWrapper(graphics)
|
|
402
|
+
listen.call(this, graphics)
|
|
403
|
+
if (graphics.__VYR_REMOTE_WRAPPER === true) return graphics
|
|
399
404
|
graphics.__VYR_REMOTE_WRAPPER = true
|
|
400
405
|
|
|
401
406
|
return graphics
|