@galacean/engine-core 0.0.0-experimental-1.3-xr.10 → 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 (105) hide show
  1. package/dist/main.js +17182 -15529
  2. package/dist/main.js.map +1 -1
  3. package/dist/module.js +16241 -14706
  4. package/dist/module.js.map +1 -1
  5. package/package.json +3 -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 +18 -4
  25. package/types/Polyfill.d.ts +1 -0
  26. package/types/RenderPipeline/BasicRenderPipeline.d.ts +4 -0
  27. package/types/RenderPipeline/Blitter.d.ts +28 -0
  28. package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +1 -0
  29. package/types/RenderPipeline/index.d.ts +3 -1
  30. package/types/Renderer.d.ts +15 -3
  31. package/types/Scene.d.ts +4 -1
  32. package/types/Script.d.ts +42 -18
  33. package/types/Transform.d.ts +17 -7
  34. package/types/animation/Animator.d.ts +27 -5
  35. package/types/animation/AnimatorController.d.ts +12 -2
  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/AnimatorStateTransitionCollection.d.ts +1 -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 +4 -1
  44. package/types/asset/request.d.ts +10 -3
  45. package/types/audio/AudioClip.d.ts +24 -0
  46. package/types/audio/AudioManager.d.ts +1 -0
  47. package/types/audio/AudioSource.d.ts +72 -0
  48. package/types/audio/index.d.ts +3 -0
  49. package/types/base/Constant.d.ts +22 -22
  50. package/types/enums/CameraModifyFlags.d.ts +17 -0
  51. package/types/enums/EntityModifyFlags.d.ts +9 -0
  52. package/types/{2d/enums → enums}/SpriteMaskLayer.d.ts +3 -1
  53. package/types/index.d.ts +6 -1
  54. package/types/input/index.d.ts +5 -2
  55. package/types/input/pointer/Pointer.d.ts +8 -2
  56. package/types/input/pointer/PointerEventData.d.ts +12 -0
  57. package/types/input/pointer/PointerManager.d.ts +9 -1
  58. package/types/input/pointer/emitter/IHitResult.d.ts +1 -0
  59. package/types/input/pointer/emitter/PhysicsPointerEventEmitter.d.ts +1 -0
  60. package/types/input/pointer/emitter/PointerEventEmitter.d.ts +30 -0
  61. package/types/lighting/DirectLight.d.ts +5 -0
  62. package/types/lighting/Light.d.ts +4 -1
  63. package/types/material/BaseMaterial.d.ts +4 -2
  64. package/types/material/Material.d.ts +1 -0
  65. package/types/material/PBRMaterial.d.ts +130 -0
  66. package/types/material/enums/Refraction.d.ts +9 -0
  67. package/types/material/index.d.ts +1 -0
  68. package/types/material/utils/PrefilteredDFG.d.ts +7 -0
  69. package/types/particle/ParticleGenerator.d.ts +1 -0
  70. package/types/particle/modules/MainModule.d.ts +1 -2
  71. package/types/physics/CharacterController.d.ts +5 -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/IUICanvas.d.ts +1 -0
  104. package/types/ui/UIUtils.d.ts +11 -0
  105. package/dist/miniprogram.js +0 -34626
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
  }
