@galacean/engine-loader 1.2.0-beta.6 → 1.2.0

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@galacean/engine-loader",
3
- "version": "1.2.0-beta.6",
3
+ "version": "1.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public",
6
6
  "registry": "https://registry.npmjs.org"
@@ -15,9 +15,9 @@
15
15
  "types/**/*"
16
16
  ],
17
17
  "dependencies": {
18
- "@galacean/engine-core": "1.2.0-beta.6",
19
- "@galacean/engine-rhi-webgl": "1.2.0-beta.6",
20
- "@galacean/engine-math": "1.2.0-beta.6"
18
+ "@galacean/engine-core": "1.2.0",
19
+ "@galacean/engine-rhi-webgl": "1.2.0",
20
+ "@galacean/engine-math": "1.2.0"
21
21
  },
22
22
  "scripts": {
23
23
  "b:types": "tsc"
@@ -0,0 +1,5 @@
1
+ import { AssetPromise, Loader, LoadItem, ResourceManager } from "@galacean/engine-core";
2
+ import { PrefabResource } from "./prefab/PrefabResource";
3
+ export declare class PrefabLoader extends Loader<PrefabResource> {
4
+ load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<PrefabResource>;
5
+ }
@@ -694,7 +694,7 @@ export interface IScene extends IChildRootProperty {
694
694
  /**
695
695
  * The indices of each root node
696
696
  */
697
- nodes: number[];
697
+ nodes?: number[];
698
698
  }
699
699
  /**
700
700
  * Joints and matrices defining a skin
@@ -1,11 +1,24 @@
1
1
  declare module "@galacean/engine-core" {
2
2
  interface EngineConfiguration {
3
- /** glTF loader options. */
3
+ glTFLoader?: {
4
+ /** Meshopt options. If set this option and workCount is great than 0, workers will be created. */
5
+ meshOpt?: {
6
+ /**
7
+ * Worker count for transcoder.
8
+ * @defaultValue 4
9
+ */
10
+ workerCount?: number;
11
+ };
12
+ };
13
+ /** @deprecated glTF loader options. */
4
14
  glTF?: {
5
15
  /** Meshopt options. If set this option and workCount is great than 0, workers will be created. */
6
16
  meshOpt?: {
7
- /** Worker count for transcoder, default is 4. */
8
- workerCount: number;
17
+ /**
18
+ * Worker count for transcoder.
19
+ * @defaultValue 4
20
+ */
21
+ workerCount?: number;
9
22
  };
10
23
  };
11
24
  }
@@ -1,8 +1,12 @@
1
- declare const MeshoptDecoder: {
1
+ export declare let ready: Promise<{
2
2
  workerCount: number;
3
- ready: Promise<void>;
4
- useWorkers: () => void;
3
+ useWorkers: (count?: number) => void;
5
4
  decodeGltfBuffer: (count: any, stride: any, source: any, mode: any, filter: any) => Promise<Uint8Array>;
6
- release(): void;
7
- };
8
- export { MeshoptDecoder };
5
+ release: () => void;
6
+ }>;
7
+ export declare function getMeshoptDecoder(): Promise<{
8
+ workerCount: number;
9
+ useWorkers: (count?: number) => void;
10
+ decodeGltfBuffer: (count: any, stride: any, source: any, mode: any, filter: any) => Promise<Uint8Array>;
11
+ release: () => void;
12
+ }>;
@@ -0,0 +1,11 @@
1
+ import { Engine, Entity } from "@galacean/engine-core";
2
+ import { HierarchyParser } from "../resource-deserialize/resources/parser/HierarchyParser";
3
+ import { PrefabResource } from "./PrefabResource";
4
+ import { IHierarchyFile, ParserContext } from "../resource-deserialize";
5
+ export declare class PrefabParser extends HierarchyParser<PrefabResource, ParserContext<IHierarchyFile, Entity>> {
6
+ readonly prefabResource: PrefabResource;
7
+ static parse(engine: Engine, url: string, data: IHierarchyFile): Promise<PrefabResource>;
8
+ constructor(data: IHierarchyFile, context: ParserContext<IHierarchyFile, Entity>, prefabResource: PrefabResource);
9
+ protected _handleRootEntity(id: string): void;
10
+ protected _clearAndResolve(): PrefabResource;
11
+ }
@@ -0,0 +1,25 @@
1
+ import { Engine, Entity, ReferResource } from "@galacean/engine-core";
2
+ /**
3
+ * The Prefab resource.
4
+ */
5
+ export declare class PrefabResource extends ReferResource {
6
+ readonly url: string;
7
+ /** @internal */
8
+ _root: Entity;
9
+ private _dependenceAssets;
10
+ /**
11
+ * @internal
12
+ * @param url - The url of the prefab
13
+ */
14
+ constructor(engine: Engine, url: string);
15
+ /**
16
+ * Instantiate prefab.
17
+ * @returns prefab's root entity
18
+ */
19
+ instantiate(): Entity;
20
+ /**
21
+ * @internal
22
+ */
23
+ _addDependenceAsset(resource: ReferResource): void;
24
+ protected _onDestroy(): void;
25
+ }
@@ -1,4 +1,4 @@
1
- import { BackgroundMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
1
+ import { BackgroundMode, BackgroundTextureFillMode, DiffuseMode, FogMode, ShadowCascadesMode, ShadowResolution } from "@galacean/engine-core";
2
2
  import type { IReferable } from "@galacean/engine-core/types/asset/IReferable";
3
3
  import type { IColor, IPrefabFile, IVector3 } from "./BasicSchema";
4
4
  export declare enum SpecularMode {
@@ -11,6 +11,7 @@ export interface IScene extends IPrefabFile {
11
11
  mode: BackgroundMode;
12
12
  color: IColor;
13
13
  texture?: IReferable;
14
+ textureFillMode?: BackgroundTextureFillMode;
14
15
  skyMesh?: IReferable;
15
16
  skyMaterial?: IReferable;
16
17
  };
@@ -1 +0,0 @@
1
- export {};
@@ -1,2 +0,0 @@
1
- import { Component, Entity } from "@galacean/engine-core";
2
- export declare const ComponentMap: Record<string, new (entity: Entity) => Component>;
@@ -1,5 +0,0 @@
1
- import { Entity } from "@galacean/engine-core";
2
- import type { IEntity } from "../schema";
3
- export declare class PrefabParser {
4
- static parseChildren(entitiesConfig: Map<string, IEntity>, entities: Map<string, Entity>, parentId: string): void;
5
- }