@galacean/effects-specification 2.0.0-alpha.18 → 2.0.0-alpha.19

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/es/binary.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import type { DataType } from './components';
1
2
  import type { RenderLevel } from './type';
2
3
  import type { ValueType } from './number-expression';
3
4
  /**
@@ -25,6 +26,7 @@ export type BinaryType = 'u8' | 'i8' | 'i16' | 'u16' | 'f32' | 'u32' | 'i32' | '
25
26
  */
26
27
  export interface BinaryFile {
27
28
  url: string;
29
+ dataType: DataType.BinaryAsset;
28
30
  renderLevel?: RenderLevel;
29
31
  }
30
32
  export type BinaryEnv = 'studio' | 'runtime' | 'json';
@@ -1,5 +1,5 @@
1
- export declare class BuiltinObjectGUID {
2
- static readonly WhiteTexture = "whitetexture00000000000000000000";
3
- static readonly PBRShader = "pbr00000000000000000000000000000";
4
- static readonly UnlitShader = "unlit000000000000000000000000000";
5
- }
1
+ export declare const BuiltinObjectGUID: {
2
+ WhiteTexture: string;
3
+ PBRShader: string;
4
+ UnlitShader: string;
5
+ };
@@ -1,5 +1,5 @@
1
- export class BuiltinObjectGUID {
2
- static WhiteTexture = 'whitetexture00000000000000000000';
3
- static PBRShader = 'pbr00000000000000000000000000000';
4
- static UnlitShader = 'unlit000000000000000000000000000';
5
- }
1
+ export const BuiltinObjectGUID = {
2
+ WhiteTexture: 'whitetexture00000000000000000000',
3
+ PBRShader: 'pbr00000000000000000000000000000',
4
+ UnlitShader: 'unlit000000000000000000000000000',
5
+ };
@@ -16,6 +16,7 @@ export declare enum DataType {
16
16
  TimelineAsset = "TimelineAsset",
17
17
  TransformPlayableAsset = "TransformPlayableAsset",
18
18
  SpriteColorPlayableAsset = "SpriteColorPlayableAsset",
19
+ BinaryAsset = "BinaryAsset",
19
20
  MeshComponent = "MeshComponent",
20
21
  SkyboxComponent = "SkyboxComponent",
21
22
  LightComponent = "LightComponent",
@@ -23,6 +24,7 @@ export declare enum DataType {
23
24
  ModelPluginComponent = "ModelPluginComponent",
24
25
  TreeComponent = "TreeComponent",
25
26
  AnimationComponent = "AnimationComponent",
27
+ SpineComponent = "SpineComponent",
26
28
  TimelineClip = "TimelineClip"
27
29
  }
28
30
  export interface DataPath {
package/es/components.js CHANGED
@@ -16,6 +16,7 @@ export var DataType;
16
16
  DataType["TimelineAsset"] = "TimelineAsset";
17
17
  DataType["TransformPlayableAsset"] = "TransformPlayableAsset";
18
18
  DataType["SpriteColorPlayableAsset"] = "SpriteColorPlayableAsset";
19
+ DataType["BinaryAsset"] = "BinaryAsset";
19
20
  // FIXME: 先完成ECS的场景转换,后面移到spec中
20
21
  DataType["MeshComponent"] = "MeshComponent";
21
22
  DataType["SkyboxComponent"] = "SkyboxComponent";
@@ -24,6 +25,7 @@ export var DataType;
24
25
  DataType["ModelPluginComponent"] = "ModelPluginComponent";
25
26
  DataType["TreeComponent"] = "TreeComponent";
26
27
  DataType["AnimationComponent"] = "AnimationComponent";
28
+ DataType["SpineComponent"] = "SpineComponent";
27
29
  // Non-EffectObject
28
30
  DataType["TimelineClip"] = "TimelineClip";
29
31
  })(DataType || (DataType = {}));
