@galacean/engine-loader 2.0.0-alpha.30 → 2.0.0-alpha.31
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/dist/main.js +36 -77
- package/dist/main.js.map +1 -1
- package/dist/module.js +37 -78
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
- package/types/index.d.ts +0 -1
- package/types/resource-deserialize/resources/parser/ReflectionParser.d.ts +9 -5
- package/types/schema/CommonSchema.d.ts +4 -0
- package/types/schema/MaterialSchema.d.ts +0 -43
- package/types/schema/SceneSchema.d.ts +2 -2
- package/types/ShaderChunkLoader.d.ts +0 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-loader",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.31",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
"libs/**/*"
|
|
20
20
|
],
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@galacean/engine-core": "2.0.0-alpha.
|
|
23
|
-
"@galacean/engine-
|
|
24
|
-
"@galacean/engine-
|
|
22
|
+
"@galacean/engine-core": "2.0.0-alpha.31",
|
|
23
|
+
"@galacean/engine-rhi-webgl": "2.0.0-alpha.31",
|
|
24
|
+
"@galacean/engine-math": "2.0.0-alpha.31"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
package/types/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class ReflectionParser {
|
|
|
9
9
|
constructor(_context: ParserContext, _refs: RefItem[]);
|
|
10
10
|
/**
|
|
11
11
|
* Apply v2 props to a component/object instance.
|
|
12
|
-
* Each prop value is resolved recursively (handling $ref, $type, $entity, $component, $signal).
|
|
12
|
+
* Each prop value is resolved recursively (handling $ref, $type, $class, $entity, $component, $signal).
|
|
13
13
|
*/
|
|
14
14
|
parseProps(instance: any, props?: Record<string, unknown>): Promise<any>;
|
|
15
15
|
/**
|
|
@@ -29,12 +29,16 @@ export declare class ReflectionParser {
|
|
|
29
29
|
* 2. Array → recurse each element
|
|
30
30
|
* 3. { $ref } → asset reference
|
|
31
31
|
* 4. { $type } → polymorphic type construct
|
|
32
|
-
* 5. { $
|
|
33
|
-
* 6. { $
|
|
34
|
-
* 7. { $
|
|
35
|
-
* 8.
|
|
32
|
+
* 5. { $class } → registered class constructor
|
|
33
|
+
* 6. { $entity } → entity reference by path (flat index + optional children descent)
|
|
34
|
+
* 7. { $component } → component reference
|
|
35
|
+
* 8. { $signal } → signal binding
|
|
36
|
+
* 9. plain object → recurse values (modify originValue in place if exists)
|
|
36
37
|
*/
|
|
37
38
|
private _resolveValue;
|
|
39
|
+
private _getRegisteredClass;
|
|
40
|
+
/** Promise-adapt {@link _getRegisteredClass} so $type/$class branches can fold into the resolver chain. */
|
|
41
|
+
private _resolveRegisteredClass;
|
|
38
42
|
private _resolveSignal;
|
|
39
43
|
private _resolveComponent;
|
|
40
44
|
private _resolveEntityRef;
|
|
@@ -11,6 +11,10 @@ export interface ComponentRef {
|
|
|
11
11
|
type: string;
|
|
12
12
|
index: number;
|
|
13
13
|
}
|
|
14
|
+
/** Reference to a registered runtime class constructor. */
|
|
15
|
+
export interface ClassRef {
|
|
16
|
+
$class: string;
|
|
17
|
+
}
|
|
14
18
|
export interface SignalListener {
|
|
15
19
|
target: {
|
|
16
20
|
$component: ComponentRef;
|
|
@@ -1,47 +1,5 @@
|
|
|
1
|
-
import { BlendFactor, BlendOperation, ColorWriteMask, CompareFunction, CullMode, RenderQueueType, StencilOperation } from "@galacean/engine-core";
|
|
2
1
|
import type { RefItem } from "./CommonSchema";
|
|
3
2
|
import type { IColor, IVector2, IVector3 } from "./BasicSchema";
|
|
4
|
-
export interface IRenderState {
|
|
5
|
-
blendState: {
|
|
6
|
-
targetBlendState: {
|
|
7
|
-
enabled: boolean;
|
|
8
|
-
colorBlendOperation: BlendOperation;
|
|
9
|
-
alphaBlendOperation: BlendOperation;
|
|
10
|
-
sourceColorBlendFactor: BlendFactor;
|
|
11
|
-
sourceAlphaBlendFactor: BlendFactor;
|
|
12
|
-
destinationColorBlendFactor: BlendFactor;
|
|
13
|
-
destinationAlphaBlendFactor: BlendFactor;
|
|
14
|
-
colorWriteMask: ColorWriteMask;
|
|
15
|
-
};
|
|
16
|
-
blendColor: IColor;
|
|
17
|
-
alphaToCoverage: boolean;
|
|
18
|
-
};
|
|
19
|
-
depthState: {
|
|
20
|
-
enabled: boolean;
|
|
21
|
-
writeEnabled: boolean;
|
|
22
|
-
compareFunction: CompareFunction;
|
|
23
|
-
};
|
|
24
|
-
stencilState: {
|
|
25
|
-
enabled: boolean;
|
|
26
|
-
referenceValue: number;
|
|
27
|
-
mask: number;
|
|
28
|
-
writeMask: number;
|
|
29
|
-
compareFunctionFront: CompareFunction;
|
|
30
|
-
compareFunctionBack: CompareFunction;
|
|
31
|
-
passOperationFront: StencilOperation;
|
|
32
|
-
passOperationBack: StencilOperation;
|
|
33
|
-
failOperationFront: StencilOperation;
|
|
34
|
-
failOperationBack: StencilOperation;
|
|
35
|
-
zFailOperationFront: StencilOperation;
|
|
36
|
-
zFailOperationBack: StencilOperation;
|
|
37
|
-
};
|
|
38
|
-
rasterState: {
|
|
39
|
-
cullMode: CullMode;
|
|
40
|
-
depthBias: number;
|
|
41
|
-
slopeScaledDepthBias: number;
|
|
42
|
-
};
|
|
43
|
-
renderQueueType: RenderQueueType;
|
|
44
|
-
}
|
|
45
3
|
export interface IMaterialSchema {
|
|
46
4
|
name: string;
|
|
47
5
|
shader: string;
|
|
@@ -55,7 +13,6 @@ export interface IMaterialSchema {
|
|
|
55
13
|
name: string;
|
|
56
14
|
value?: string;
|
|
57
15
|
}>;
|
|
58
|
-
renderState: IRenderState;
|
|
59
16
|
shaderRef: RefItem;
|
|
60
17
|
}
|
|
61
18
|
export declare enum MaterialLoaderType {
|
|
@@ -2,8 +2,8 @@ import { BackgroundMode, BackgroundTextureFillMode, DiffuseMode, FogMode, Shadow
|
|
|
2
2
|
import type { HierarchyFile } from "./HierarchySchema";
|
|
3
3
|
import type { Vec3Tuple, Vec4Tuple } from "./CommonSchema";
|
|
4
4
|
export declare enum SpecularMode {
|
|
5
|
-
Sky =
|
|
6
|
-
Custom =
|
|
5
|
+
Sky = 0,
|
|
6
|
+
Custom = 1
|
|
7
7
|
}
|
|
8
8
|
export interface SceneFile extends HierarchyFile {
|
|
9
9
|
scene: {
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { AssetPromise, LoadItem, Loader, ResourceManager } from "@galacean/engine-core";
|
|
2
|
-
export declare class ShaderChunkLoader extends Loader<void[]> {
|
|
3
|
-
private static _shaderIncludeRegex;
|
|
4
|
-
/**
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
static _loadChunksInCode(code: string, basePath: string, resourceManager: ResourceManager): Promise<void[]>;
|
|
8
|
-
load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<void[]>;
|
|
9
|
-
}
|