@@ -9,6 +9,7 @@ import { AnimatorCullingMode } from "./enums/AnimatorCullingMode";
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. */
@@ -39,17 +40,25 @@ export declare class Animator extends Component {
39
40
  * Play a state by name.
40
41
  * @param stateName - The state name
41
42
  * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
42
- * @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
43
44
  */
44
45
  play(stateName: string, layerIndex?: number, normalizedTimeOffset?: number): void;
45
46
  /**
46
- * 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.
47
48
  * @param stateName - The state name
48
- * @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)
49
50
  * @param layerIndex - The layer index(default -1). If layer is -1, play the first state with the given state name
50
- * @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
51
52
  */
52
- 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;
53
62
  /**
54
63
  * Evaluates the animator component based on deltaTime.
55
64
  * @param deltaTime - The deltaTime when the animation update
@@ -88,6 +97,17 @@ export declare class Animator extends Component {
88
97
  * @param value - The value of the parameter
89
98
  */
90
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;
91
111
  private _getAnimatorStateInfo;
92
112
  private _getAnimatorStateData;
93
113
  private _saveAnimatorStateData;
@@ -112,6 +132,7 @@ export declare class Animator extends Component {
112
132
  private _updateCrossFadeData;
113
133
  private _preparePlayOwner;
114
134
  private _applyStateTransitions;
135
+ private _checkNoExitTimeTransition;
115
136
  private _checkSubTransition;
116
137
  private _checkBackwardsSubTransition;
117
138
  private _applyTransitionsByCondition;
@@ -128,4 +149,5 @@ export declare class Animator extends Component {
128
149
  private _checkAnyAndEntryState;
129
150
  private _checkRevertOwner;
130
151
  private _fireAnimationEventsAndCallScripts;
152
+ private _deactivateTriggeredParameters;
131
153
  }
@@ -31,10 +31,19 @@ export declare class AnimatorController extends ReferResource {
31
31
  */
32
32
  addParameter(name: string, defaultValue?: AnimatorControllerParameterValue): AnimatorControllerParameter;
33
33
  /**
34
- * Remove a parameter from the controller by name.
35
- * @param name - The parameter name
34
+ * Add a trigger parameter to the controller.
35
+ * @param name - The name of the parameter
36
+ */
37
+ addTriggerParameter(name: string): AnimatorControllerParameter;
38
+ /**
39
+ * Remove a parameter from the controller by name, including trigger parameters.
40
+ * @param name - The name of the parameter
36
41
  */
37
42
  removeParameter(name: string): void;
43
+ /**
44
+ * Clear all parameters, including trigger parameters.
45
+ */
46
+ clearParameters(): void;
38
47
  /**
39
48
  * Get the parameter by name.
40
49
  * @param name - The name of the parameter
@@ -59,4 +68,5 @@ export declare class AnimatorController extends ReferResource {
59
68
  * Clear layers.
60
69
  */
61
70
  clearLayers(): void;
71
+ private _addParameter;
62
72
  }
@@ -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 { AnimatorControllerParameterValue } 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?: AnimatorControllerParameterValue): 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
@@ -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,6 +102,7 @@ export declare class ResourceManager {
102
102
  addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
103
103
  private _assignDefaultOptions;
104
104
  private _loadSingleItem;
105
+ private _loadSubpackageAndMainAsset;
105
106
  private _loadMainAsset;
106
107
  private _createSubAssetPromiseCallback;
107
108
  private _gc;
@@ -115,4 +116,6 @@ export declare class ResourceManager {
115
116
  * @param assetType - Type of asset
116
117
  * @param extNames - Name of file extension
117
118
  */
118
- 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;
@@ -1,4 +1,10 @@
1
1
  import { AssetPromise } from "./AssetPromise";
2
+ /**
3
+ * Configuration options for `request`.
4
+ * @remarks
5
+ * This type extends the standard `RequestInit` options with additional
6
+ * properties for handling retries, timeouts, and custom response types.
7
+ */
2
8
  export type RequestConfig = {
3
9
  type?: XMLHttpRequestResponseType | "image";
4
10
  retryCount?: number;
@@ -6,9 +12,10 @@ export type RequestConfig = {
6
12
  timeout?: number;
7
13
  } & RequestInit;
8
14
  /**
9
- * Web request.
10
- * @param url - The link
11
- * @param config - Load configuration
15
+ * Sends a request to the specified URL and returns a promise for the response.
16
+ * @param url - The URL to send the request to
17
+ * @param config - Configuration options for the request
18
+ * @returns A promise that resolves with the response of type `T`
12
19
  */
13
20
  export declare function request<T>(url: string, config?: RequestConfig): AssetPromise<T>;
14
21
  export declare class MultiExecutor {
@@ -0,0 +1,24 @@
1
+ import { Engine } from "../Engine";
2
+ import { ReferResource } from "../asset/ReferResource";
3
+ /**
4
+ * Audio Clip.
5
+ */
6
+ export declare class AudioClip extends ReferResource {
7
+ private _audioBuffer;
8
+ /** Name of clip. */
9
+ name: string;
10
+ /**
11
+ * Number of discrete audio channels.
12
+ */
13
+ get channels(): number;
14
+ /**
15
+ * Sample rate, in samples per second.
16
+ */
17
+ get sampleRate(): number;
18
+ /**
19
+ * Duration, in seconds.
20
+ */
21
+ get duration(): number;
22
+ constructor(engine: Engine, name?: string);
23
+ protected _onDestroy(): void;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,72 @@
1
+ import { Component } from "../Component";
2
+ import { AudioClip } from "./AudioClip";
3
+ /**
4
+ * Audio Source Component.
5
+ */
6
+ export declare class AudioSource extends Component {
7
+ /** If set to true, the audio component automatically begins to play on startup. */
8
+ playOnEnabled: boolean;
9
+ private _isPlaying;
10
+ private _clip;
11
+ private _gainNode;
12
+ private _sourceNode;
13
+ private _pausedTime;
14
+ private _playTime;
15
+ private _volume;
16
+ private _lastVolume;
17
+ private _playbackRate;
18
+ private _loop;
19
+ /**
20
+ * The audio clip to play.
21
+ */
22
+ get clip(): AudioClip;
23
+ set clip(value: AudioClip);
24
+ /**
25
+ * Whether the clip playing right now.
26
+ */
27
+ get isPlaying(): boolean;
28
+ /**
29
+ * The volume of the audio source, ranging from 0 to 1.
30
+ * @defaultValue `1`
31
+ */
32
+ get volume(): number;
33
+ set volume(value: number);
34
+ /**
35
+ * The playback rate of the audio source.
36
+ * @defaultValue `1`
37
+ */
38
+ get playbackRate(): number;
39
+ set playbackRate(value: number);
40
+ /**
41
+ * Mutes or unmute the audio source.
42
+ * Mute sets volume as 0, unmute restore volume.
43
+ */
44
+ get mute(): boolean;
45
+ set mute(value: boolean);
46
+ /**
47
+ * Whether the audio clip looping.
48
+ * @defaultValue `false`
49
+ */
50
+ get loop(): boolean;
51
+ set loop(value: boolean);
52
+ /**
53
+ * Playback position in seconds.
54
+ */
55
+ get time(): number;
56
+ /**
57
+ * Play the clip.
58
+ */
59
+ play(): void;
60
+ /**
61
+ * Stops playing the clip.
62
+ */
63
+ stop(): void;
64
+ /**
65
+ * Pauses playing the clip.
66
+ */
67
+ pause(): void;
68
+ private _onPlayEnd;
69
+ private _initSourceNode;
70
+ private _clearSourceNode;
71
+ private _canPlay;
72
+ }
@@ -0,0 +1,3 @@
1
+ export { AudioClip } from "./AudioClip";
2
+ export { AudioSource } from "./AudioSource";
3
+ export { AudioManager } from "./AudioManager";