@galacean/engine-core 1.0.0 → 1.0.2

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 (265) hide show
  1. package/dist/main.js +15448 -13299
  2. package/dist/main.js.map +1 -1
  3. package/dist/miniprogram.js +15448 -13299
  4. package/dist/module.js +15434 -13295
  5. package/dist/module.js.map +1 -1
  6. package/package.json +3 -3
  7. package/types/2d/assembler/TiledSpriteAssembler.d.ts +1 -0
  8. package/types/2d/atlas/SpriteAtlas.d.ts +2 -6
  9. package/types/2d/data/VertexData2D.d.ts +1 -0
  10. package/types/2d/enums/SpriteDrawMode.d.ts +4 -2
  11. package/types/2d/enums/SpriteTileMode.d.ts +11 -0
  12. package/types/2d/index.d.ts +1 -0
  13. package/types/2d/sprite/Sprite.d.ts +17 -8
  14. package/types/2d/sprite/SpriteMask.d.ts +16 -22
  15. package/types/2d/sprite/SpriteRenderer.d.ts +31 -17
  16. package/types/2d/text/Font.d.ts +2 -7
  17. package/types/2d/text/TextRenderer.d.ts +1 -13
  18. package/types/2d/text/index.d.ts +1 -0
  19. package/types/Camera.d.ts +32 -10
  20. package/types/Component.d.ts +0 -8
  21. package/types/ComponentsDependencies.d.ts +17 -9
  22. package/types/ComponentsManager.d.ts +3 -2
  23. package/types/DisorderedArray.d.ts +4 -3
  24. package/types/Engine.d.ts +35 -43
  25. package/types/Entity.d.ts +2 -2
  26. package/types/RenderPipeline/Basic2DBatcher.d.ts +6 -7
  27. package/types/RenderPipeline/BasicRenderPipeline.d.ts +8 -6
  28. package/types/RenderPipeline/ClassPool.d.ts +3 -1
  29. package/types/RenderPipeline/CullingResults.d.ts +1 -0
  30. package/types/RenderPipeline/DepthOnlyPass.d.ts +1 -0
  31. package/types/RenderPipeline/IPoolElement.d.ts +3 -0
  32. package/types/RenderPipeline/MeshRenderData.d.ts +17 -0
  33. package/types/RenderPipeline/MeshRenderElement.d.ts +3 -1
  34. package/types/RenderPipeline/PipelinePass.d.ts +16 -0
  35. package/types/RenderPipeline/PipelineUtils.d.ts +1 -0
  36. package/types/RenderPipeline/RenderData.d.ts +7 -0
  37. package/types/RenderPipeline/RenderElement.d.ts +8 -8
  38. package/types/RenderPipeline/RenderElementX.d.ts +12 -0
  39. package/types/RenderPipeline/RenderPass.d.ts +1 -1
  40. package/types/RenderPipeline/RenderQueue.d.ts +3 -5
  41. package/types/RenderPipeline/SpriteElement.d.ts +3 -1
  42. package/types/RenderPipeline/SpriteMaskBatcher.d.ts +4 -3
  43. package/types/RenderPipeline/SpriteMaskElement.d.ts +3 -1
  44. package/types/RenderPipeline/SpriteMaskRenderData.d.ts +12 -0
  45. package/types/RenderPipeline/SpriteRenderData.d.ts +14 -0
  46. package/types/RenderPipeline/TextRenderData.d.ts +8 -0
  47. package/types/RenderPipeline/TextRenderElement.d.ts +3 -1
  48. package/types/RenderPipeline/enums/PipelineStage.d.ts +9 -0
  49. package/types/RenderPipeline/index.d.ts +4 -0
  50. package/types/Renderer.d.ts +10 -15
  51. package/types/SafeLoopArray.d.ts +37 -0
  52. package/types/Scene.d.ts +13 -5
  53. package/types/Script.d.ts +18 -15
  54. package/types/Ticker.d.ts +30 -0
  55. package/types/Transform.d.ts +10 -12
  56. package/types/Utils.d.ts +28 -0
  57. package/types/animation/AnimationClip.d.ts +2 -1
  58. package/types/animation/Animator.d.ts +7 -4
  59. package/types/animation/animationCurve/AnimationFloatArrayCurve.d.ts +0 -1
  60. package/types/animation/animationCurve/AnimationRectCurve.d.ts +8 -0
  61. package/types/animation/animationCurve/AnimationRefCurve.d.ts +8 -0
  62. package/types/animation/enums/LayerState.d.ts +3 -1
  63. package/types/animation/internal/AnimationCurveLayerOwner.d.ts +1 -0
  64. package/types/animation/internal/AnimationCurveOwnerLayerData.d.ts +1 -0
  65. package/types/asset/AssetType.d.ts +16 -16
  66. package/types/asset/ContentRestorer.d.ts +17 -0
  67. package/types/asset/GraphicsResource.d.ts +5 -0
  68. package/types/asset/IReferable.d.ts +2 -0
  69. package/types/asset/LoadItem.d.ts +16 -9
  70. package/types/asset/ReferResource.d.ts +22 -0
  71. package/types/asset/ResourceManager.d.ts +17 -9
  72. package/types/asset/request.d.ts +7 -3
  73. package/types/base/Constant.d.ts +2 -1
  74. package/types/base/EngineObject.d.ts +1 -0
  75. package/types/base/EventDispatcher.d.ts +2 -15
  76. package/types/base/Time.d.ts +27 -24
  77. package/types/base/index.d.ts +0 -2
  78. package/types/enums/ActiveChangeFlag.d.ts +6 -0
  79. package/types/enums/DepthTextureMode.d.ts +7 -0
  80. package/types/env-probe/CubeProbe.d.ts +0 -7
  81. package/types/env-probe/Probe.d.ts +0 -6
  82. package/types/graphic/Buffer.d.ts +5 -12
  83. package/types/graphic/Mesh.d.ts +5 -16
  84. package/types/graphic/Primitive.d.ts +1 -0
  85. package/types/graphic/PrimitiveVertexBinding.d.ts +1 -0
  86. package/types/graphic/SubMesh.d.ts +3 -1
  87. package/types/graphic/SubPrimitive.d.ts +9 -0
  88. package/types/index.d.ts +8 -7
  89. package/types/input/InputManager.d.ts +1 -1
  90. package/types/input/interface/IInput.d.ts +1 -1
  91. package/types/lighting/AmbientLight.d.ts +4 -1
  92. package/types/lighting/DirectLight.d.ts +0 -1
  93. package/types/lighting/Light.d.ts +0 -1
  94. package/types/lighting/LightManager.d.ts +1 -0
  95. package/types/lighting/SpotLight.d.ts +0 -1
  96. package/types/material/BaseMaterial.d.ts +8 -10
  97. package/types/material/BlinnPhongMaterial.d.ts +0 -3
  98. package/types/material/Material.d.ts +8 -8
  99. package/types/material/PBRMaterial.d.ts +12 -3
  100. package/types/material/PBRSpecularMaterial.d.ts +1 -1
  101. package/types/material/UnlitMaterial.d.ts +1 -1
  102. package/types/mesh/BlendShape.d.ts +1 -1
  103. package/types/mesh/BlendShapeFrame.d.ts +28 -6
  104. package/types/mesh/MeshRenderer.d.ts +7 -12
  105. package/types/mesh/ModelMesh.d.ts +5 -5
  106. package/types/mesh/PrimitiveMesh.d.ts +4 -2
  107. package/types/mesh/PrimitiveMeshRestorer.d.ts +1 -0
  108. package/types/mesh/SkinnedMeshRenderer.d.ts +0 -14
  109. package/types/particle/ParticleBufferUtils.d.ts +1 -0
  110. package/types/particle/ParticleData.d.ts +1 -0
  111. package/types/particle/ParticleGenerator.d.ts +72 -0
  112. package/types/particle/ParticleMaterial.d.ts +28 -0
  113. package/types/particle/ParticleMesh.d.ts +289 -0
  114. package/types/particle/ParticleRenderer.d.ts +2 -2
  115. package/types/particle/ParticleShaderDeclaration.d.ts +1 -0
  116. package/types/particle/ParticleShaderMacro.d.ts +1 -0
  117. package/types/particle/ParticleShaderProperty.d.ts +1 -0
  118. package/types/particle/ParticleSystem.d.ts +41 -0
  119. package/types/particle/ParticleVertexElements.d.ts +1 -0
  120. package/types/particle/ParticleVertexUtils.d.ts +1 -0
  121. package/types/particle/enum/ParticleAnimationRowMode.d.ts +9 -0
  122. package/types/particle/enum/ParticleAnimationType.d.ts +9 -0
  123. package/types/particle/enum/ParticleCurveMode.d.ts +13 -0
  124. package/types/particle/enum/ParticleGradientMode.d.ts +13 -0
  125. package/types/particle/enum/ParticleRenderMode.d.ts +17 -0
  126. package/types/particle/enum/ParticleScaleMode.d.ts +11 -0
  127. package/types/particle/enum/ParticleShapeMultiModeValue.d.ts +9 -0
  128. package/types/particle/enum/ParticleShapeType.d.ts +15 -0
  129. package/types/particle/enum/ParticleSimulationSpace.d.ts +9 -0
  130. package/types/particle/enum/index.d.ts +9 -0
  131. package/types/particle/enums/ParticleCurveMode.d.ts +9 -0
  132. package/types/particle/enums/ParticleGradientMode.d.ts +9 -0
  133. package/types/particle/enums/ParticleRandomSubSeeds.d.ts +1 -0
  134. package/types/particle/enums/ParticleRenderMode.d.ts +17 -0
  135. package/types/particle/enums/ParticleScaleMode.d.ts +11 -0
  136. package/types/particle/enums/ParticleSimulationSpace.d.ts +9 -0
  137. package/types/particle/enums/ParticleStopMode.d.ts +6 -0
  138. package/types/particle/enums/attributes/BillboardParticleVertexAttribute.d.ts +1 -0
  139. package/types/particle/enums/attributes/MeshParticleVertexAttribute.d.ts +5 -0
  140. package/types/particle/enums/attributes/ParticleInstanceVertexAttribute.d.ts +1 -0
  141. package/types/particle/module/Burst.d.ts +38 -0
  142. package/types/particle/module/ColorGradient.d.ts +75 -0
  143. package/types/particle/module/ColorOverLifetimeModule.d.ts +20 -0
  144. package/types/particle/module/EmissionModule.d.ts +63 -0
  145. package/types/particle/module/FrameOverTime.d.ts +73 -0
  146. package/types/particle/module/ParticleCurve.d.ts +37 -0
  147. package/types/particle/module/RotationOverLifetimeModule.d.ts +21 -0
  148. package/types/particle/module/RotationVelocityGradient.d.ts +184 -0
  149. package/types/particle/module/SizeGradient.d.ts +151 -0
  150. package/types/particle/module/SizeOverLifetimeModule.d.ts +21 -0
  151. package/types/particle/module/StartFrame.d.ts +46 -0
  152. package/types/particle/module/TextureSheetAnimationModule.d.ts +37 -0
  153. package/types/particle/module/VelocityGradient.d.ts +110 -0
  154. package/types/particle/module/VelocityOverLifetimeModule.d.ts +22 -0
  155. package/types/particle/module/index.d.ts +15 -0
  156. package/types/particle/module/shape/BaseShape.d.ts +26 -0
  157. package/types/particle/module/shape/BoxShape.d.ts +20 -0
  158. package/types/particle/module/shape/CircleShape.d.ts +27 -0
  159. package/types/particle/module/shape/ConeShape.d.ts +35 -0
  160. package/types/particle/module/shape/HemisphereShape.d.ts +23 -0
  161. package/types/particle/module/shape/ShapeUtils.d.ts +1 -0
  162. package/types/particle/module/shape/SphereShape.d.ts +23 -0
  163. package/types/particle/module/shape/index.d.ts +5 -0
  164. package/types/particle/modules/Burst.d.ts +14 -0
  165. package/types/particle/modules/ColorOverLifetimeModule.d.ts +20 -0
  166. package/types/particle/modules/EmissionModule.d.ts +45 -0
  167. package/types/particle/modules/MainModule.d.ts +70 -0
  168. package/types/particle/modules/ParticleCompositeCurve.d.ts +56 -0
  169. package/types/particle/modules/ParticleCompositeGradient.d.ts +55 -0
  170. package/types/particle/modules/ParticleCurve.d.ts +56 -0
  171. package/types/particle/modules/ParticleGeneratorModule.d.ts +12 -0
  172. package/types/particle/modules/ParticleGradient.d.ts +94 -0
  173. package/types/particle/modules/RotationOverLifetimeModule.d.ts +34 -0
  174. package/types/particle/modules/ShapeModule.d.ts +9 -0
  175. package/types/particle/modules/SizeOverLifetimeModule.d.ts +34 -0
  176. package/types/particle/modules/TextureSheetAnimationModule.d.ts +38 -0
  177. package/types/particle/modules/VelocityOverLifetimeModule.d.ts +34 -0
  178. package/types/particle/modules/shape/BaseShape.d.ts +12 -0
  179. package/types/particle/modules/shape/BoxShape.d.ts +11 -0
  180. package/types/particle/modules/shape/CircleShape.d.ts +17 -0
  181. package/types/particle/modules/shape/ConeShape.d.ts +28 -0
  182. package/types/particle/modules/shape/HemisphereShape.d.ts +9 -0
  183. package/types/particle/modules/shape/ShapeUtils.d.ts +1 -0
  184. package/types/particle/modules/shape/SphereShape.d.ts +9 -0
  185. package/types/particle/modules/shape/enums/ParticleShapeArcMode.d.ts +9 -0
  186. package/types/particle/modules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  187. package/types/particle/modules/shape/enums/ParticleShapeType.d.ts +15 -0
  188. package/types/particle/modules/shape/index.d.ts +6 -0
  189. package/types/particle/moudules/Burst.d.ts +25 -0
  190. package/types/particle/moudules/Emission.d.ts +47 -0
  191. package/types/particle/moudules/EmissionModule.d.ts +49 -0
  192. package/types/particle/moudules/MainModule.d.ts +59 -0
  193. package/types/particle/moudules/ParticleCurve.d.ts +27 -0
  194. package/types/particle/moudules/ParticleGradient.d.ts +28 -0
  195. package/types/particle/moudules/ShapeModule.d.ts +7 -0
  196. package/types/particle/moudules/shape/BaseShape.d.ts +28 -0
  197. package/types/particle/moudules/shape/BoxShape.d.ts +20 -0
  198. package/types/particle/moudules/shape/CircleShape.d.ts +27 -0
  199. package/types/particle/moudules/shape/ConeShape.d.ts +35 -0
  200. package/types/particle/moudules/shape/HemisphereShape.d.ts +23 -0
  201. package/types/particle/moudules/shape/ShapeUtils.d.ts +1 -0
  202. package/types/particle/moudules/shape/SphereShape.d.ts +23 -0
  203. package/types/particle/moudules/shape/enums/ParticleShapeMultiModeValue.d.ts +9 -0
  204. package/types/particle/moudules/shape/enums/ParticleShapeType.d.ts +15 -0
  205. package/types/particle/moudules/shape/index.d.ts +5 -0
  206. package/types/physics/CharacterController.d.ts +0 -2
  207. package/types/physics/Collider.d.ts +1 -1
  208. package/types/physics/Collision.d.ts +4 -0
  209. package/types/physics/PhysicsManager.d.ts +5 -22
  210. package/types/physics/PhysicsScene.d.ts +79 -0
  211. package/types/physics/joint/HingeJoint.d.ts +2 -2
  212. package/types/physics/joint/Joint.d.ts +2 -2
  213. package/types/physics/joint/SpringJoint.d.ts +1 -1
  214. package/types/renderingHardwareInterface/IPlatformBuffer.d.ts +8 -0
  215. package/types/renderingHardwareInterface/index.d.ts +1 -0
  216. package/types/shader/Shader.d.ts +32 -23
  217. package/types/shader/ShaderData.d.ts +24 -24
  218. package/types/shader/ShaderMacro.d.ts +16 -0
  219. package/types/shader/ShaderPart.d.ts +41 -0
  220. package/types/shader/ShaderPass.d.ts +9 -2
  221. package/types/shader/ShaderProperty.d.ts +7 -0
  222. package/types/shader/ShaderTagKey.d.ts +16 -0
  223. package/types/shader/SubShader.d.ts +19 -0
  224. package/types/shader/enums/RenderStateElementKey.d.ts +60 -0
  225. package/types/shader/index.d.ts +5 -1
  226. package/types/shader/state/index.d.ts +6 -0
  227. package/types/shaderlib/particle/index.d.ts +14 -0
  228. package/types/shadow/CascadedShadowCasterPass.d.ts +1 -1
  229. package/types/shadow/PipelinePass.d.ts +16 -0
  230. package/types/sky/Sky.d.ts +12 -4
  231. package/types/sky/SkyBoxMaterial.d.ts +27 -9
  232. package/types/sky/SkyProceduralMaterial.d.ts +72 -0
  233. package/types/sky/index.d.ts +1 -0
  234. package/types/texture/RenderTarget.d.ts +2 -6
  235. package/types/texture/Texture.d.ts +8 -6
  236. package/types/texture/Texture2D.d.ts +3 -1
  237. package/types/texture/enums/TextureUsage.d.ts +9 -0
  238. package/types/texture/index.d.ts +1 -0
  239. package/types/trail/TrailRenderer.d.ts +0 -5
  240. package/types/utils/BoolUpdateFlag.d.ts +12 -0
  241. package/types/utils/DisorderedArray.d.ts +18 -0
  242. package/types/utils/SafeLoopArray.d.ts +41 -0
  243. package/types/utils/UpdateFlag.d.ts +20 -0
  244. package/types/utils/UpdateFlagManager.d.ts +1 -0
  245. package/types/utils/Utils.d.ts +31 -0
  246. package/types/xr/XRManager.d.ts +31 -0
  247. package/types/xr/component/XRPoseDriver.d.ts +10 -0
  248. package/types/xr/data/XRCamera.d.ts +6 -0
  249. package/types/xr/data/XRDevice.d.ts +9 -0
  250. package/types/xr/data/XRHandle.d.ts +10 -0
  251. package/types/xr/enum/EnumXRButton.d.ts +5 -0
  252. package/types/xr/enum/EnumXRDevicePhase.d.ts +4 -0
  253. package/types/xr/enum/EnumXRFeature.d.ts +9 -0
  254. package/types/xr/enum/EnumXRInputSource.d.ts +8 -0
  255. package/types/xr/enum/EnumXRMode.d.ts +7 -0
  256. package/types/xr/enum/EnumXRSubsystem.d.ts +4 -0
  257. package/types/xr/enum/EnumXRTrackingMode.d.ts +7 -0
  258. package/types/xr/feature/XRCameraManager.d.ts +21 -0
  259. package/types/xr/feature/XRFeature.d.ts +29 -0
  260. package/types/xr/feature/XRImageTrackManager.d.ts +10 -0
  261. package/types/xr/feature/XRInputManager.d.ts +16 -0
  262. package/types/xr/index.d.ts +18 -0
  263. package/types/xr/provider/XRProvider.d.ts +19 -0
  264. package/types/xr/subsystem/XRInputSubsystem.d.ts +5 -0
  265. package/types/xr/subsystem/XRSubsystem.d.ts +30 -0
