@galacean/engine-core 0.0.0-experimental-1.3-xr.9 → 0.0.0-experimental-1.4-small-language.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.
Files changed (140) hide show
  1. package/dist/main.js +18058 -16130
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +16443 -14637
  4. package/dist/module.js.map +1 -1
  5. package/package.json +6 -3
  6. package/types/2d/assembler/ISpriteAssembler.d.ts +11 -1
  7. package/types/2d/assembler/ISpriteRenderer.d.ts +16 -0
  8. package/types/2d/assembler/SimpleSpriteAssembler.d.ts +13 -1
  9. package/types/2d/assembler/SlicedSpriteAssembler.d.ts +15 -1
  10. package/types/2d/assembler/TiledSpriteAssembler.d.ts +17 -1
  11. package/types/2d/enums/SpriteModifyFlags.d.ts +9 -0
  12. package/types/2d/index.d.ts +12 -5
  13. package/types/2d/sprite/Sprite.d.ts +2 -2
  14. package/types/2d/sprite/SpriteMask.d.ts +4 -2
  15. package/types/2d/sprite/SpriteRenderer.d.ts +5 -4
  16. package/types/2d/sprite/index.d.ts +1 -1
  17. package/types/2d/text/ITextRenderer.d.ts +8 -0
  18. package/types/2d/text/TextRenderer.d.ts +26 -5
  19. package/types/2d/text/index.d.ts +3 -1
  20. package/types/BasicResources.d.ts +2 -1
  21. package/types/Camera.d.ts +7 -3
  22. package/types/ComponentsManager.d.ts +4 -0
  23. package/types/Engine.d.ts +12 -3
  24. package/types/Entity.d.ts +22 -6
  25. package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -0
  26. package/types/RenderPipeline/Blitter.d.ts +28 -0
  27. package/types/RenderPipeline/index.d.ts +3 -1
  28. package/types/Renderer.d.ts +19 -2
  29. package/types/Scene.d.ts +4 -1
  30. package/types/Script.d.ts +42 -18
  31. package/types/Transform.d.ts +17 -7
  32. package/types/animation/Animator.d.ts +42 -7
  33. package/types/animation/AnimatorCondition.d.ts +2 -2
  34. package/types/animation/AnimatorController.d.ts +26 -16
  35. package/types/animation/AnimatorControllerParameter.d.ts +9 -5
  36. package/types/animation/AnimatorState.d.ts +0 -1
  37. package/types/animation/AnimatorStateMachine.d.ts +10 -6
  38. package/types/animation/AnimatorStateTransition.d.ts +13 -5
  39. package/types/animation/index.d.ts +3 -0
  40. package/types/asset/AssetPromise.d.ts +30 -5
  41. package/types/asset/AssetType.d.ts +8 -2
  42. package/types/asset/Loader.d.ts +0 -2
  43. package/types/asset/ResourceManager.d.ts +7 -2
  44. package/types/asset/request.d.ts +10 -3
  45. package/types/audio/AudioClip.d.ts +24 -0
  46. package/types/audio/AudioSource.d.ts +72 -0
  47. package/types/audio/index.d.ts +3 -0
  48. package/types/base/Constant.d.ts +22 -22
  49. package/types/enums/CameraModifyFlags.d.ts +17 -0
  50. package/types/enums/EntityModifyFlags.d.ts +9 -0
  51. package/types/{2d/enums → enums}/SpriteMaskLayer.d.ts +3 -1
  52. package/types/index.d.ts +7 -1
  53. package/types/input/index.d.ts +5 -2
  54. package/types/input/pointer/Pointer.d.ts +8 -2
  55. package/types/input/pointer/PointerEventData.d.ts +12 -0
  56. package/types/input/pointer/PointerManager.d.ts +9 -1
  57. package/types/input/pointer/emitter/PointerEventEmitter.d.ts +30 -0
  58. package/types/lighting/DirectLight.d.ts +5 -0
  59. package/types/lighting/Light.d.ts +8 -3
  60. package/types/material/BaseMaterial.d.ts +4 -2
  61. package/types/material/Material.d.ts +1 -0
  62. package/types/material/PBRMaterial.d.ts +130 -0
  63. package/types/material/enums/Refraction.d.ts +9 -0
  64. package/types/material/index.d.ts +1 -0
  65. package/types/material/utils/PrefilteredDFG.d.ts +7 -0
  66. package/types/mesh/SkinnedMeshRenderer.d.ts +1 -1
  67. package/types/particle/ParticleGenerator.d.ts +1 -0
  68. package/types/particle/ParticleRenderer.d.ts +1 -1
  69. package/types/particle/modules/MainModule.d.ts +1 -2
  70. package/types/particle/modules/TextureSheetAnimationModule.d.ts +3 -5
  71. package/types/physics/CharacterController.d.ts +6 -6
  72. package/types/physics/Collider.d.ts +3 -1
  73. package/types/physics/Collision.d.ts +18 -0
  74. package/types/physics/ContactPoint.d.ts +14 -0
  75. package/types/physics/DynamicCollider.d.ts +35 -4
  76. package/types/physics/HitResult.d.ts +1 -1
  77. package/types/physics/PhysicsMaterial.d.ts +5 -1
  78. package/types/physics/index.d.ts +2 -0
  79. package/types/physics/joint/FixedJoint.d.ts +1 -0
  80. package/types/physics/joint/HingeJoint.d.ts +11 -7
  81. package/types/physics/joint/Joint.d.ts +32 -10
  82. package/types/physics/joint/JointLimits.d.ts +34 -10
  83. package/types/physics/joint/JointMotor.d.ts +27 -8
  84. package/types/physics/joint/SpringJoint.d.ts +2 -6
  85. package/types/physics/shape/BoxColliderShape.d.ts +1 -0
  86. package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
  87. package/types/physics/shape/ColliderShape.d.ts +11 -3
  88. package/types/physics/shape/PlaneColliderShape.d.ts +2 -0
  89. package/types/physics/shape/SphereColliderShape.d.ts +1 -1
  90. package/types/postProcess/PostProcess.d.ts +64 -0
  91. package/types/postProcess/PostProcessEffect.d.ts +26 -0
  92. package/types/postProcess/PostProcessEffectParameter.d.ts +119 -0
  93. package/types/postProcess/PostProcessManager.d.ts +37 -1
  94. package/types/postProcess/PostProcessPass.d.ts +50 -0
  95. package/types/postProcess/PostProcessUberPass.d.ts +25 -0
  96. package/types/postProcess/effects/BloomEffect.d.ts +22 -66
  97. package/types/postProcess/effects/TonemappingEffect.d.ts +6 -16
  98. package/types/postProcess/index.d.ts +6 -2
  99. package/types/shader/Shader.d.ts +1 -1
  100. package/types/shader/index.d.ts +1 -0
  101. package/types/shaderlib/ShaderLib.d.ts +2 -0
  102. package/types/shaderlib/pbr/index.d.ts +2 -0
  103. package/types/ui/UIUtils.d.ts +11 -0
  104. package/types/utils/DisorderedArray.d.ts +70 -0
  105. package/dist/miniprogram.js +0 -34351
  106. package/types/DisorderedArray.d.ts +0 -27
  107. package/types/RenderPipeline/Basic2DBatcher.d.ts +0 -19
  108. package/types/RenderPipeline/ClassPool.d.ts +0 -19
  109. package/types/RenderPipeline/IPoolElement.d.ts +0 -3
  110. package/types/RenderPipeline/RenderData.d.ts +0 -14
  111. package/types/RenderPipeline/RenderData2D.d.ts +0 -14
  112. package/types/RenderPipeline/RenderPass.d.ts +0 -55
  113. package/types/RenderPipeline/SpriteMaskBatcher.d.ts +0 -11
  114. package/types/RenderPipeline/SpriteMaskManager.d.ts +0 -1
  115. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +0 -12
  116. package/types/RenderPipeline/SpriteRenderData.d.ts +0 -14
  117. package/types/RenderPipeline/TextRenderData.d.ts +0 -8
  118. package/types/RenderPipeline/enums/ForceUploadShaderDataFlag.d.ts +0 -15
  119. package/types/RenderPipeline/enums/RenderDataUsage.d.ts +0 -13
  120. package/types/animation/AnimatorTransition.d.ts +0 -14
  121. package/types/input/pointer/PointerEvent.d.ts +0 -4
  122. package/types/input/pointer/PointerEventType.d.ts +0 -7
  123. package/types/renderingHardwareInterface/IHardwareRenderer.d.ts +0 -6
  124. package/types/ui/Image.d.ts +0 -38
  125. package/types/ui/RedBlackTree.d.ts +0 -2
  126. package/types/ui/UICanvas.d.ts +0 -55
  127. package/types/ui/UIRenderer.d.ts +0 -14
  128. package/types/ui/UITransform.d.ts +0 -20
  129. package/types/ui/enums/BlockingObjects.d.ts +0 -6
  130. package/types/ui/enums/CanvasRenderMode.d.ts +0 -8
  131. package/types/ui/enums/ResolutionAdaptationStrategy.d.ts +0 -10
  132. package/types/ui/index.d.ts +0 -6
  133. package/types/utils/Pool.d.ts +0 -12
  134. /package/types/{2d/assembler/IAssembler.d.ts → Polyfill.d.ts} +0 -0
  135. /package/types/{2d/data/VertexData2D.d.ts → RenderPipeline/enums/RenderQueueMaskType.d.ts} +0 -0
  136. /package/types/{2d/text/CharRenderData.d.ts → animation/AnimatorStateTransitionCollection.d.ts} +0 -0
  137. /package/types/{2d/text/CharRenderDataPool.d.ts → audio/AudioManager.d.ts} +0 -0
  138. /package/types/{RenderPipeline/DynamicGeometryData.d.ts → input/pointer/emitter/IHitResult.d.ts} +0 -0
  139. /package/types/{RenderPipeline/DynamicGeometryDataManager.d.ts → input/pointer/emitter/PhysicsPointerEventEmitter.d.ts} +0 -0
  140. /package/types/{RenderPipeline/SpriteBatcher.d.ts → ui/IUICanvas.d.ts} +0 -0
