@galacean/effects-plugin-model 2.8.0-alpha.0 → 2.8.0-alpha.2

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.
@@ -1,6 +1,6 @@
1
- import type { Scene, SceneLoadOptions, Composition, RenderFrame, Component, Renderer } from '@galacean/effects';
2
- import { AbstractPlugin, spec } from '@galacean/effects';
3
- import { CompositionCache, PSceneManager } from '../runtime';
1
+ import type { Scene, SceneLoadOptions, Composition, Engine, Component } from '@galacean/effects';
2
+ import { AbstractPlugin } from '@galacean/effects';
3
+ import { PSceneManager } from '../runtime';
4
4
  /**
5
5
  * Model 插件类,负责支持播放器中的 3D 功能
6
6
  */
@@ -9,41 +9,19 @@ export declare class ModelPlugin extends AbstractPlugin {
9
9
  * 插件名称
10
10
  */
11
11
  name: string;
12
- /**
13
- * 合成缓存器
14
- */
15
- cache: CompositionCache;
16
- /**
17
- * 场景参数
18
- */
19
- sceneParams: Record<string, any>;
12
+ processAssets(scene: Scene, options?: SceneLoadOptions | undefined): Promise<void>;
20
13
  /**
21
14
  * 整个 load 阶段都不会创建 GL 相关的对象,只创建 JS 对象
22
15
  * @param scene - 场景
23
16
  * @param options - 加载选项
24
17
  */
25
- static prepareResource(scene: Scene, options: SceneLoadOptions): Promise<void>;
26
- precompile(compositions: spec.CompositionData[], renderer: Renderer): Promise<void>;
18
+ prepareResource(scene: Scene, options: SceneLoadOptions, engine: Engine): void;
27
19
  /**
28
20
  * 创建 3D 场景管理器和缓存器
29
21
  * @param composition - 合成
30
22
  * @param scene - 场景
31
23
  */
32
24
  onCompositionConstructed(composition: Composition, scene: Scene): void;
33
- /**
34
- * 每次播放都会执行,包括重播,所以这里执行“小的销毁”和新的初始化
35
- * @param composition - 合成
36
- * @param renderFrame - 渲染帧
37
- */
38
- onCompositionReset(composition: Composition, renderFrame: RenderFrame): void;
39
- /**
40
- * 合成销毁,同时销毁 3D 场景对象和缓存
41
- * @param composition - 合成
42
- */
43
- onCompositionDestroyed(composition: Composition): void;
44
- }
45
- export interface ModelPluginOptions {
46
- cache: CompositionCache;
47
25
  }
48
26
  /**
49
27
  * 获取场景管理器,从合成中查找