@galacean/engine-core 0.0.0-experimental-0.9-plus.8 → 0.0.0-experimental-double11.1

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.
Files changed (168) hide show
  1. package/dist/main.js +15851 -13975
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +15851 -13975
  4. package/dist/module.js +15837 -13971
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/atlas/SpriteAtlas.d.ts +2 -6
  8. package/types/2d/enums/SpriteDirtyFlag.d.ts +13 -0
  9. package/types/2d/enums/SpriteDrawMode.d.ts +4 -2
  10. package/types/2d/index.d.ts +1 -0
  11. package/types/2d/sprite/Sprite.d.ts +5 -2
  12. package/types/2d/sprite/SpriteMask.d.ts +0 -11
  13. package/types/2d/sprite/SpriteRenderer.d.ts +15 -11
  14. package/types/2d/text/Font.d.ts +2 -7
  15. package/types/2d/text/TextRenderer.d.ts +0 -11
  16. package/types/2d/text/index.d.ts +1 -0
  17. package/types/Camera.d.ts +27 -8
  18. package/types/Component.d.ts +0 -8
  19. package/types/ComponentsDependencies.d.ts +17 -9
  20. package/types/ComponentsManager.d.ts +3 -2
  21. package/types/DisorderedArray.d.ts +4 -3
  22. package/types/Engine.d.ts +35 -43
  23. package/types/Entity.d.ts +2 -2
  24. package/types/ListenerUpdateFlag.d.ts +12 -0
  25. package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
  26. package/types/RenderPipeline/BasicRenderPipeline.d.ts +8 -6
  27. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  28. package/types/RenderPipeline/RenderElement.d.ts +8 -8
  29. package/types/RenderPipeline/RenderPass.d.ts +1 -1
  30. package/types/RenderPipeline/RenderQueue.d.ts +3 -5
  31. package/types/RenderPipeline/SpriteMaskBatcher.d.ts +4 -3
  32. package/types/Renderer.d.ts +3 -12
  33. package/types/Scene.d.ts +0 -1
  34. package/types/Script.d.ts +18 -15
  35. package/types/Transform.d.ts +10 -12
  36. package/types/Utils.d.ts +28 -0
  37. package/types/animation/AnimationClip.d.ts +2 -1
  38. package/types/animation/Animator.d.ts +7 -4
  39. package/types/animation/AnimatorStateTransition.d.ts +12 -0
  40. package/types/animation/AnimatorTransitionBase.d.ts +10 -0
  41. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
  42. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  43. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  44. package/types/animation/enums/LayerState.d.ts +3 -1
  45. package/types/animation/enums/StateMachineState.d.ts +13 -0
  46. package/types/animation/index.d.ts +0 -4
  47. package/types/animation/internal/AnimatorPlayableObject.d.ts +23 -0
  48. package/types/animation/internal/CrossCurveData.d.ts +1 -0
  49. package/types/animation/internal/animationCurveOwner/Assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts +1 -0
  50. package/types/animation/internal/animationCurveOwner/Assembler/IAnimationCurveOwnerAssembler.d.ts +1 -0
  51. package/types/animation/internal/animationCurveOwner/Assembler/PositionAnimationCurveOwnerAssembler.d.ts +1 -0
  52. package/types/animation/internal/animationCurveOwner/Assembler/RotationAnimationCurveOwnerAssembler.d.ts +1 -0
  53. package/types/animation/internal/animationCurveOwner/Assembler/ScaleAnimationCurveOwnerAssembler.d.ts +1 -0
  54. package/types/animation/internal/animationCurveOwner/Assembler/UniversalAnimationCurveOwnerAssembler.d.ts +1 -0
  55. package/types/asset/AssetType.d.ts +16 -16
  56. package/types/asset/LoadItem.d.ts +16 -9
  57. package/types/asset/ResourceManager.d.ts +17 -9
  58. package/types/asset/request.d.ts +7 -3
  59. package/types/base/Constant.d.ts +2 -1
  60. package/types/base/EngineObject.d.ts +1 -0
  61. package/types/base/EventDispatcher.d.ts +2 -15
  62. package/types/base/Time.d.ts +25 -24
  63. package/types/base/index.d.ts +0 -2
  64. package/types/enums/DepthTextureMode.d.ts +7 -0
  65. package/types/env-probe/CubeProbe.d.ts +0 -7
  66. package/types/env-probe/Probe.d.ts +0 -6
  67. package/types/fog/EXP2Fog.d.ts +15 -0
  68. package/types/fog/Fog.d.ts +14 -0
  69. package/types/fog/LinearFog.d.ts +22 -0
  70. package/types/fog/index.d.ts +3 -0
  71. package/types/graphic/Buffer.d.ts +5 -12
  72. package/types/graphic/Mesh.d.ts +5 -16
  73. package/types/graphic/Primitive.d.ts +1 -0
  74. package/types/graphic/SubPrimitive.d.ts +9 -0
  75. package/types/index.d.ts +8 -7
  76. package/types/input/InputManager.d.ts +1 -1
  77. package/types/input/interface/IInput.d.ts +1 -1
  78. package/types/lighting/AmbientLight.d.ts +4 -1
  79. package/types/lighting/DirectLight.d.ts +0 -1
  80. package/types/lighting/Light.d.ts +0 -1
  81. package/types/lighting/LightManager.d.ts +1 -0
  82. package/types/lighting/SpotLight.d.ts +0 -1
  83. package/types/material/BaseMaterial.d.ts +8 -10
  84. package/types/material/BlinnPhongMaterial.d.ts +0 -3
  85. package/types/material/Material.d.ts +3 -6
  86. package/types/material/PBRMaterial.d.ts +1 -1
  87. package/types/material/PBRSpecularMaterial.d.ts +1 -1
  88. package/types/material/UnlitMaterial.d.ts +1 -1
  89. package/types/mesh/BlendShape.d.ts +1 -1
  90. package/types/mesh/BlendShapeFrame.d.ts +28 -6
  91. package/types/mesh/MeshRenderer.d.ts +1 -11
  92. package/types/mesh/ModelMesh.d.ts +5 -5
  93. package/types/mesh/PrimitiveMesh.d.ts +4 -2
  94. package/types/mesh/SkinnedMeshRenderer.d.ts +0 -15
  95. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  96. package/types/particle/ParticleGenerator.d.ts +72 -0
  97. package/types/particle/ParticleMaterial.d.ts +28 -0
  98. package/types/particle/ParticleRenderer.d.ts +2 -2
  99. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  100. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  101. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  102. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  103. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  104. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  105. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  106. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  107. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  108. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  109. package/types/particle/modules/Burst.d.ts +14 -0
  110. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  111. package/types/particle/modules/EmissionModule.d.ts +45 -0
  112. package/types/particle/modules/MainModule.d.ts +68 -0
  113. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  114. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  115. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  116. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  117. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  118. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  119. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  120. package/types/particle/modules/TextureSheetAnimationModule.d.ts +42 -0
  121. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  122. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  123. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  124. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  125. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  126. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  127. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  128. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  129. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  130. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  131. package/types/particle/modules/shape/index.d.ts +6 -0
  132. package/types/physics/CharacterController.d.ts +0 -2
  133. package/types/physics/Collider.d.ts +3 -2
  134. package/types/physics/PhysicsManager.d.ts +5 -22
  135. package/types/physics/PhysicsScene.d.ts +6 -2
  136. package/types/physics/joint/HingeJoint.d.ts +2 -2
  137. package/types/physics/joint/Joint.d.ts +3 -4
  138. package/types/physics/joint/SpringJoint.d.ts +3 -2
  139. package/types/physics/shape/BoxColliderShape.d.ts +2 -0
  140. package/types/physics/shape/CapsuleColliderShape.d.ts +2 -0
  141. package/types/physics/shape/ColliderShape.d.ts +4 -1
  142. package/types/physics/shape/PlaneColliderShape.d.ts +1 -0
  143. package/types/physics/shape/SphereColliderShape.d.ts +2 -0
  144. package/types/renderingHardwareInterface/index.d.ts +1 -0
  145. package/types/shader/Shader.d.ts +32 -23
  146. package/types/shader/ShaderData.d.ts +24 -24
  147. package/types/shader/ShaderMacro.d.ts +16 -0
  148. package/types/shader/ShaderPass.d.ts +9 -2
  149. package/types/shader/ShaderProperty.d.ts +7 -0
  150. package/types/shader/enums/RenderStateElementKey.d.ts +58 -0
  151. package/types/shader/index.d.ts +5 -1
  152. package/types/shaderlib/particle/index.d.ts +14 -0
  153. package/types/shadow/CascadedShadowCasterPass.d.ts +0 -1
  154. package/types/shadow/enum/ShadowMode.d.ts +13 -0
  155. package/types/sky/SkyBoxMaterial.d.ts +27 -9
  156. package/types/sky/index.d.ts +1 -0
  157. package/types/texture/RenderTarget.d.ts +2 -6
  158. package/types/texture/Texture.d.ts +8 -6
  159. package/types/texture/Texture2D.d.ts +3 -1
  160. package/types/texture/index.d.ts +1 -0
  161. package/types/trail/TrailRenderer.d.ts +0 -5
  162. package/types/SafeLoopArray.d.ts +0 -37
  163. /package/types/{animation/internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler.d.ts → RenderPipeline/CullingResults.d.ts} +0 -0
  164. /package/types/{animation/internal/animationCurveOwner/assembler/IAnimationCurveOwnerAssembler.d.ts → RenderPipeline/DepthOnlyPass.d.ts} +0 -0
  165. /package/types/{animation/internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler.d.ts → RenderPipeline/PipelineUtils.d.ts} +0 -0
  166. /package/types/animation/{internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler.d.ts → AnimatorStatePlayData.d.ts} +0 -0
  167. /package/types/animation/internal/{animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler.d.ts → AnimatorStateInfo.d.ts} +0 -0
  168. /package/types/animation/internal/{animationCurveOwner/assembler/UniversalAnimationCurveOwnerAssembler.d.ts → AnimatorStateMachineData.d.ts} +0 -0