package/types/Scene.d.ts CHANGED
@@ -7,6 +7,7 @@ import { FogMode } from "./enums/FogMode";
7
7
  import { DirectLight } from "./lighting";
8
8
  import { AmbientLight } from "./lighting/AmbientLight";
9
9
  import { PhysicsScene } from "./physics/PhysicsScene";
10
+ import { PostProcessManager } from "./postProcess";
10
11
  import { ShaderData } from "./shader/ShaderData";
11
12
  import { ShadowCascadesMode } from "./shadow/enum/ShadowCascadesMode";
12
13
  import { ShadowResolution } from "./shadow/enum/ShadowResolution";
@@ -16,6 +17,7 @@ import { ShadowResolution } from "./shadow/enum/ShadowResolution";
16
17
  export declare class Scene extends EngineObject {
17
18
  private static _fogColorProperty;
18
19
  private static _fogParamsProperty;
20
+ private static _prefilterdDFGProperty;
19
21
  /** Scene name. */
20
22
  name: string;
21
23
  /** Physics. */
@@ -35,6 +37,8 @@ export declare class Scene extends EngineObject {
35
37
  * @remarks Value 0 is used for no shadow fade.
36
38
  */
37
39
  shadowFadeBorder: number;
40
+ /** Post process manager. */
41
+ readonly postProcessManager: PostProcessManager;
38
42
  private _background;
39
43
  private _shaderData;
40
44
  private _shadowCascades;
@@ -166,7 +170,6 @@ export declare class Scene extends EngineObject {
166
170
  * @returns Entity
167
171
  */
168
172
  findEntityByPath(path: string): Entity | null;
169
- private _addToRootEntityList;
170
173
  private _computeLinearFogParams;
171
174
  private _computeExponentialFogParams;
172
175
  private _getSunlight;
package/types/Script.d.ts CHANGED
@@ -1,13 +1,12 @@
1
1
  import { Camera } from "./Camera";
2
2
  import { Component } from "./Component";
3
- import { Pointer } from "./input";
3
+ import { PointerEventData } from "./input/pointer/PointerEventData";
4
4
  import { ColliderShape } from "./physics";
5
5
  import { Collision } from "./physics/Collision";
6
6
  /**
7
7
  * Script class, used for logic writing.
8
8
  */
9
9
  export declare class Script extends Component {
10
- _entityScriptsIndex: number;
11
10
  /**
12
11
  * Called when be enabled first time, only once.
13
12
  */
@@ -80,35 +79,49 @@ export declare class Script extends Component {
80
79
  onCollisionStay(other: Collision): void;
81
80
  /**
82
81
  * Called when the pointer is down while over the ColliderShape.
83
- * @param pointer - The pointer that triggered
82
+ * @param eventData - The pointer event data that triggered this callback
84
83
  */
85
- onPointerDown(pointer: Pointer): void;
84
+ onPointerDown(eventData: PointerEventData): void;
86
85
  /**
87
86
  * Called when the pointer is up while over the ColliderShape.
88
- * @param pointer - The pointer that triggered
87
+ * @param eventData - The pointer event data that triggered this callback
89
88
  */
90
- onPointerUp(pointer: Pointer): void;
89
+ onPointerUp(eventData: PointerEventData): void;
91
90
  /**
92
91
  * Called when the pointer is down and up with the same collider.
93
- * @param pointer - The pointer that triggered
92
+ * @param eventData - The pointer event data that triggered this callback
94
93
  */
95
- onPointerClick(pointer: Pointer): void;
94
+ onPointerClick(eventData: PointerEventData): void;
96
95
  /**
97
- * Called when the pointer is enters the ColliderShape.
98
- * @param pointer - The pointer that triggered
96
+ * Called when the pointer enters the ColliderShape.
97
+ * @param eventData - The pointer event data that triggered this callback
99
98
  */
100
- onPointerEnter(pointer: Pointer): void;
99
+ onPointerEnter(eventData: PointerEventData): void;
101
100
  /**
102
- * Called when the pointer is no longer over the ColliderShape.
103
- * @param pointer - The pointer that triggered
101
+ * Called when the pointer exits the ColliderShape.
102
+ * @param eventData - The pointer event data that triggered this callback
104
103
  */
105
- onPointerExit(pointer: Pointer): void;
104
+ onPointerExit(eventData: PointerEventData): void;
106
105
  /**
107
- * Called when the pointer is down while over the ColliderShape and is still holding down.
108
- * @param pointer - The pointer that triggered
109
- * @remarks onPointerDrag is called every frame while the pointer is down.
106
+ * This function will be called when the pointer is pressed on the collider.
107
+ * @param eventData - The pointer event data that triggered this callback
110
108
  */
111
- onPointerDrag(pointer: Pointer): void;
109
+ onPointerBeginDrag(eventData: PointerEventData): void;
110
+ /**
111
+ * When a drag collision occurs on the pointer, this function will be called every time it moves.
112
+ * @param eventData - The pointer event data that triggered this callback
113
+ */
114
+ onPointerDrag(eventData: PointerEventData): void;
115
+ /**
116
+ * When dragging ends, this function will be called (Dragged object).
117
+ * @param eventData - The pointer event data that triggered this callback
118
+ */
119
+ onPointerEndDrag(eventData: PointerEventData): void;
120
+ /**
121
+ * When dragging ends, this function will be called (Receiving object).
122
+ * @param eventData - The pointer event data that triggered this callback
123
+ */
124
+ onPointerDrop(eventData: PointerEventData): void;
112
125
  /**
113
126
  * Called when be disabled.
114
127
  */
@@ -118,3 +131,14 @@ export declare class Script extends Component {
118
131
  */
119
132
  onDestroy(): void;
120
133
  }
134
+ export declare enum PointerMethods {
135
+ onPointerDown = "onPointerDown",
136
+ onPointerUp = "onPointerUp",
137
+ onPointerClick = "onPointerClick",
138
+ onPointerEnter = "onPointerEnter",
139
+ onPointerExit = "onPointerExit",
140
+ onPointerBeginDrag = "onPointerBeginDrag",
141
+ onPointerDrag = "onPointerDrag",
142
+ onPointerEndDrag = "onPointerEndDrag",
143
+ onPointerDrop = "onPointerDrop"
144
+ }
@@ -18,9 +18,11 @@ export declare class Transform extends Component {
18
18
  private _rotation;
19
19
  private _rotationQuaternion;
20
20
  private _scale;
21
+ private _localUniformScaling;
21
22
  private _worldPosition;
22
23
  private _worldRotation;
23
24
  private _worldRotationQuaternion;
25
+ private _worldUniformScaling;
24
26
  private _lossyWorldScale;
25
27
  private _localMatrix;
26
28
  private _worldMatrix;
@@ -69,8 +71,8 @@ export declare class Transform extends Component {
69
71
  set scale(value: Vector3);
70
72
  /**
71
73
  * Local lossy scaling.
72
- * @remarks The value obtained may not be correct under certain conditions(for example, the parent node has scaling,
73
- * and the child node has a rotation), the scaling will be tilted. Vector3 cannot be used to correctly represent the scaling. Must use Matrix3x3.
74
+ * @remarks The value obtained may not be correct under certain conditions(for example, the parent node has non-uniform world scaling,
75
+ * and the child node has a rotation), the scaling will be tilted.
74
76
  */
75
77
  get lossyWorldScale(): Vector3;
76
78
  /**
@@ -190,11 +192,6 @@ export declare class Transform extends Component {
190
192
  * @param worldUp - Up direction in world space, default is Vector3(0, 1, 0)
191
193
  */
192
194
  lookAt(targetPosition: Vector3, worldUp?: Vector3): void;
193
- /**
194
- * Register world transform change flag.
195
- * @returns Change flag
196
- */
197
- registerWorldChangeFlag(): BoolUpdateFlag;
198
195
  protected _onDestroy(): void;
199
196
  /**
200
197
  * Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
@@ -207,6 +204,7 @@ export declare class Transform extends Component {
207
204
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
208
205
  * Get worldRotationQuaternion: Will trigger the world rotation (in quaternion) update of itself and all parent entities.
209
206
  * Get worldRotation: Will trigger the world rotation(in euler and quaternion) update of itself and world rotation(in quaternion) update of all parent entities.
207
+ * Get worldScale: Will trigger the scaling update of itself and all parent entities.
210
208
  * In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.
211
209
  */
212
210
  private _updateWorldRotationFlag;
@@ -215,7 +213,9 @@ export declare class Transform extends Component {
215
213
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
216
214
  * Get worldRotationQuaternion: Will trigger the world rotation (in quaternion) update of itself and all parent entities.
217
215
  * Get worldRotation: Will trigger the world rotation(in euler and quaternion) update of itself and world rotation(in quaternion) update of all parent entities.
216
+ * Get worldScale: Will trigger the scaling update of itself and all parent entities.
218
217
  * In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix or worldRotationQuaternion) to be false.
218
+ * @param flags - Dirty flag
219
219
  */
220
220
  private _updateWorldPositionAndRotationFlag;
221
221
  /**
@@ -223,6 +223,7 @@ export declare class Transform extends Component {
223
223
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
224
224
  * Get worldScale: Will trigger the scaling update of itself and all parent entities.
225
225
  * In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix) to be false.
226
+ * @param flags - Dirty flag
226
227
  */
227
228
  private _updateWorldScaleFlag;
228
229
  /**
@@ -230,10 +231,12 @@ export declare class Transform extends Component {
230
231
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
231
232
  * Get worldScale: Will trigger the scaling update of itself and all parent entities.
232
233
  * In summary, any update of related variables will cause the dirty mark of one of the full process (worldMatrix) to be false.
234
+ * @param flags - Dirty flag
233
235
  */
234
236
  private _updateWorldPositionAndScaleFlag;
235
237
  /**
236
238
  * Update all world transform property dirty flag, the principle is the same as above.
239
+ * @param flags - Dirty flag
237
240
  */
238
241
  private _updateAllWorldFlag;
239
242
  private _getParentTransform;
@@ -253,4 +256,11 @@ export declare class Transform extends Component {
253
256
  private _onRotationQuaternionChanged;
254
257
  private _onWorldRotationQuaternionChanged;
255
258
  private _onScaleChanged;
259
+ private _getWorldUniformScaling;
260
+ /**
261
+ * @deprecated
262
+ * Listen for changes in the world pose of this `Entity`.
263
+ * @returns Change flag
264
+ */
265
+ registerWorldChangeFlag(): BoolUpdateFlag;
256
266
  }
@@ -2,13 +2,14 @@ import { BoolUpdateFlag } from "../BoolUpdateFlag";
2
2
  import { Component } from "../Component";
3
3
  import { AnimatorController } from "./AnimatorController";
4
4
  import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
5
- import { AnimatorControllerParameter } from "./AnimatorControllerParameter";
5
+ import { AnimatorControllerParameter, AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
6
6
  import { AnimatorState } from "./AnimatorState";
7
7
  import { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
8
8
  /**
9
9
  * The controller of the animation system.
10
10
  */
11
11
  export declare class Animator extends Component {
12
+ private static _passedTriggerParameterNames;
12
13
  /** Culling mode of this Animator. */
13
14
  cullingMode: AnimatorCullingMode;
14
15
  /** The playback speed of the Animator, 1.0 is normal playback speed. */
@@ -19,6 +20,7 @@ export declare class Animator extends Component {
19
20
  private _animatorLayersData;
20
21
  private _curveOwnerPool;
21
22
  private _animationEventHandlerPool;
23
+ private _parametersValueMap;
22
24
  private _tempAnimatorStateInfo;
23
25
  private _controlledRenderers;
24
26
  /**
@@ -38,17 +40,25 @@ export declare class Animator extends Component {
38
40
  * Play a state by name.
39
41
  * @param stateName - The state name
40
42
  * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
41
- * @param normalizedTimeOffset - The time offset between 0 and 1(default 0)
43
+ * @param normalizedTimeOffset - The normalized time offset (between 0 and 1, default 0) to start the state's animation from
42
44
  */
43
45
  play(stateName: string, layerIndex?: number, normalizedTimeOffset?: number): void;
44
46
  /**
45
- * Create a cross fade from the current state to another state.
47
+ * Create a cross fade from the current state to another state with a normalized duration.
46
48
  * @param stateName - The state name
47
- * @param normalizedTransitionDuration - The duration of the transition (normalized)
49
+ * @param normalizedDuration - The normalized duration of the transition, relative to the destination state's duration (range: 0 to 1)
48
50
  * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
49
- * @param normalizedTimeOffset - The time offset between 0 and 1(default 0)
51
+ * @param normalizedTimeOffset - The normalized time offset (between 0 and 1, default 0) to start the destination state's animation from
50
52
  */
51
- crossFade(stateName: string, normalizedTransitionDuration: number, layerIndex?: number, normalizedTimeOffset?: number): void;
53
+ crossFade(stateName: string, normalizedDuration: number, layerIndex?: number, normalizedTimeOffset?: number): void;
54
+ /**
55
+ * Create a cross fade from the current state to another state with a fixed duration.
56
+ * @param stateName - The state name
57
+ * @param fixedDuration - The duration of the transition in seconds
58
+ * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
59
+ * @param normalizedTimeOffset - The normalized time offset (between 0 and 1, default 0) to start the destination state's animation from
60
+ */
61
+ crossFadeInFixedDuration(stateName: string, fixedDuration: number, layerIndex?: number, normalizedTimeOffset?: number): void;
52
62
  /**
53
63
  * Evaluates the animator component based on deltaTime.
54
64
  * @param deltaTime - The deltaTime when the animation update
@@ -75,6 +85,29 @@ export declare class Animator extends Component {
75
85
  * @param name - The name of the parameter
76
86
  */
77
87
  getParameter(name: string): AnimatorControllerParameter;
88
+ /**
89
+ * Get the value of the given parameter.
90
+ * @param name - The name of the parameter
91
+ * @param value - The value of the parameter
92
+ */
93
+ getParameterValue(name: string): AnimatorControllerParameterValue;
94
+ /**
95
+ * Set the value of the given parameter.
96
+ * @param name - The name of the parameter
97
+ * @param value - The value of the parameter
98
+ */
99
+ setParameterValue(name: string, value: AnimatorControllerParameterValue): void;
100
+ /**
101
+ * Activate the trigger parameter by name.
102
+ * @param name - The name of the trigger parameter
103
+ */
104
+ activateTriggerParameter(name: string): void;
105
+ /**
106
+ * Reset the trigger parameter to deactivate it by name.
107
+ * @param name - The name of the trigger parameter
108
+ */
109
+ deactivateTriggerParameter(name: string): void;
110
+ private _crossFade;
78
111
  private _getAnimatorStateInfo;
79
112
  private _getAnimatorStateData;
80
113
  private _saveAnimatorStateData;
@@ -87,7 +120,6 @@ export declare class Animator extends Component {
87
120
  private _prepareSrcCrossData;
88
121
  private _prepareDestCrossData;
89
122
  private _getAnimatorLayerData;
90
- private _updateLayer;
91
123
  private _updateState;
92
124
  private _updatePlayingState;
93
125
  private _evaluatePlayingState;
@@ -100,6 +132,7 @@ export declare class Animator extends Component {
100
132
  private _updateCrossFadeData;
101
133
  private _preparePlayOwner;
102
134
  private _applyStateTransitions;
135
+ private _checkNoExitTimeTransition;
103
136
  private _checkSubTransition;
104
137
  private _checkBackwardsSubTransition;
105
138
  private _applyTransitionsByCondition;
@@ -115,4 +148,6 @@ export declare class Animator extends Component {
115
148
  private _callAnimatorScriptOnExit;
116
149
  private _checkAnyAndEntryState;
117
150
  private _checkRevertOwner;
151
+ private _fireAnimationEventsAndCallScripts;
152
+ private _deactivateTriggeredParameters;
118
153
  }
@@ -1,4 +1,4 @@
1
- import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
1
+ import { AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
2
2
  import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
3
3
  /**
4
4
  * Condition that is used to determine if a transition must be taken.
@@ -9,5 +9,5 @@ export declare class AnimatorCondition {
9
9
  /** The name of the parameter used in the condition. */
10
10
  parameterName: string;
11
11
  /** The AnimatorParameter's threshold value for the condition to be true. */
12
- threshold?: AnimatorControllerParameterValueType;
12
+ threshold?: AnimatorControllerParameterValue;
13
13
  }
@@ -1,9 +1,11 @@
1
- import { AnimatorControllerParameter, AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
1
+ import { AnimatorControllerParameter, AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
2
2
  import { AnimatorControllerLayer } from "./AnimatorControllerLayer";
3
+ import { ReferResource } from "../asset/ReferResource";
4
+ import { Engine } from "../Engine";
3
5
  /**
4
6
  * Store the data for Animator playback.
5
7
  */
6
- export declare class AnimatorController {
8
+ export declare class AnimatorController extends ReferResource {
7
9
  private _updateFlagManager;
8
10
  /**
9
11
  * The layers in the controller.
@@ -14,32 +16,39 @@ export declare class AnimatorController {
14
16
  */
15
17
  get parameters(): Readonly<AnimatorControllerParameter[]>;
16
18
  /**
17
- * Add a parameter to the controller.
18
- * @param name - The name of the parameter
19
- * @param value - The value of the parameter
19
+ * Create an AnimatorController.
20
+ * @param engine - Engine to which the animatorController belongs
21
+ */
22
+ constructor(engine: Engine);
23
+ /**
24
+ * @deprecated
20
25
  */
21
- addParameter(name: string, value?: AnimatorControllerParameterValueType): AnimatorControllerParameter;
26
+ constructor();
22
27
  /**
23
28
  * Add a parameter to the controller.
24
- * @param parameter - The parameter
29
+ * @param name - The name of the parameter
30
+ * @param defaultValue - The default value of the parameter
25
31
  */
26
- addParameter(parameter: AnimatorControllerParameter): AnimatorControllerParameter;
32
+ addParameter(name: string, defaultValue?: AnimatorControllerParameterValue): AnimatorControllerParameter;
27
33
  /**
28
- * Remove a parameter from the controller.
29
- * @param parameter - The parameter
34
+ * Add a trigger parameter to the controller.
35
+ * @param name - The name of the parameter
30
36
  */
31
- removeParameter(parameter: AnimatorControllerParameter): void;
37
+ addTriggerParameter(name: string): AnimatorControllerParameter;
32
38
  /**
33
- * Get the parameter by name.
39
+ * Remove a parameter from the controller by name, including trigger parameters.
34
40
  * @param name - The name of the parameter
35
41
  */
36
- getParameter(name: string): AnimatorControllerParameter;
42
+ removeParameter(name: string): void;
43
+ /**
44
+ * Clear all parameters, including trigger parameters.
45
+ */
46
+ clearParameters(): void;
37
47
  /**
38
- * Set the value of the given parameter.
48
+ * Get the parameter by name.
39
49
  * @param name - The name of the parameter
40
- * @param value - The value of the parameter
41
50
  */
42
- setParameterValue(name: string, value: AnimatorControllerParameterValueType): void;
51
+ getParameter(name: string): AnimatorControllerParameter;
43
52
  /**
44
53
  * Get the layer by name.
45
54
  * @param name - The layer's name.
@@ -59,4 +68,5 @@ export declare class AnimatorController {
59
68
  * Clear layers.
60
69
  */
61
70
  clearLayers(): void;
71
+ private _addParameter;
62
72
  }
@@ -1,10 +1,14 @@
1
- export type AnimatorControllerParameterValueType = number | string | boolean;
1
+ export type AnimatorControllerParameterValue = number | string | boolean;
2
2
  /**
3
3
  * Used to communicate between scripting and the controller, parameters can be set in scripting and used by the controller.
4
4
  */
5
5
  export declare class AnimatorControllerParameter {
6
- /** The name of the parameter. */
7
- name: string;
8
- /** The value of the parameter. */
9
- value: AnimatorControllerParameterValueType;
6
+ /** The default value of the parameter. */
7
+ defaultValue: AnimatorControllerParameterValue;
8
+ private _name;
9
+ /**
10
+ * The name of the parameter.
11
+ */
12
+ get name(): string;
13
+ set name(name: string);
10
14
  }
@@ -14,7 +14,6 @@ export declare class AnimatorState {
14
14
  private _clipStartTime;
15
15
  private _clipEndTime;
16
16
  private _clip;
17
- private _transitions;
18
17
  /**
19
18
  * The transitions that are going out of the state.
20
19
  */
@@ -14,8 +14,6 @@ export declare class AnimatorStateMachine {
14
14
  * @remarks When the Animator's AnimatorController changed or the Animator's onEnable be triggered.
15
15
  */
16
16
  defaultState: AnimatorState;
17
- private _entryTransitions;
18
- private _anyStateTransitions;
19
17
  private _statesMap;
20
18
  /**
21
19
  * The list of entry transitions in the state machine.
@@ -52,7 +50,7 @@ export declare class AnimatorStateMachine {
52
50
  */
53
51
  addEntryStateTransition(transition: AnimatorStateTransition): AnimatorStateTransition;
54
52
  /**
55
- * Add an entry transition to the destination state.
53
+ * Add an entry transition to the destination state, the default value of entry transition's hasExitTime is false.
56
54
  * @param animatorState - The destination state
57
55
  */
58
56
  addEntryStateTransition(animatorState: AnimatorState): AnimatorStateTransition;
@@ -67,7 +65,7 @@ export declare class AnimatorStateMachine {
67
65
  */
68
66
  addAnyStateTransition(transition: AnimatorStateTransition): AnimatorStateTransition;
69
67
  /**
70
- * Add an any transition to the destination state.
68
+ * Add an any transition to the destination state, the default value of any transition's hasExitTime is false.
71
69
  * @param animatorState - The destination state
72
70
  */
73
71
  addAnyStateTransition(animatorState: AnimatorState): AnimatorStateTransition;
@@ -76,6 +74,12 @@ export declare class AnimatorStateMachine {
76
74
  * @param transition - The transition
77
75
  */
78
76
  removeAnyStateTransition(transition: AnimatorStateTransition): void;
79
- private _addTransition;
80
- private _removeTransition;
77
+ /**
78
+ * Clear all entry state transitions.
79
+ */
80
+ clearEntryStateTransitions(): void;
81
+ /**
82
+ * Clear all any state transitions.
83
+ */
84
+ clearAnyStateTransitions(): void;
81
85
  }
@@ -1,12 +1,12 @@
1
- import { AnimatorControllerParameterValueType } from "./AnimatorControllerParameter";
2
- import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
3
1
  import { AnimatorCondition } from "./AnimatorCondition";
2
+ import { AnimatorControllerParameterValue } from "./AnimatorControllerParameter";
4
3
  import { AnimatorState } from "./AnimatorState";
4
+ import { AnimatorConditionMode } from "./enums/AnimatorConditionMode";
5
5
  /**
6
6
  * Transitions define when and how the state machine switch from on state to another. AnimatorTransition always originate from a StateMachine or a StateMachine entry.
7
7
  */
8
8
  export declare class AnimatorStateTransition {
9
- /** The duration of the transition. This is represented in normalized time. */
9
+ /** The duration of the transition. The duration is in normalized time by default. To set it to be in seconds, set isFixedDuration to true. */
10
10
  duration: number;
11
11
  /** The time at which the destination state will start. This is represented in normalized time. */
12
12
  offset: number;
@@ -16,8 +16,11 @@ export declare class AnimatorStateTransition {
16
16
  destinationState: AnimatorState;
17
17
  /** Mutes the transition. The transition will never occur. */
18
18
  mute: boolean;
19
+ /** Determines whether the duration of the transition is reported in a fixed duration in seconds or as a normalized time. */
20
+ isFixedDuration: boolean;
19
21
  private _conditions;
20
22
  private _solo;
23
+ private _hasExitTime;
21
24
  /**
22
25
  * Is the transition destination the exit of the current state machine.
23
26
  */
@@ -31,13 +34,18 @@ export declare class AnimatorStateTransition {
31
34
  * The conditions in the transition.
32
35
  */
33
36
  get conditions(): Readonly<AnimatorCondition[]>;
37
+ /**
38
+ * When active the transition will have an exit time condition.
39
+ */
40
+ get hasExitTime(): boolean;
41
+ set hasExitTime(value: boolean);
34
42
  /**
35
43
  * Add a condition to a transition.
36
- * @param mode - The AnimatorCondition mode of the condition
37
44
  * @param parameterName - The name of the parameter
45
+ * @param mode - The AnimatorCondition mode of the condition
38
46
  * @param threshold - The threshold value of the condition
39
47
  */
40
- addCondition(mode: AnimatorConditionMode, parameterName: string, threshold?: AnimatorControllerParameterValueType): AnimatorCondition;
48
+ addCondition(parameterName: string, mode?: AnimatorConditionMode, threshold?: AnimatorControllerParameterValue): AnimatorCondition;
41
49
  /**
42
50
  * Add a condition to a transition.
43
51
  * @param animatorCondition - The condition to add
@@ -20,3 +20,6 @@ export { WrapMode } from "./enums/WrapMode";
20
20
  export * from "./Keyframe";
21
21
  export * from "./AnimatorLayerMask";
22
22
  export { StateMachineScript } from "./StateMachineScript";
23
+ export { AnimatorCondition } from "./AnimatorCondition";
24
+ export * from "./AnimatorControllerParameter";
25
+ export { LayerPathMask } from "./LayerPathMask";
@@ -3,12 +3,36 @@
3
3
  */
4
4
  export declare class AssetPromise<T> implements PromiseLike<T> {
5
5
  /**
6
- * Return a new resource Promise through the provided asset promise collection.
7
- * The resolved of the new AssetPromise will be triggered when all the Promises in the provided set are completed.
8
- * @param - Promise Collection
9
- * @returns AssetPromise
6
+ * Creates a new resolved AssetPromise.
7
+ * @returns A resolved AssetPromise.
8
+ */
9
+ static resolve(): AssetPromise<void>;
10
+ /**
11
+ * Creates a new resolved AssetPromise fork the provided value.
12
+ * @param value - A value
13
+ * @returns A AssetPromise whose internal state matches the provided promise.
14
+ */
15
+ static resolve<T>(value: T): AssetPromise<Awaited<T>>;
16
+ /**
17
+ * Creates a new resolved AssetPromise for the provided value.
18
+ * @param value - A PromiseLike
19
+ * @returns A AssetPromise whose internal state matches the provided promise.
20
+ */
21
+ static resolve<T>(value: PromiseLike<T>): AssetPromise<Awaited<T>>;
22
+ /**
23
+ * Creates a AssetPromise that is resolved with an array of results when all of the provided PromiseLike resolve, or rejected when any PromiseLike is rejected.
24
+ * @param values An array of PromiseLikes
25
+ * @returns A new AssetPromise.
26
+ */
27
+ static all<T extends [] | unknown[]>(values: T extends [] ? [...T] : readonly [...T]): AssetPromise<{
28
+ [K in keyof T]: UnwrapPromise<T[K]>;
29
+ }>;
30
+ /**
31
+ * Creates a AssetPromise that is resolved with an array of results when all of the provided PromiseLikes resolve, or rejected when any PromiseLikes is rejected.
32
+ * @param values An iterable of PromiseLikes
33
+ * @returns A new AssetPromise.
10
34
  */
11
- static all<T = any>(promises: (PromiseLike<T> | T)[]): AssetPromise<T[]>;
35
+ static all<T>(values: Iterable<T | PromiseLike<T>>): AssetPromise<Awaited<T>[]>;
12
36
  /** compatible with Promise */
13
37
  get [Symbol.toStringTag](): string;
14
38
  private _promise;
@@ -59,4 +83,5 @@ interface AssetPromiseExecutor<T> {
59
83
  }
60
84
  type TaskCompleteCallback = (loaded: number, total: number) => void;
61
85
  type TaskDetailCallback = (url: string, loaded: number, total: number) => void;
86
+ type UnwrapPromise<T> = T extends PromiseLike<infer U> ? U : T;
62
87
  export {};
@@ -23,6 +23,8 @@ export declare enum AssetType {
23
23
  TextureCube = "TextureCube",
24
24
  /** Material. */
25
25
  Material = "Material",
26
+ /** Shader. */
27
+ Shader = "Shader",
26
28
  /** Mesh. */
27
29
  Mesh = "Mesh",
28
30
  /** AnimationClip. */
@@ -53,8 +55,12 @@ export declare enum AssetType {
53
55
  HDR = "HDR",
54
56
  /** Font. */
55
57
  Font = "Font",
56
- /** Source Font, include ttf otf and woff. */
58
+ /** Source Font, include ttf, otf and woff. */
57
59
  SourceFont = "SourceFont",
60
+ /** AudioClip, include ogg, wav and mp3. */
61
+ Audio = "Audio",
58
62
  /** Project asset. */
59
- Project = "project"
63
+ Project = "project",
64
+ /** PhysicsMaterial. */
65
+ PhysicsMaterial = "PhysicsMaterial"
60
66
  }
@@ -1,7 +1,6 @@
1
1
  import { Engine, EngineConfiguration } from "../Engine";
2
2
  import { AssetPromise } from "./AssetPromise";
3
3
  import { LoadItem } from "./LoadItem";
4
- import { RequestConfig } from "./request";
5
4
  import { ResourceManager } from "./ResourceManager";
6
5
  /**
7
6
  * Loader abstract class.
@@ -35,5 +34,4 @@ export declare abstract class Loader<T> {
35
34
  constructor(useCache: boolean);
36
35
  initialize?(engine: Engine, configuration: EngineConfiguration): Promise<void>;
37
36
  abstract load(item: LoadItem, resourceManager: ResourceManager): AssetPromise<T>;
38
- request: <U>(url: string, config: RequestConfig) => AssetPromise<U>;
39
37
  }
@@ -102,15 +102,20 @@ export declare class ResourceManager {
102
102
  addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
103
103
  private _assignDefaultOptions;
104
104
  private _loadSingleItem;
105
- private _pushSubAssetPromiseCallback;
105
+ private _loadSubpackageAndMainAsset;
106
+ private _loadMainAsset;
107
+ private _createSubAssetPromiseCallback;
106
108
  private _gc;
107
109
  private _getResolveResource;
108
110
  private _parseURL;
109
111
  private _parseQueryPath;
112
+ private _releaseSubAssetPromiseCallback;
110
113
  }
111
114
  /**
112
115
  * Declare ResourceLoader's decorator.
113
116
  * @param assetType - Type of asset
114
117
  * @param extNames - Name of file extension
115
118
  */
116
- export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target: new (useCache: boolean) => T) => void;
119
+ export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target: {
120
+ new (useCache: boolean): T;
121
+ }) => void;