@galacean/engine-core 1.3.24 → 1.4.0-alpha.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.
- package/dist/main.js +13726 -13611
- package/dist/main.js.map +1 -1
- package/dist/module.js +13243 -13213
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
- package/types/2d/index.d.ts +0 -1
- package/types/2d/sprite/SpriteMask.d.ts +2 -1
- package/types/2d/sprite/SpriteRenderer.d.ts +0 -1
- package/types/2d/text/TextRenderer.d.ts +0 -1
- package/types/BasicResources.d.ts +2 -1
- package/types/Camera.d.ts +1 -3
- package/types/Engine.d.ts +0 -3
- package/types/Entity.d.ts +15 -3
- package/types/Polyfill.d.ts +1 -0
- package/types/RenderPipeline/BasicRenderPipeline.d.ts +3 -0
- package/types/RenderPipeline/enums/RenderQueueMaskType.d.ts +1 -0
- package/types/Renderer.d.ts +0 -2
- package/types/Transform.d.ts +17 -7
- package/types/animation/Animator.d.ts +27 -5
- package/types/animation/AnimatorController.d.ts +12 -2
- package/types/animation/AnimatorState.d.ts +0 -1
- package/types/animation/AnimatorStateMachine.d.ts +10 -6
- package/types/animation/AnimatorStateTransition.d.ts +13 -5
- package/types/animation/AnimatorStateTransitionCollection.d.ts +1 -0
- package/types/asset/AssetType.d.ts +3 -1
- package/types/asset/ResourceManager.d.ts +3 -1
- package/types/asset/request.d.ts +10 -3
- package/types/audio/AudioClip.d.ts +24 -0
- package/types/audio/AudioManager.d.ts +1 -0
- package/types/audio/AudioSource.d.ts +72 -0
- package/types/audio/index.d.ts +3 -0
- package/types/base/Constant.d.ts +22 -22
- package/types/{2d/enums → enums}/SpriteMaskLayer.d.ts +3 -1
- package/types/index.d.ts +3 -0
- package/types/lighting/DirectLight.d.ts +5 -0
- package/types/lighting/Light.d.ts +4 -1
- package/types/material/PBRMaterial.d.ts +65 -0
- package/types/physics/CharacterController.d.ts +5 -6
- package/types/physics/Collider.d.ts +3 -1
- package/types/physics/DynamicCollider.d.ts +25 -2
- package/types/physics/PhysicsMaterial.d.ts +1 -1
- package/types/physics/joint/FixedJoint.d.ts +1 -0
- package/types/physics/joint/HingeJoint.d.ts +9 -6
- package/types/physics/joint/Joint.d.ts +25 -7
- package/types/physics/joint/JointLimits.d.ts +34 -10
- package/types/physics/joint/JointMotor.d.ts +27 -8
- package/types/physics/joint/SpringJoint.d.ts +2 -6
- package/types/physics/shape/BoxColliderShape.d.ts +1 -0
- package/types/physics/shape/CapsuleColliderShape.d.ts +1 -0
- package/types/physics/shape/ColliderShape.d.ts +2 -1
- package/types/physics/shape/SphereColliderShape.d.ts +1 -1
- package/dist/miniprogram.js +0 -34721
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@galacean/engine-core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0-alpha.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"registry": "https://registry.npmjs.org"
|
|
@@ -18,10 +18,10 @@
|
|
|
18
18
|
"types/**/*"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@galacean/engine-math": "1.
|
|
21
|
+
"@galacean/engine-math": "1.4.0-alpha.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@galacean/engine-design": "1.
|
|
24
|
+
"@galacean/engine-design": "1.4.0-alpha.1"
|
|
25
25
|
},
|
|
26
26
|
"scripts": {
|
|
27
27
|
"b:types": "tsc"
|
package/types/2d/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { SpriteMaskInteraction } from "./enums/SpriteMaskInteraction";
|
|
2
|
-
export { SpriteMaskLayer } from "./enums/SpriteMaskLayer";
|
|
3
2
|
export { TextHorizontalAlignment, TextVerticalAlignment } from "./enums/TextAlignment";
|
|
4
3
|
export { OverflowMode } from "./enums/TextOverflow";
|
|
5
4
|
export { FontStyle } from "./enums/FontStyle";
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { BoundingBox } from "@galacean/engine-math";
|
|
2
2
|
import { RenderContext } from "../../RenderPipeline/RenderContext";
|
|
3
3
|
import { Renderer } from "../../Renderer";
|
|
4
|
+
import { SpriteMaskLayer } from "../../enums/SpriteMaskLayer";
|
|
4
5
|
import { Sprite } from "./Sprite";
|
|
5
6
|
/**
|
|
6
7
|
* A component for masking Sprites.
|
|
7
8
|
*/
|
|
8
9
|
export declare class SpriteMask extends Renderer {
|
|
9
10
|
/** The mask layers the sprite mask influence to. */
|
|
10
|
-
influenceLayers:
|
|
11
|
+
influenceLayers: SpriteMaskLayer;
|
|
11
12
|
private _sprite;
|
|
12
13
|
private _automaticWidth;
|
|
13
14
|
private _automaticHeight;
|
|
@@ -106,7 +106,6 @@ export declare class TextRenderer extends Renderer {
|
|
|
106
106
|
constructor(entity: Entity);
|
|
107
107
|
protected _updateBounds(worldBounds: BoundingBox): void;
|
|
108
108
|
protected _render(context: RenderContext): void;
|
|
109
|
-
private _updateStencilState;
|
|
110
109
|
private _resetSubFont;
|
|
111
110
|
private _updatePosition;
|
|
112
111
|
private _updateColor;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { RenderStateElementKey } from "./shader/enums/RenderStateElementKey";
|
|
2
|
+
export type RenderStateElementMap = Record<RenderStateElementKey, number | boolean>;
|
package/types/Camera.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare class Camera extends Component {
|
|
|
50
50
|
/**
|
|
51
51
|
* Multi-sample anti-aliasing samples when use independent canvas mode.
|
|
52
52
|
*
|
|
53
|
-
* @remarks
|
|
53
|
+
* @remarks It will take effect when `independentCanvasEnabled` property is `true`, otherwise it will be invalid.
|
|
54
54
|
*/
|
|
55
55
|
msaaSamples: MSAASamples;
|
|
56
56
|
private _priority;
|
|
@@ -68,7 +68,6 @@ export declare class Camera extends Component {
|
|
|
68
68
|
private _enableHDR;
|
|
69
69
|
private _enablePostProcess;
|
|
70
70
|
private _frustumChangeFlag;
|
|
71
|
-
private _transform;
|
|
72
71
|
private _isViewMatrixDirty;
|
|
73
72
|
private _isInvViewProjDirty;
|
|
74
73
|
private _viewport;
|
|
@@ -86,7 +85,6 @@ export declare class Camera extends Component {
|
|
|
86
85
|
set opaqueTextureEnabled(value: boolean);
|
|
87
86
|
/**
|
|
88
87
|
* Whether independent canvas is enabled.
|
|
89
|
-
*
|
|
90
88
|
* @remarks If true, the msaa in viewport can turn or off independently by `msaaSamples` property.
|
|
91
89
|
*/
|
|
92
90
|
get independentCanvasEnabled(): boolean;
|
package/types/Engine.d.ts
CHANGED
|
@@ -117,9 +117,6 @@ export declare class Engine extends EventDispatcher {
|
|
|
117
117
|
* @remarks If call during frame execution will delay until the end of the frame
|
|
118
118
|
*/
|
|
119
119
|
destroy(): void;
|
|
120
|
-
private _createSpriteMaterial;
|
|
121
|
-
private _createSpriteMaskMaterial;
|
|
122
|
-
private _createTextMaterial;
|
|
123
120
|
private _onDeviceLost;
|
|
124
121
|
private _onDeviceRestored;
|
|
125
122
|
private _gc;
|
package/types/Entity.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Matrix } from "@galacean/engine-math";
|
|
2
|
+
import { BoolUpdateFlag } from "./BoolUpdateFlag";
|
|
2
3
|
import { Component } from "./Component";
|
|
3
4
|
import { Engine } from "./Engine";
|
|
4
5
|
import { Layer } from "./Layer";
|
|
@@ -13,11 +14,14 @@ export declare class Entity extends EngineObject {
|
|
|
13
14
|
name: string;
|
|
14
15
|
/** The layer the entity belongs to. */
|
|
15
16
|
layer: Layer;
|
|
16
|
-
|
|
17
|
-
readonly transform: Transform;
|
|
17
|
+
private _transform;
|
|
18
18
|
private _templateResource;
|
|
19
19
|
private _parent;
|
|
20
20
|
private _activeChangedComponents;
|
|
21
|
+
/**
|
|
22
|
+
* The transform of this entity.
|
|
23
|
+
*/
|
|
24
|
+
get transform(): Transform;
|
|
21
25
|
/**
|
|
22
26
|
* Whether to activate locally.
|
|
23
27
|
*/
|
|
@@ -53,8 +57,10 @@ export declare class Entity extends EngineObject {
|
|
|
53
57
|
/**
|
|
54
58
|
* Create a entity.
|
|
55
59
|
* @param engine - The engine the entity belongs to
|
|
60
|
+
* @param name - The name of the entity
|
|
61
|
+
* @param components - The types of components you wish to add
|
|
56
62
|
*/
|
|
57
|
-
constructor(engine: Engine, name?: string);
|
|
63
|
+
constructor(engine: Engine, name?: string, ...components: ComponentConstructor[]);
|
|
58
64
|
/**
|
|
59
65
|
* Add component based on the component type.
|
|
60
66
|
* @param type - The type of the component
|
|
@@ -132,6 +138,11 @@ export declare class Entity extends EngineObject {
|
|
|
132
138
|
* @returns Cloned entity
|
|
133
139
|
*/
|
|
134
140
|
clone(): Entity;
|
|
141
|
+
/**
|
|
142
|
+
* Listen for changes in the world pose of this `Entity`.
|
|
143
|
+
* @returns Change flag
|
|
144
|
+
*/
|
|
145
|
+
registerWorldChangeFlag(): BoolUpdateFlag;
|
|
135
146
|
private _createCloneEntity;
|
|
136
147
|
private _parseCloneEntity;
|
|
137
148
|
/**
|
|
@@ -153,4 +164,5 @@ export declare class Entity extends EngineObject {
|
|
|
153
164
|
getInvModelMatrix(): Matrix;
|
|
154
165
|
}
|
|
155
166
|
type ComponentArguments<T extends new (entity: Entity, ...args: any[]) => Component> = T extends new (entity: Entity, ...args: infer P) => Component ? P : never;
|
|
167
|
+
type ComponentConstructor = new (entity: Entity) => Component;
|
|
156
168
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -13,6 +13,9 @@ export declare class BasicRenderPipeline {
|
|
|
13
13
|
private _cascadedShadowCasterPass;
|
|
14
14
|
private _depthOnlyPass;
|
|
15
15
|
private _opaqueTexturePass;
|
|
16
|
+
private _grabTexture;
|
|
17
|
+
private _canUseBlitFrameBuffer;
|
|
18
|
+
private _shouldGrabColor;
|
|
16
19
|
/**
|
|
17
20
|
* Create a basic render pipeline.
|
|
18
21
|
* @param camera - Camera
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/types/Renderer.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BoundingBox, Matrix, Vector4 } from "@galacean/engine-math";
|
|
2
2
|
import { Component } from "./Component";
|
|
3
3
|
import { RenderContext } from "./RenderPipeline/RenderContext";
|
|
4
|
-
import { Transform } from "./Transform";
|
|
5
4
|
import { IComponentCustomClone } from "./clone/ComponentCloner";
|
|
6
5
|
import { Material } from "./material";
|
|
7
6
|
import { ShaderData } from "./shader/ShaderData";
|
|
@@ -24,7 +23,6 @@ export declare class Renderer extends Component implements IComponentCustomClone
|
|
|
24
23
|
protected _materials: Material[];
|
|
25
24
|
protected _dirtyUpdateFlag: number;
|
|
26
25
|
protected _rendererLayer: Vector4;
|
|
27
|
-
protected _transform: Transform;
|
|
28
26
|
private _shaderData;
|
|
29
27
|
private _mvMatrix;
|
|
30
28
|
private _mvpMatrix;
|
package/types/Transform.d.ts
CHANGED
|
@@ -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.
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
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
|
-
*
|
|
35
|
-
* @param name - The parameter
|
|
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,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
|
-
|
|
80
|
-
|
|
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.
|
|
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(
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -55,8 +55,10 @@ export declare enum AssetType {
|
|
|
55
55
|
HDR = "HDR",
|
|
56
56
|
/** Font. */
|
|
57
57
|
Font = "Font",
|
|
58
|
-
/** Source Font, include ttf
|
|
58
|
+
/** Source Font, include ttf, otf and woff. */
|
|
59
59
|
SourceFont = "SourceFont",
|
|
60
|
+
/** AudioClip, include ogg, wav and mp3. */
|
|
61
|
+
Audio = "Audio",
|
|
60
62
|
/** Project asset. */
|
|
61
63
|
Project = "project"
|
|
62
64
|
}
|
|
@@ -115,4 +115,6 @@ export declare class ResourceManager {
|
|
|
115
115
|
* @param assetType - Type of asset
|
|
116
116
|
* @param extNames - Name of file extension
|
|
117
117
|
*/
|
|
118
|
-
export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target:
|
|
118
|
+
export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target: {
|
|
119
|
+
new (useCache: boolean): T;
|
|
120
|
+
}) => void;
|
package/types/asset/request.d.ts
CHANGED
|
@@ -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
|
-
*
|
|
10
|
-
* @param url - The
|
|
11
|
-
* @param config -
|
|
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
|
+
}
|