@@ -1,21 +1,19 @@
1
1
  import { Camera } from "../Camera";
2
2
  import { Engine } from "../Engine";
3
3
  import { Layer } from "../Layer";
4
- import { Material } from "../material/Material";
5
- import { Shader } from "../shader";
6
4
  import { RenderElement } from "./RenderElement";
7
5
  /**
8
6
  * Render queue.
9
7
  */
10
8
  export declare class RenderQueue {
11
- readonly items: RenderElement[];
9
+ readonly elements: RenderElement[];
12
10
  private _spriteBatcher;
13
11
  constructor(engine: Engine);
14
12
  /**
15
13
  * Push a render element.
16
14
  */
17
- pushPrimitive(element: RenderElement): void;
18
- render(camera: Camera, replaceMaterial: Material, mask: Layer, customShader: Shader): void;
15
+ pushRenderElement(element: RenderElement): void;
16
+ render(camera: Camera, mask: Layer): void;
19
17
  /**
20
18
  * Clear collection.
21
19
  */
@@ -1,10 +1,11 @@
1
1
  import { Camera } from "../Camera";
2
2
  import { VertexElement } from "../graphic/VertexElement";
3
3
  import { Basic2DBatcher } from "./Basic2DBatcher";
4
- import { SpriteMaskElement } from "./SpriteMaskElement";
4
+ import { RenderElement } from "./RenderElement";
5
+ import { SpriteMaskRenderData } from "./SpriteMaskRenderData";
5
6
  export declare class SpriteMaskBatcher extends Basic2DBatcher {
6
7
  createVertexElements(vertexElements: VertexElement[]): number;
7
- canBatch(preElement: SpriteMaskElement, curElement: SpriteMaskElement): boolean;
8
- updateVertices(element: SpriteMaskElement, vertices: Float32Array, vertexIndex: number): number;
8
+ canBatch(preElement: RenderElement, curElement: RenderElement): boolean;
9
+ updateVertices(element: SpriteMaskRenderData, vertices: Float32Array, vertexIndex: number): number;
9
10
  drawBatches(camera: Camera): void;
10
11
  }
@@ -1,13 +1,11 @@
1
- import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
1
+ import { BoundingBox, Vector4 } from "@galacean/engine-math";
2
2
  import { Component } from "./Component";
3
- import { RenderContext } from "./RenderPipeline/RenderContext";
4
- import { TransformModifyFlags } from "./Transform";
5
3
  import { ICustomClone } from "./clone/ComponentCloner";
6
- import { Material } from "./material/Material";
4
+ import { Material } from "./material";
7
5
  import { ShaderData } from "./shader/ShaderData";
8
6
  /**
9
7
  * Basis for all renderers.
10
- * @decorator `@dependentComponents(Transform)`
8
+ * @decorator `@dependentComponents(Transform, DependentMode.CheckOnly)`
11
9
  */
12
10
  export declare class Renderer extends Component implements ICustomClone {
13
11
  private static _tempVector0;
@@ -112,12 +110,5 @@ export declare class Renderer extends Component implements ICustomClone {
112
110
  */
113
111
  setMaterials(materials: Material[]): void;
114
112
  update(deltaTime: number): void;
115
- protected _updateShaderData(context: RenderContext): void;
116
- protected _updateTransformShaderData(context: RenderContext, worldMatrix: Matrix): void;
117
- protected _registerEntityTransformListener(): void;
118
- protected _updateBounds(worldBounds: BoundingBox): void;
119
- protected _render(context: RenderContext): void;
120
- private _createInstanceMaterial;
121
113
  private _setMaterial;
122
- protected _onTransformChanged(type: TransformModifyFlags): void;
123
114
  }
package/types/Scene.d.ts CHANGED
@@ -38,7 +38,6 @@ export declare class Scene extends EngineObject {
38
38
  private _fogEnd;
39
39
  private _fogDensity;
40
40
  private _fogParams;
41
- private _sunlightVector3;
42
41
  /**
43
42
  * Scene-related shader data.
44
43
  */
package/types/Script.d.ts CHANGED
@@ -2,6 +2,7 @@ import { Camera } from "./Camera";
2
2
  import { Component } from "./Component";
3
3
  import { Pointer } from "./input";
4
4
  import { ColliderShape } from "./physics";
5
+ import { Collision } from "./physics/Collision";
5
6
  /**
6
7
  * Script class, used for logic writing.
7
8
  */
@@ -22,12 +23,12 @@ export declare class Script extends Component {
22
23
  onStart(): void;
23
24
  /**
24
25
  * The main loop, called frame by frame.
25
- * @param deltaTime - The deltaTime when the script update.
26
+ * @param deltaTime - The delta time since last frame in seconds
26
27
  */
27
28
  onUpdate(deltaTime: number): void;
28
29
  /**
29
30
  * Called after the onUpdate finished, called frame by frame.
30
- * @param deltaTime - The deltaTime when the script update.
31
+ * @param deltaTime - The delta time since last frame in seconds
31
32
  */
32
33
  onLateUpdate(deltaTime: number): void;
33
34
  /**
@@ -45,37 +46,39 @@ export declare class Script extends Component {
45
46
  */
46
47
  onPhysicsUpdate(): void;
47
48
  /**
48
- * Called when the collision enter.
49
+ * Called when the trigger enter.
49
50
  * @param other - ColliderShape
50
51
  */
51
52
  onTriggerEnter(other: ColliderShape): void;
52
53
  /**
53
- * Called when the collision stay.
54
- * @remarks onTriggerStay is called every frame while the collision stay.
54
+ * Called when the trigger exit.
55
55
  * @param other - ColliderShape
56
56
  */
57
57
  onTriggerExit(other: ColliderShape): void;
58
58
  /**
59
- * Called when the collision exit.
59
+ * Called when the trigger stay.
60
+ * @remarks onTriggerStay is called every frame while the trigger stay.
60
61
  * @param other - ColliderShape
61
62
  */
62
63
  onTriggerStay(other: ColliderShape): void;
63
64
  /**
64
65
  * Called when the collision enter.
65
- * @param other - ColliderShape
66
+ * @param other - The Collision data associated with this collision event
67
+ * @remarks The Collision data will be invalid after this call, you should copy the data if needed.
66
68
  */
67
- onCollisionEnter(other: ColliderShape): void;
69
+ onCollisionEnter(other: Collision): void;
68
70
  /**
69
- * Called when the collision stay.
70
- * @remarks onTriggerStay is called every frame while the collision stay.
71
- * @param other - ColliderShape
71
+ * Called when the collision exit.
72
+ * @param other - The Collision data associated with this collision event
73
+ * @remarks The Collision data will be invalid after this call, you should copy the data if needed.
72
74
  */
73
- onCollisionExit(other: ColliderShape): void;
75
+ onCollisionExit(other: Collision): void;
74
76
  /**
75
- * Called when the collision exit.
76
- * @param other - ColliderShape
77
+ * Called when the collision stay.
78
+ * @param other - The Collision data associated with this collision event
79
+ * @remarks The Collision data will be invalid after this call, you should copy the data if needed.
77
80
  */
78
- onCollisionStay(other: ColliderShape): void;
81
+ onCollisionStay(other: Collision): void;
79
82
  /**
80
83
  * Called when the pointer is down while over the ColliderShape.
81
84
  * @param pointer - The pointer that triggered
@@ -24,6 +24,9 @@ export declare class Transform extends Component {
24
24
  private _lossyWorldScale;
25
25
  private _localMatrix;
26
26
  private _worldMatrix;
27
+ private _worldForward;
28
+ private _worldRight;
29
+ private _worldUp;
27
30
  private _isParentDirty;
28
31
  private _parentTransformCache;
29
32
  private _dirtyFlag;
@@ -135,23 +138,17 @@ export declare class Transform extends Component {
135
138
  */
136
139
  setWorldRotationQuaternion(x: number, y: number, z: number, w: number): void;
137
140
  /**
138
- * Get the forward direction in world space.
139
- * @param forward - Forward vector
140
- * @returns Forward vector
141
+ * The forward direction in world space.
141
142
  */
142
- getWorldForward(forward: Vector3): Vector3;
143
+ get worldForward(): Vector3;
143
144
  /**
144
- * Get the right direction in world space.
145
- * @param right - Right vector
146
- * @returns Right vector
145
+ * The right direction in world space.
147
146
  */
148
- getWorldRight(right: Vector3): Vector3;
147
+ get worldRight(): Vector3;
149
148
  /**
150
- * Get the up direction in world space.
151
- * @param up - Up vector
152
- * @returns Up vector
149
+ * The up direction in world space.
153
150
  */
154
- getWorldUp(up: Vector3): Vector3;
151
+ get worldUp(): Vector3;
155
152
  /**
156
153
  * Translate in the direction and distance of the translation.
157
154
  * @param translation - Direction and distance of translation
@@ -198,6 +195,7 @@ export declare class Transform extends Component {
198
195
  * @returns Change flag
199
196
  */
200
197
  registerWorldChangeFlag(): BoolUpdateFlag;
198
+ protected _onDestroy(): void;
201
199
  /**
202
200
  * Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
203
201
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
package/types/Utils.d.ts CHANGED
@@ -1,3 +1,31 @@
1
1
  export declare class Utils {
2
+ /**
3
+ * Fast remove an element from array.
4
+ * @param array - Array
5
+ * @param item - Element
6
+ */
7
+ static removeFromArray(array: any[], item: any): boolean;
8
+ /**
9
+ * Decodes a given Uint8Array into a string.
10
+ */
11
+ static decodeText(array: Uint8Array): string;
12
+ /**
13
+ * Judge whether the url is absolute url.
14
+ * @param url - The url to be judged.
15
+ * @returns Whether the url is absolute url.
16
+ */
17
+ static isAbsoluteUrl(url: string): boolean;
18
+ /**
19
+ * Get the values of an object.
20
+ */
21
+ static objectValues(obj: any): any[];
22
+ /**
23
+ * Convert a relative URL to an absolute URL based on a given base URL.
24
+ * @param baseUrl - The base url.
25
+ * @param relativeUrl - The relative url.
26
+ * @returns The resolved url.
27
+ */
28
+ static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
2
29
  private static _stringToPath;
30
+ private static _formatRelativePath;
3
31
  }
@@ -1,3 +1,4 @@
1
+ import { EngineObject } from "../base/EngineObject";
1
2
  import { Component } from "../Component";
2
3
  import { Entity } from "../Entity";
3
4
  import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
@@ -7,7 +8,7 @@ import { KeyframeValueType } from "./Keyframe";
7
8
  /**
8
9
  * Stores keyframe based animations.
9
10
  */
10
- export declare class AnimationClip {
11
+ export declare class AnimationClip extends EngineObject {
11
12
  readonly name: string;
12
13
  private _length;
13
14
  private _events;
@@ -13,9 +13,9 @@ export declare class Animator extends Component {
13
13
  speed: number;
14
14
  protected _animatorController: AnimatorController;
15
15
  protected _controllerUpdateFlag: BoolUpdateFlag;
16
+ protected _updateMark: number;
16
17
  private _animatorLayersData;
17
- private _crossOwnerCollection;
18
- private _animationCurveOwners;
18
+ private _curveOwnerPool;
19
19
  private _animationEventHandlerPool;
20
20
  private _tempAnimatorStateInfo;
21
21
  private _controlledRenderers;
@@ -56,12 +56,11 @@ export declare class Animator extends Component {
56
56
  */
57
57
  findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
58
58
  private _getAnimatorStateInfo;
59
- private _saveDefaultValues;
60
59
  private _getAnimatorStateData;
61
60
  private _saveAnimatorStateData;
62
61
  private _saveAnimatorEventHandlers;
63
62
  private _clearCrossData;
64
- private _addCrossCurveData;
63
+ private _addCrossOwner;
65
64
  private _prepareCrossFading;
66
65
  private _prepareStandbyCrossFading;
67
66
  private _prepareFixedPoseCrossFading;
@@ -72,9 +71,12 @@ export declare class Animator extends Component {
72
71
  private _updatePlayingState;
73
72
  private _updateCrossFade;
74
73
  private _updateCrossFadeFromPose;
74
+ private _updateFinishedState;
75
75
  private _updateCrossFadeData;
76
76
  private _preparePlay;
77
77
  private _checkTransition;
78
+ private _checkSubTransition;
79
+ private _checkBackwardsSubTransition;
78
80
  private _crossFadeByTransition;
79
81
  private _fireAnimationEvents;
80
82
  private _fireSubAnimationEvents;
@@ -83,4 +85,5 @@ export declare class Animator extends Component {
83
85
  private _callAnimatorScriptOnUpdate;
84
86
  private _callAnimatorScriptOnExit;
85
87
  private _checkAutoPlay;
88
+ private _checkRevertOwner;
86
89
  }
@@ -0,0 +1,12 @@
1
+ import { AnimatorTransitionBase } from "./AnimatorTransitionBase";
2
+ /**
3
+ * Transitions define when and how the state machine switch from one state to another. AnimatorStateTransition always originate from an Animator State and have timing parameters.
4
+ */
5
+ export declare class AnimatorStateTransition extends AnimatorTransitionBase {
6
+ /** The duration of the transition. This is represented in normalized time. */
7
+ duration: number;
8
+ /** The time at which the destination state will start. This is represented in normalized time. */
9
+ offset: number;
10
+ /** ExitTime represents the exact time at which the transition can take effect. This is represented in normalized time. */
11
+ exitTime: number;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { AnimatorStateMachine } from "./AnimatorStateMachine";
2
+ import { AnimatorState } from "./AnimatorState";
3
+ /**
4
+ * Base class for animator transitions. Transitions define when and how the state machine switches from one state to another.
5
+ */
6
+ export declare class AnimatorTransitionBase {
7
+ /** The destination state of the transition. */
8
+ destinationState?: AnimatorState;
9
+ destinationStateMachine?: AnimatorStateMachine;
10
+ }
@@ -6,7 +6,6 @@ import { AnimationCurve } from "./AnimationCurve";
6
6
  export declare class AnimationFloatArrayCurve extends AnimationCurve<Float32Array> {
7
7
  /**
8
8
  * @inheritdoc
9
- * @override
10
9
  */
11
10
  addKey(key: Keyframe<Float32Array>): void;
12
11
  }
@@ -0,0 +1,8 @@
1
+ import { Rect } from "@galacean/engine-math";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRectCurve extends AnimationCurve<Rect> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ReferResource } from "../../asset/ReferResource";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRefCurve extends AnimationCurve<ReferResource> {
7
+ constructor();
8
+ }
@@ -9,5 +9,7 @@ export declare enum LayerState {
9
9
  /** CrossFading state. */
10
10
  CrossFading = 2,
11
11
  /** FixedCrossFading state. */
12
- FixedCrossFading = 3
12
+ FixedCrossFading = 3,
13
+ /** Finished state. */
14
+ Finished = 4
13
15
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * StateMachine state.
3
+ */
4
+ export declare enum StateMachineState {
5
+ /** Standby state. */
6
+ Standby = 0,
7
+ /** Playing state. */
8
+ Playing = 1,
9
+ /** CrossFading state. */
10
+ CrossFading = 2,
11
+ /** FixedCrossFading state. */
12
+ FixedCrossFading = 3
13
+ }
@@ -1,7 +1,3 @@
1
- import "./internal/animationCurveOwner/assembler/PositionAnimationCurveOwnerAssembler";
2
- import "./internal/animationCurveOwner/assembler/RotationAnimationCurveOwnerAssembler";
3
- import "./internal/animationCurveOwner/assembler/ScaleAnimationCurveOwnerAssembler";
4
- import "./internal/animationCurveOwner/assembler/BlendShapeWeightsAnimationCurveOwnerAssembler";
5
1
  export { AnimationClip } from "./AnimationClip";
6
2
  export { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
7
3
  export * from "./animationCurve";
@@ -0,0 +1,23 @@
1
+ import { AnimatorStateTransition } from "../AnimatorTransition";
2
+ export declare class AnimatorPlayableObject {
3
+ private _transitions;
4
+ /**
5
+ * The transitions that are going out of the object.
6
+ */
7
+ get transitions(): Readonly<AnimatorStateTransition[]>;
8
+ /**
9
+ * Add an outgoing transition to the destination object.
10
+ * @param transition - The transition
11
+ */
12
+ addTransition(transition: AnimatorStateTransition): void;
13
+ /**
14
+ * Remove a transition from the object.
15
+ * @param transition - The transition
16
+ */
17
+ removeTransition(transition: AnimatorStateTransition): void;
18
+ /**
19
+ * Clears all transitions from the object.
20
+ */
21
+ clearTransitions(): void;
22
+ getDuration(): void;
23
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -6,47 +6,47 @@ export declare enum AssetType {
6
6
  * Plain text.
7
7
  * @remarks Will not be cached based on url in ResourceManager.
8
8
  */
9
- Text = "text",
9
+ Text = "Text",
10
10
  /**
11
11
  * JSON.
12
12
  * @remarks Will not be cached based on url in ResourceManager.
13
13
  */
14
- JSON = "json",
14
+ JSON = "JSON",
15
15
  /**
16
16
  * ArrayBuffer.
17
17
  * @remarks Will not be cached based on url in ResourceManager.
18
18
  */
19
- Buffer = "buffer",
19
+ Buffer = "Buffer",
20
20
  /** 2D Texture. */
21
- Texture2D = "texture2d",
21
+ Texture2D = "Texture2D",
22
22
  /** Cube Texture. */
23
- TextureCube = "texture-cube",
23
+ TextureCube = "TextureCube",
24
24
  /** Material. */
25
- Material = "material",
25
+ Material = "Material",
26
26
  /** Mesh. */
27
- Mesh = "mesh",
27
+ Mesh = "Mesh",
28
28
  /** AnimationClip. */
29
29
  AnimationClip = "AnimationClip",
30
30
  /** AnimatorController. */
31
31
  AnimatorController = "AnimatorController",
32
32
  /** Prefab.*/
33
- Prefab = "prefab",
33
+ GLTF = "GLTF",
34
34
  /** Compress Texture. */
35
- KTX = "ktx",
35
+ KTX = "KTX",
36
36
  /** Cube Compress Texture. */
37
- KTXCube = "ktx-cube",
37
+ KTXCube = "KTXCube",
38
38
  /** Sprite. */
39
- Sprite = "sprite",
39
+ Sprite = "Sprite",
40
40
  /** Sprite Atlas. */
41
- SpriteAtlas = "sprite-atlas",
41
+ SpriteAtlas = "SpriteAtlas",
42
42
  /** Ambient light. */
43
- Env = "environment",
43
+ Env = "Environment",
44
44
  /** Scene. */
45
- Scene = "scene",
45
+ Scene = "Scene",
46
46
  /** HDR to cube. */
47
47
  HDR = "HDR",
48
48
  /** Font. */
49
- Font = "font",
49
+ Font = "Font",
50
50
  /** Source Font, include ttf、 otf and woff. */
51
- SourceFont = "source-font"
51
+ SourceFont = "SourceFont"
52
52
  }
@@ -1,15 +1,12 @@
1
+ type PickOnlyOne<T extends {}, Keys extends keyof T = keyof T> = Keys extends unknown ? {
2
+ [K in Keys]: T[Keys];
3
+ } & {
4
+ [K in Exclude<keyof T, Keys>]?: never;
5
+ } : never;
1
6
  /**
2
7
  * Used to describe loading asset.
3
8
  */
4
9
  export type LoadItem = {
5
- /**
6
- * Loading url.
7
- */
8
- url?: string;
9
- /**
10
- * Available when AssetType is TextureCube.
11
- */
12
- urls?: string[];
13
10
  /**
14
11
  * Asset Type.
15
12
  */
@@ -30,4 +27,14 @@ export type LoadItem = {
30
27
  * Additional parameters for specified loader.
31
28
  */
32
29
  params?: Record<string, any>;
33
- };
30
+ } & PickOnlyOne<{
31
+ /**
32
+ * Loading url.
33
+ */
34
+ url: string;
35
+ /**
36
+ * Available when AssetType is TextureCube.
37
+ */
38
+ urls: string[];
39
+ }>;
40
+ export {};
@@ -1,4 +1,4 @@
1
- import { Engine } from "..";
1
+ import { ContentRestorer, Engine, EngineObject } from "..";
2
2
  import { AssetPromise } from "./AssetPromise";
3
3
  import { Loader } from "./Loader";
4
4
  import { LoadItem } from "./LoadItem";
@@ -17,14 +17,17 @@ export declare class ResourceManager {
17
17
  retryInterval: number;
18
18
  /** The default timeout period for loading assets, in milliseconds. */
19
19
  timeout: number;
20
- /** Asset path pool, key is asset ID, value is asset path */
20
+ private _loadingPromises;
21
+ /** Asset path pool, key is the `instanceID` of resource, value is asset path. */
21
22
  private _assetPool;
22
- /** Asset pool, the key is the asset path and the value is the asset. */
23
+ /** Asset url pool, key is the asset path and the value is the asset. */
23
24
  private _assetUrlPool;
24
- /** Reference counted object pool, key is the object ID, and reference counted objects are put into this pool. */
25
- private _refObjectPool;
26
- /** Loading promises. */
27
- private _loadingPromises;
25
+ /** Referable resource pool, key is the `instanceID` of resource. */
26
+ private _referResourcePool;
27
+ /** Graphic resource pool, key is the `instanceID` of resource. */
28
+ private _graphicResourcePool;
29
+ /** Restorable resource information pool, key is the `instanceID` of resource. */
30
+ private _contentRestorerPool;
28
31
  /**
29
32
  * Create a ResourceManager.
30
33
  * @param engine - Engine to which the current ResourceManager belongs
@@ -85,6 +88,11 @@ export declare class ResourceManager {
85
88
  * @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
86
89
  */
87
90
  gc(): void;
91
+ /**
92
+ * Add content restorer.
93
+ * @param restorer - The restorer
94
+ */
95
+ addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
88
96
  private _assignDefaultOptions;
89
97
  private _loadSingleItem;
90
98
  private _gc;
@@ -96,6 +104,6 @@ export declare class ResourceManager {
96
104
  /**
97
105
  * Declare ResourceLoader's decorator.
98
106
  * @param assetType - Type of asset
99
- * @param extnames - Name of file extension
107
+ * @param extNames - Name of file extension
100
108
  */
101
- export declare function resourceLoader(assetType: string, extnames: string[], useCache?: boolean): <T extends Loader<any>>(Target: new (useCache: boolean) => T) => void;
109
+ export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target: new (useCache: boolean) => T) => void;
@@ -17,9 +17,13 @@ export declare class MultiExecutor {
17
17
  private interval;
18
18
  private _timeoutId;
19
19
  private _currentCount;
20
+ private _onComplete;
21
+ private _onError;
22
+ private _error;
20
23
  constructor(execFunc: (count?: number) => Promise<any>, totalCount: number, interval: number);
21
- private done;
22
- start(done?: Function): void;
23
- stop(): void;
24
+ start(): this;
25
+ onComplete(func: Function): this;
26
+ onError(func: Function): this;
27
+ cancel(): void;
24
28
  private exec;
25
29
  }
@@ -105,6 +105,7 @@ export declare enum GLCapabilityType {
105
105
  pvrtc = "WEBGL_compressed_texture_pvrtc",
106
106
  pvrtc_webkit = "WEBKIT_WEBGL_compressed_texture_pvrtc",
107
107
  s3tc = "WEBGL_compressed_texture_s3tc",
108
- s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc"
108
+ s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc",
109
+ WEBGL_lose_context = "WEBGL_lose_context"
109
110
  }
110
111
  export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
@@ -21,4 +21,5 @@ export declare abstract class EngineObject {
21
21
  * Destroy self.
22
22
  */
23
23
  destroy(): void;
24
+ protected _onDestroy(): void;
24
25
  }