@@ -1,4 +1,5 @@
1
1
  import type { BinaryPointer } from '../binary';
2
+ import type { ComponentData, DataPath, DataType } from '../components';
2
3
  import type { SizeOverLifetime, RotationOverLifetime, PositionOverLifetime, ColorOverLifetime, RendererOptions, ItemType } from '../type';
3
4
  import type { BaseItem, ItemEndBehavior } from './base-item';
4
5
  /**
@@ -6,12 +7,12 @@ import type { BaseItem, ItemEndBehavior } from './base-item';
6
7
  */
7
8
  export interface SpineItem extends BaseItem {
8
9
  /**
9
- * 元素类型 "spine"
10
- */
10
+ * 元素类型 "spine"
11
+ */
11
12
  type: ItemType.spine;
12
13
  /**
13
- * 插件元素渲染信息
14
- */
14
+ * 插件元素渲染信息
15
+ */
15
16
  content: SpineContent;
16
17
  endBehavior: ItemEndBehavior;
17
18
  }
@@ -49,16 +50,16 @@ export interface SpineContent {
49
50
  */
50
51
  export interface PluginSpineOption {
51
52
  /**
52
- * 当前使用的皮肤名称
53
- */
53
+ * 当前使用的皮肤名称
54
+ */
54
55
  activeSkin: string;
55
56
  /**
56
- * 当前使用的动画列表,1.5 之前为 string
57
- */
57
+ * 当前使用的动画列表,1.5 之前为 string
58
+ */
58
59
  activeAnimation: string[] | string;
59
60
  /**
60
- * 在 spines 资源数组中的索引
61
- */
61
+ * 在 spines 资源数组中的索引
62
+ */
62
63
  spine: number;
63
64
  /**
64
65
  * 默认融合时间
@@ -82,19 +83,35 @@ export interface PluginSpineOption {
82
83
  export type skeletonFileType = 'json' | 'skel';
83
84
  export interface SpineResource {
84
85
  /**
85
- * atlas 文件在 `bins` 中的指针
86
- */
86
+ * atlas 文件在 `bins` 中的指针
87
+ */
87
88
  atlas: BinaryPointer;
88
89
  /**
89
- * 骨骼文件
90
- */
90
+ * 骨骼文件
91
+ */
91
92
  skeleton: BinaryPointer;
92
93
  /**
93
- * skeleton 文件类型, `.skel/.json`
94
- */
94
+ * skeleton 文件类型, `.skel/.json`
95
+ */
95
96
  skeletonType: skeletonFileType;
96
97
  /**
97
- * 图像文件在 `scene.textures` 数组中的索引
98
- */
98
+ * 图像文件在 `scene.textures` 数组中的索引
99
+ */
99
100
  images: number[];
100
101
  }
102
+ export interface SpineComponent extends ComponentData {
103
+ dataType: DataType.SpineComponent;
104
+ options: PluginSpineOption;
105
+ resource: {
106
+ atlas: {
107
+ bins: DataPath;
108
+ source: [start: number, length?: number];
109
+ };
110
+ skeleton: {
111
+ bins: DataPath;
112
+ source: [start: number, length?: number];
113
+ };
114
+ images: DataPath[];
115
+ skeletonType: skeletonFileType;
116
+ };
117
+ }
package/es/scene.d.ts CHANGED
@@ -154,10 +154,6 @@ export interface JSONScene {
154
154
  * 数据模板下掉可以不要 FontBase[]
155
155
  */
156
156
  fonts?: FontBase[] | FontDefine[];
157
- /**
158
- * spine 资源
159
- */
160
- spines?: SpineResource[];
161
157
  /**
162
158
  * 二进制文件地址
163
159
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/effects-specification",
3
- "version": "2.0.0-alpha.18",
3
+ "version": "2.0.0-alpha.19",
4
4
  "description": "Galacean Effects JSON Specification",
5
5
  "module": "./es/index.js",
6
6
  "main": "./es/index.js",