@@ -24,6 +24,9 @@ export declare class Transform extends Component {
24
24
  private _lossyWorldScale;
25
25
  private _localMatrix;
26
26
  private _worldMatrix;
27
+ private _worldForward;
28
+ private _worldRight;
29
+ private _worldUp;
27
30
  private _isParentDirty;
28
31
  private _parentTransformCache;
29
32
  private _dirtyFlag;
@@ -135,23 +138,17 @@ export declare class Transform extends Component {
135
138
  */
136
139
  setWorldRotationQuaternion(x: number, y: number, z: number, w: number): void;
137
140
  /**
138
- * Get the forward direction in world space.
139
- * @param forward - Forward vector
140
- * @returns Forward vector
141
+ * The forward direction in world space.
141
142
  */
142
- getWorldForward(forward: Vector3): Vector3;
143
+ get worldForward(): Vector3;
143
144
  /**
144
- * Get the right direction in world space.
145
- * @param right - Right vector
146
- * @returns Right vector
145
+ * The right direction in world space.
147
146
  */
148
- getWorldRight(right: Vector3): Vector3;
147
+ get worldRight(): Vector3;
149
148
  /**
150
- * Get the up direction in world space.
151
- * @param up - Up vector
152
- * @returns Up vector
149
+ * The up direction in world space.
153
150
  */
154
- getWorldUp(up: Vector3): Vector3;
151
+ get worldUp(): Vector3;
155
152
  /**
156
153
  * Translate in the direction and distance of the translation.
157
154
  * @param translation - Direction and distance of translation
@@ -198,6 +195,7 @@ export declare class Transform extends Component {
198
195
  * @returns Change flag
199
196
  */
200
197
  registerWorldChangeFlag(): BoolUpdateFlag;
198
+ protected _onDestroy(): void;
201
199
  /**
202
200
  * Get worldMatrix: Will trigger the worldMatrix update of itself and all parent entities.
203
201
  * Get worldPosition: Will trigger the worldMatrix, local position update of itself and the worldMatrix update of all parent entities.
package/types/Utils.d.ts CHANGED
@@ -1,3 +1,31 @@
1
1
  export declare class Utils {
2
+ /**
3
+ * Fast remove an element from array.
4
+ * @param array - Array
5
+ * @param item - Element
6
+ */
7
+ static removeFromArray(array: any[], item: any): boolean;
8
+ /**
9
+ * Decodes a given Uint8Array into a string.
10
+ */
11
+ static decodeText(array: Uint8Array): string;
12
+ /**
13
+ * Judge whether the url is absolute url.
14
+ * @param url - The url to be judged.
15
+ * @returns Whether the url is absolute url.
16
+ */
17
+ static isAbsoluteUrl(url: string): boolean;
18
+ /**
19
+ * Get the values of an object.
20
+ */
21
+ static objectValues(obj: any): any[];
22
+ /**
23
+ * Convert a relative URL to an absolute URL based on a given base URL.
24
+ * @param baseUrl - The base url.
25
+ * @param relativeUrl - The relative url.
26
+ * @returns The resolved url.
27
+ */
28
+ static resolveAbsoluteUrl(baseUrl: string, relativeUrl: string): string;
2
29
  private static _stringToPath;
30
+ private static _formatRelativePath;
3
31
  }
@@ -1,3 +1,4 @@
1
+ import { EngineObject } from "../base/EngineObject";
1
2
  import { Component } from "../Component";
2
3
  import { Entity } from "../Entity";
3
4
  import { AnimationClipCurveBinding } from "./AnimationClipCurveBinding";
@@ -7,7 +8,7 @@ import { KeyframeValueType } from "./Keyframe";
7
8
  /**
8
9
  * Stores keyframe based animations.
9
10
  */
10
- export declare class AnimationClip {
11
+ export declare class AnimationClip extends EngineObject {
11
12
  readonly name: string;
12
13
  private _length;
13
14
  private _events;
@@ -13,9 +13,9 @@ export declare class Animator extends Component {
13
13
  speed: number;
14
14
  protected _animatorController: AnimatorController;
15
15
  protected _controllerUpdateFlag: BoolUpdateFlag;
16
+ protected _updateMark: number;
16
17
  private _animatorLayersData;
17
- private _crossOwnerCollection;
18
- private _animationCurveOwners;
18
+ private _curveOwnerPool;
19
19
  private _animationEventHandlerPool;
20
20
  private _tempAnimatorStateInfo;
21
21
  private _controlledRenderers;
@@ -56,12 +56,11 @@ export declare class Animator extends Component {
56
56
  */
57
57
  findAnimatorState(stateName: string, layerIndex?: number): AnimatorState;
58
58
  private _getAnimatorStateInfo;
59
- private _saveDefaultValues;
60
59
  private _getAnimatorStateData;
61
60
  private _saveAnimatorStateData;
62
61
  private _saveAnimatorEventHandlers;
63
62
  private _clearCrossData;
64
- private _addCrossCurveData;
63
+ private _addCrossOwner;
65
64
  private _prepareCrossFading;
66
65
  private _prepareStandbyCrossFading;
67
66
  private _prepareFixedPoseCrossFading;
@@ -72,9 +71,12 @@ export declare class Animator extends Component {
72
71
  private _updatePlayingState;
73
72
  private _updateCrossFade;
74
73
  private _updateCrossFadeFromPose;
74
+ private _updateFinishedState;
75
75
  private _updateCrossFadeData;
76
76
  private _preparePlay;
77
77
  private _checkTransition;
78
+ private _checkSubTransition;
79
+ private _checkBackwardsSubTransition;
78
80
  private _crossFadeByTransition;
79
81
  private _fireAnimationEvents;
80
82
  private _fireSubAnimationEvents;
@@ -83,4 +85,5 @@ export declare class Animator extends Component {
83
85
  private _callAnimatorScriptOnUpdate;
84
86
  private _callAnimatorScriptOnExit;
85
87
  private _checkAutoPlay;
88
+ private _checkRevertOwner;
86
89
  }
@@ -6,7 +6,6 @@ import { AnimationCurve } from "./AnimationCurve";
6
6
  export declare class AnimationFloatArrayCurve extends AnimationCurve<Float32Array> {
7
7
  /**
8
8
  * @inheritdoc
9
- * @override
10
9
  */
11
10
  addKey(key: Keyframe<Float32Array>): void;
12
11
  }
@@ -0,0 +1,8 @@
1
+ import { Rect } from "@galacean/engine-math";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRectCurve extends AnimationCurve<Rect> {
7
+ constructor();
8
+ }
@@ -0,0 +1,8 @@
1
+ import { ReferResource } from "../../asset/ReferResource";
2
+ import { AnimationCurve } from "./AnimationCurve";
3
+ /**
4
+ * Store a collection of Keyframes that can be evaluated over time.
5
+ */
6
+ export declare class AnimationRefCurve extends AnimationCurve<ReferResource> {
7
+ constructor();
8
+ }
@@ -9,5 +9,7 @@ export declare enum LayerState {
9
9
  /** CrossFading state. */
10
10
  CrossFading = 2,
11
11
  /** FixedCrossFading state. */
12
- FixedCrossFading = 3
12
+ FixedCrossFading = 3,
13
+ /** Finished state. */
14
+ Finished = 4
13
15
  }
@@ -6,47 +6,47 @@ export declare enum AssetType {
6
6
  * Plain text.
7
7
  * @remarks Will not be cached based on url in ResourceManager.
8
8
  */
9
- Text = "text",
9
+ Text = "Text",
10
10
  /**
11
11
  * JSON.
12
12
  * @remarks Will not be cached based on url in ResourceManager.
13
13
  */
14
- JSON = "json",
14
+ JSON = "JSON",
15
15
  /**
16
16
  * ArrayBuffer.
17
17
  * @remarks Will not be cached based on url in ResourceManager.
18
18
  */
19
- Buffer = "buffer",
19
+ Buffer = "Buffer",
20
20
  /** 2D Texture. */
21
- Texture2D = "texture2d",
21
+ Texture2D = "Texture2D",
22
22
  /** Cube Texture. */
23
- TextureCube = "texture-cube",
23
+ TextureCube = "TextureCube",
24
24
  /** Material. */
25
- Material = "material",
25
+ Material = "Material",
26
26
  /** Mesh. */
27
- Mesh = "mesh",
27
+ Mesh = "Mesh",
28
28
  /** AnimationClip. */
29
29
  AnimationClip = "AnimationClip",
30
30
  /** AnimatorController. */
31
31
  AnimatorController = "AnimatorController",
32
32
  /** Prefab.*/
33
- Prefab = "prefab",
33
+ GLTF = "GLTF",
34
34
  /** Compress Texture. */
35
- KTX = "ktx",
35
+ KTX = "KTX",
36
36
  /** Cube Compress Texture. */
37
- KTXCube = "ktx-cube",
37
+ KTXCube = "KTXCube",
38
38
  /** Sprite. */
39
- Sprite = "sprite",
39
+ Sprite = "Sprite",
40
40
  /** Sprite Atlas. */
41
- SpriteAtlas = "sprite-atlas",
41
+ SpriteAtlas = "SpriteAtlas",
42
42
  /** Ambient light. */
43
- Env = "environment",
43
+ Env = "Environment",
44
44
  /** Scene. */
45
- Scene = "scene",
45
+ Scene = "Scene",
46
46
  /** HDR to cube. */
47
47
  HDR = "HDR",
48
48
  /** Font. */
49
- Font = "font",
49
+ Font = "Font",
50
50
  /** Source Font, include ttf、 otf and woff. */
51
- SourceFont = "source-font"
51
+ SourceFont = "SourceFont"
52
52
  }
@@ -0,0 +1,17 @@
1
+ import { EngineObject } from "../base";
2
+ import { AssetPromise } from "./AssetPromise";
3
+ /**
4
+ * ContentRestorer is a base class for all content restore info classes.
5
+ */
6
+ export declare abstract class ContentRestorer<T extends EngineObject> {
7
+ resource: T;
8
+ /**
9
+ * @param resource - The resource object of the content restorer
10
+ */
11
+ constructor(resource: T);
12
+ /**
13
+ * Restore the content of the resource.
14
+ * @returns The promise of the restored content if the content is restored asynchronously, otherwise returns undefined
15
+ */
16
+ abstract restoreContent(): AssetPromise<T> | void;
17
+ }
@@ -0,0 +1,5 @@
1
+ import { Engine } from "../Engine";
2
+ import { ReferResource } from "./ReferResource";
3
+ export declare abstract class GraphicsResource extends ReferResource {
4
+ protected constructor(engine: Engine);
5
+ }
@@ -0,0 +1,2 @@
1
+ export interface IReferable {
2
+ }
@@ -1,15 +1,12 @@
1
+ type PickOnlyOne<T extends {}, Keys extends keyof T = keyof T> = Keys extends unknown ? {
2
+ [K in Keys]: T[Keys];
3
+ } & {
4
+ [K in Exclude<keyof T, Keys>]?: never;
5
+ } : never;
1
6
  /**
2
7
  * Used to describe loading asset.
3
8
  */
4
9
  export type LoadItem = {
5
- /**
6
- * Loading url.
7
- */
8
- url?: string;
9
- /**
10
- * Available when AssetType is TextureCube.
11
- */
12
- urls?: string[];
13
10
  /**
14
11
  * Asset Type.
15
12
  */
@@ -30,4 +27,14 @@ export type LoadItem = {
30
27
  * Additional parameters for specified loader.
31
28
  */
32
29
  params?: Record<string, any>;
33
- };
30
+ } & PickOnlyOne<{
31
+ /**
32
+ * Loading url.
33
+ */
34
+ url: string;
35
+ /**
36
+ * Available when AssetType is TextureCube.
37
+ */
38
+ urls: string[];
39
+ }>;
40
+ export {};
@@ -0,0 +1,22 @@
1
+ import { EngineObject } from "../base/EngineObject";
2
+ import { Engine } from "../Engine";
3
+ import { IReferable } from "./IReferable";
4
+ /**
5
+ * The base class of assets, with reference counting capability.
6
+ */
7
+ export declare abstract class ReferResource extends EngineObject implements IReferable {
8
+ /** Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc(). */
9
+ isGCIgnored: boolean;
10
+ private _refCount;
11
+ /**
12
+ * Counted by valid references.
13
+ */
14
+ get refCount(): number;
15
+ protected constructor(engine: Engine);
16
+ /**
17
+ * Destroy self.
18
+ * @param force - Whether to force the destruction, if it is false, refCount = 0 can be released successfully.
19
+ * @returns Whether the release was successful.
20
+ */
21
+ destroy(force?: boolean): boolean;
22
+ }
@@ -1,4 +1,4 @@
1
- import { Engine } from "..";
1
+ import { ContentRestorer, Engine, EngineObject } from "..";
2
2
  import { AssetPromise } from "./AssetPromise";
3
3
  import { Loader } from "./Loader";
4
4
  import { LoadItem } from "./LoadItem";
@@ -17,14 +17,17 @@ export declare class ResourceManager {
17
17
  retryInterval: number;
18
18
  /** The default timeout period for loading assets, in milliseconds. */
19
19
  timeout: number;
20
- /** Asset path pool, key is asset ID, value is asset path */
20
+ private _loadingPromises;
21
+ /** Asset path pool, key is the `instanceID` of resource, value is asset path. */
21
22
  private _assetPool;
22
- /** Asset pool, the key is the asset path and the value is the asset. */
23
+ /** Asset url pool, key is the asset path and the value is the asset. */
23
24
  private _assetUrlPool;
24
- /** Reference counted object pool, key is the object ID, and reference counted objects are put into this pool. */
25
- private _refObjectPool;
26
- /** Loading promises. */
27
- private _loadingPromises;
25
+ /** Referable resource pool, key is the `instanceID` of resource. */
26
+ private _referResourcePool;
27
+ /** Graphic resource pool, key is the `instanceID` of resource. */
28
+ private _graphicResourcePool;
29
+ /** Restorable resource information pool, key is the `instanceID` of resource. */
30
+ private _contentRestorerPool;
28
31
  /**
29
32
  * Create a ResourceManager.
30
33
  * @param engine - Engine to which the current ResourceManager belongs
@@ -85,6 +88,11 @@ export declare class ResourceManager {
85
88
  * @remarks The release principle is that it is not referenced by the components, including direct and indirect reference.
86
89
  */
87
90
  gc(): void;
91
+ /**
92
+ * Add content restorer.
93
+ * @param restorer - The restorer
94
+ */
95
+ addContentRestorer<T extends EngineObject>(restorer: ContentRestorer<T>): void;
88
96
  private _assignDefaultOptions;
89
97
  private _loadSingleItem;
90
98
  private _gc;
@@ -96,6 +104,6 @@ export declare class ResourceManager {
96
104
  /**
97
105
  * Declare ResourceLoader's decorator.
98
106
  * @param assetType - Type of asset
99
- * @param extnames - Name of file extension
107
+ * @param extNames - Name of file extension
100
108
  */
101
- export declare function resourceLoader(assetType: string, extnames: string[], useCache?: boolean): <T extends Loader<any>>(Target: new (useCache: boolean) => T) => void;
109
+ export declare function resourceLoader(assetType: string, extNames: string[], useCache?: boolean): <T extends Loader<any>>(Target: new (useCache: boolean) => T) => void;
@@ -17,9 +17,13 @@ export declare class MultiExecutor {
17
17
  private interval;
18
18
  private _timeoutId;
19
19
  private _currentCount;
20
+ private _onComplete;
21
+ private _onError;
22
+ private _error;
20
23
  constructor(execFunc: (count?: number) => Promise<any>, totalCount: number, interval: number);
21
- private done;
22
- start(done?: Function): void;
23
- stop(): void;
24
+ start(): this;
25
+ onComplete(func: Function): this;
26
+ onError(func: Function): this;
27
+ cancel(): void;
24
28
  private exec;
25
29
  }
@@ -105,6 +105,7 @@ export declare enum GLCapabilityType {
105
105
  pvrtc = "WEBGL_compressed_texture_pvrtc",
106
106
  pvrtc_webkit = "WEBKIT_WEBGL_compressed_texture_pvrtc",
107
107
  s3tc = "WEBGL_compressed_texture_s3tc",
108
- s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc"
108
+ s3tc_webkit = "WEBKIT_WEBGL_compressed_texture_s3tc",
109
+ WEBGL_lose_context = "WEBGL_lose_context"
109
110
  }
110
111
  export type TypedArray = Int8Array | Uint8Array | Int16Array | Uint16Array | Int32Array | Uint32Array | Uint8ClampedArray | Float32Array | Float64Array;
@@ -21,4 +21,5 @@ export declare abstract class EngineObject {
21
21
  * Destroy self.
22
22
  */
23
23
  destroy(): void;
24
+ protected _onDestroy(): void;
24
25
  }
@@ -1,11 +1,10 @@
1
- import { Event } from "./Event";
2
1
  /**
3
2
  * EventDispatcher, which can be inherited as a base class.
4
3
  */
5
4
  export declare class EventDispatcher {
5
+ private static _dispatchingListenersPool;
6
6
  private _events;
7
7
  private _eventCount;
8
- private _dispatchingListeners;
9
8
  /**
10
9
  * Determine whether there is event listening.
11
10
  * @param event - Event name
@@ -44,15 +43,6 @@ export declare class EventDispatcher {
44
43
  * @returns This
45
44
  */
46
45
  once(event: string, fn: Function): EventDispatcher;
47
- /**
48
- * @deprecated Use `on/once` instead.
49
- * Add a listener function with the specified event name.
50
- * @param event - Event name
51
- * @param fn - Function
52
- * @param once - Is it a one-time listener
53
- * @returns this
54
- */
55
- addEventListener(event: string, fn: Function, once?: boolean): EventDispatcher;
56
46
  /**
57
47
  * Remove the event listener(s) of the specified event name.
58
48
  * @param event - Event name
@@ -71,9 +61,6 @@ export declare class EventDispatcher {
71
61
  * @param event - Event name, delete all events if not passed
72
62
  */
73
63
  removeAllEventListeners(event?: string): void;
74
- /**
75
- * @deprecated Use `dispatch` instead.
76
- */
77
- trigger(e: Event): void;
64
+ private _addEventListener;
78
65
  private _clearEvent;
79
66
  }
@@ -1,41 +1,44 @@
1
1
  /**
2
- * Tools for calculating the time per frame.
2
+ * Provide time related information.
3
3
  */
4
4
  export declare class Time {
5
- private _clock;
6
- private _timeScale;
5
+ private static _elapsedTimeProperty;
6
+ private static _deltaTimeProperty;
7
+ private _frameCount;
7
8
  private _deltaTime;
8
- private _startTime;
9
- private _lastTickTime;
9
+ private _actualDeltaTime;
10
+ private _elapsedTime;
11
+ private _actualElapsedTime;
12
+ private _lastSystemTime;
13
+ private _elapsedTimeValue;
14
+ private _deltaTimeValue;
15
+ /** Maximum delta time allowed per frame in seconds. */
16
+ maximumDeltaTime: number;
17
+ /** The scale of time. */
18
+ timeScale: number;
10
19
  get frameCount(): number;
11
20
  /**
12
- * Constructor of the Time.
13
- */
14
- constructor();
15
- reset(): void;
16
- /**
17
- * Current Time
18
- */
19
- get nowTime(): number;
20
- /**
21
- * Time between two ticks
21
+ * The delta time in seconds from the last frame to the current frame.
22
+ *
23
+ * @remarks When the frame rate is low or stutter occurs, `deltaTime` will not exceed the value of `maximumDeltaTime` * `timeScale`.
22
24
  */
23
25
  get deltaTime(): number;
24
26
  /**
25
- * Scaled delta time.
27
+ * The amount of elapsed time in seconds since the start of the engine.
26
28
  */
27
- get timeScale(): number;
28
- set timeScale(s: number);
29
+ get elapsedTime(): number;
29
30
  /**
30
- * Unscaled delta time.
31
+ * The actual delta time in seconds from the last frame to the current frame.
32
+ *
33
+ * @remarks The actual delta time is not affected by `maximumDeltaTime` and `timeScale`.
31
34
  */
32
- get unscaledDeltaTime(): number;
35
+ get actualDeltaTime(): number;
33
36
  /**
34
- * The elapsed time, after the clock is initialized.
37
+ * The amount of actual elapsed time in seconds since the start of the engine.
35
38
  */
36
- get timeSinceStartup(): number;
39
+ get actualElapsedTime(): number;
37
40
  /**
38
- * Call every frame, update delta time and other data.
41
+ * Constructor of the Time.
39
42
  */
40
- tick(): void;
43
+ constructor();
41
44
  }
@@ -1,7 +1,5 @@
1
- export { Event } from "./Event";
2
1
  export { EventDispatcher } from "./EventDispatcher";
3
2
  export { Logger } from "./Logger";
4
3
  export { Time } from "./Time";
5
- export { Util, ObjectValues } from "./Util";
6
4
  export { EngineObject } from "./EngineObject";
7
5
  export * from "./Constant";
@@ -0,0 +1,6 @@
1
+ export declare enum ActiveChangeFlag {
2
+ None = 0,
3
+ Scene = 1,
4
+ Hierarchy = 2,
5
+ All = 3
6
+ }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Depth texture mode.
3
+ */
4
+ export declare enum DepthTextureMode {
5
+ None = 0,
6
+ PrePass = 1
7
+ }
@@ -9,15 +9,8 @@ export declare class CubeProbe extends Probe {
9
9
  * The position of the probe can be set, the default is the origin [0,0,0].
10
10
  */
11
11
  position: Vector3;
12
- /**
13
- * @override
14
- */
15
- protected readonly _isCube: boolean;
16
12
  private oriViewMatrix;
17
13
  private _oriFieldOfView;
18
- /**
19
- * @override
20
- */
21
14
  onBeginRender(camera: Camera): void;
22
15
  /**
23
16
  * Store original camera parameters.
@@ -46,13 +46,7 @@ export declare abstract class Probe extends Script {
46
46
  * @remarks Prevent issue: Feedback Loops Between Textures and the Framebuffer.
47
47
  */
48
48
  onTextureChange(renderColorTexture: Texture): void;
49
- /**
50
- * @override
51
- */
52
49
  onBeginRender(camera: Camera): void;
53
- /**
54
- * @override
55
- */
56
50
  onEndRender(camera: Camera): void;
57
51
  protected _reset(): void;
58
52
  }
@@ -1,4 +1,4 @@
1
- import { RefObject } from "../asset/RefObject";
1
+ import { GraphicsResource } from "../asset/GraphicsResource";
2
2
  import { Engine } from "../Engine";
3
3
  import { BufferBindFlag } from "./enums/BufferBindFlag";
4
4
  import { BufferUsage } from "./enums/BufferUsage";
@@ -6,14 +6,11 @@ import { SetDataOptions } from "./enums/SetDataOptions";
6
6
  /**
7
7
  * Buffer.
8
8
  */
9
- export declare class Buffer extends RefObject {
10
- _glBindTarget: number;
11
- _glBufferUsage: number;
12
- _nativeBuffer: WebGLBuffer;
13
- private _hardwareRenderer;
9
+ export declare class Buffer extends GraphicsResource {
14
10
  private _type;
15
11
  private _byteLength;
16
12
  private _bufferUsage;
13
+ private _platformBuffer;
17
14
  /**
18
15
  * Buffer binding flag.
19
16
  */
@@ -93,13 +90,9 @@ export declare class Buffer extends RefObject {
93
90
  * @param dataLength - Output data length
94
91
  */
95
92
  getData(data: ArrayBufferView, bufferByteOffset: number, dataOffset: number, dataLength: number): void;
96
- /**
97
- * @override
98
- * Destroy.
99
- */
100
- _onDestroy(): void;
93
+ _rebuild(): void;
101
94
  /**
102
95
  * @deprecated
103
96
  */
104
- resize(dataLength: number): void;
97
+ resize(byteLength: number): void;
105
98
  }