diff --git a/examples/package.json b/examples/package.json index e006c0154..5dbd14f3c 100644 --- a/examples/package.json +++ b/examples/package.json @@ -8,7 +8,7 @@ "@newcar/mod-markdown": "workspace:0.3.0", "@newcar/mod-math": "workspace:*", "canvaskit-wasm": "0.39.1", - "newcar": "workspace:0.15.1", + "newcar": "workspace:1.0.0-alpha.0", "vite-plugin-node-polyfills": "^0.21.0" } } diff --git a/packages/basic/package.json b/packages/basic/package.json index db1315385..069699663 100644 --- a/packages/basic/package.json +++ b/packages/basic/package.json @@ -1,6 +1,6 @@ { "name": "@newcar/basic", - "version": "0.15.1", + "version": "1.0.0-alpha.0", "description": "The basic objects, animations and interpolators of newcar.", "author": "BugDuck Team", "license": "Apache-2.0", diff --git a/packages/core/package.json b/packages/core/package.json index e0c126c3c..11de0dda3 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@newcar/core", - "version": "0.15.1", + "version": "1.0.0-alpha.0", "description": "The core of newcar.", "author": "BugDuck Team", "license": "Apache-2.0", diff --git a/packages/core/src/localApp.ts b/packages/core/src/localApp.ts index fc2039abb..1608e3f12 100644 --- a/packages/core/src/localApp.ts +++ b/packages/core/src/localApp.ts @@ -2,7 +2,7 @@ import type { Canvas, CanvasKit, Surface } from 'canvaskit-wasm' import type { Scene } from './scene' import { initial } from './initial' import type { Widget } from './widget' -import type { CarPlugin } from './plugin' +import type { GlobalPlugin } from './plugin' export class LocalApp { scene: Scene @@ -16,7 +16,7 @@ export class LocalApp { public width: number, public height: number, private ck: CanvasKit, - private plugins: CarPlugin[], + private plugins: GlobalPlugin[], ) { for (const plugin of this.plugins) plugin.beforeSurfaceLoaded(this) @@ -53,7 +53,7 @@ export class LocalApp { plugin.beforePatch(app, app.scene.elapsed, app.last, app.scene.root) for (const plugin of app.plugins) - plugin.afterPatch(app, app.scene.elapsed, app.last, app.scene.root) + plugin.onPatch(app, app.scene.elapsed, app.last, app.scene.root) ;(function draw(widget: Widget) { widget.init(app.ck) app.canvas.save() @@ -66,7 +66,7 @@ export class LocalApp { // Animating. app.scene.root.runAnimation(app.scene.elapsed) - for (const plugin of app.plugins) plugin.afterUpdate(app, app.scene.elapsed) + for (const plugin of app.plugins) plugin.onUpdate(app, app.scene.elapsed) app.scene.elapsed += 1 } @@ -79,7 +79,7 @@ export class LocalApp { this.updates.push(updateFunc) } - use(plugin: CarPlugin) { + use(plugin: GlobalPlugin) { this.plugins.push(plugin) } diff --git a/packages/newcar/package.json b/packages/newcar/package.json index 0be692e8c..2c9d7b8e6 100644 --- a/packages/newcar/package.json +++ b/packages/newcar/package.json @@ -1,7 +1,7 @@ { "name": "newcar", "type": "module", - "version": "0.15.1", + "version": "1.0.0-alpha.0", "description": "A Highly configurable universal advanced engine, Born for creating animation rapidly.", "author": "BugDuck Team", "license": "Apache-2.0", diff --git a/packages/recorder/package.json b/packages/recorder/package.json index d7b95a22f..66768605b 100644 --- a/packages/recorder/package.json +++ b/packages/recorder/package.json @@ -1,6 +1,6 @@ { "name": "@newcar/recorder", - "version": "0.15.1", + "version": "1.0.0-alpha.0", "description": "The utils of newcar", "author": "BugDuck Team", "license": "Apache-2.0", diff --git a/packages/utils/package.json b/packages/utils/package.json index 94c2a4fd9..869691f02 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@newcar/utils", - "version": "0.15.1", + "version": "1.0.0-alpha.0", "description": "The utils of newcar", "author": "BugDuck Team", "license": "Apache-2.0",