@p100-web/core 100.1.27 → 100.2.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.
- package/dist/GameContext.d.ts +60 -42
- package/dist/GameContext.d.ts.map +1 -1
- package/dist/GameContext.js +219 -127
- package/dist/GameContext.js.map +1 -1
- package/dist/IDBApp.d.ts +21 -0
- package/dist/IDBApp.d.ts.map +1 -0
- package/dist/IDBApp.js +2 -0
- package/dist/IDBApp.js.map +1 -0
- package/dist/IDBEvent.d.ts +10 -0
- package/dist/IDBEvent.d.ts.map +1 -0
- package/dist/IDBEvent.js +2 -0
- package/dist/IDBEvent.js.map +1 -0
- package/dist/IDBFileUsage.d.ts +9 -0
- package/dist/IDBFileUsage.d.ts.map +1 -0
- package/dist/IDBFileUsage.js +2 -0
- package/dist/IDBFileUsage.js.map +1 -0
- package/dist/IDBItem.d.ts +9 -0
- package/dist/IDBItem.d.ts.map +1 -0
- package/dist/IDBItem.js +2 -0
- package/dist/IDBItem.js.map +1 -0
- package/dist/IDBNode.d.ts +21 -0
- package/dist/IDBNode.d.ts.map +1 -0
- package/dist/IDBNode.js +42 -0
- package/dist/IDBNode.js.map +1 -0
- package/dist/IDBScene.d.ts +7 -0
- package/dist/IDBScene.d.ts.map +1 -0
- package/dist/IDBScene.js +2 -0
- package/dist/IDBScene.js.map +1 -0
- package/dist/IDBVariable.d.ts +10 -0
- package/dist/IDBVariable.d.ts.map +1 -0
- package/dist/IDBVariable.js +2 -0
- package/dist/IDBVariable.js.map +1 -0
- package/dist/PCanvas.d.ts +1 -1
- package/dist/PCanvas.d.ts.map +1 -1
- package/dist/PCanvas.js +7 -7
- package/dist/PCanvas.js.map +1 -1
- package/dist/PComponent.d.ts +31 -8
- package/dist/PComponent.d.ts.map +1 -1
- package/dist/PComponent.js +86 -7
- package/dist/PComponent.js.map +1 -1
- package/dist/PEnums.d.ts +7 -15
- package/dist/PEnums.d.ts.map +1 -1
- package/dist/PEnums.js +24 -17
- package/dist/PEnums.js.map +1 -1
- package/dist/PEvent.d.ts +9 -15
- package/dist/PEvent.d.ts.map +1 -1
- package/dist/PEvent.js +18 -23
- package/dist/PEvent.js.map +1 -1
- package/dist/PFileSlot.d.ts +14 -0
- package/dist/PFileSlot.d.ts.map +1 -0
- package/dist/PFileSlot.js +14 -0
- package/dist/PFileSlot.js.map +1 -0
- package/dist/PFileUsage.d.ts +11 -0
- package/dist/PFileUsage.d.ts.map +1 -0
- package/dist/PFileUsage.js +24 -0
- package/dist/PFileUsage.js.map +1 -0
- package/dist/PItem.d.ts +14 -0
- package/dist/PItem.d.ts.map +1 -0
- package/dist/PItem.js +36 -0
- package/dist/PItem.js.map +1 -0
- package/dist/PNode.d.ts +9 -28
- package/dist/PNode.d.ts.map +1 -1
- package/dist/PNode.js +61 -185
- package/dist/PNode.js.map +1 -1
- package/dist/PScene.d.ts +8 -0
- package/dist/PScene.d.ts.map +1 -0
- package/dist/PScene.js +12 -0
- package/dist/PScene.js.map +1 -0
- package/dist/PTypes.d.ts +15 -1
- package/dist/PTypes.d.ts.map +1 -1
- package/dist/PVariable.d.ts +14 -15
- package/dist/PVariable.d.ts.map +1 -1
- package/dist/PVariable.js +26 -28
- package/dist/PVariable.js.map +1 -1
- package/dist/index.d.ts +27 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -19
- package/dist/index.js.map +1 -1
- package/dist/media/IDBFile.d.ts +18 -0
- package/dist/media/IDBFile.d.ts.map +1 -0
- package/dist/media/IDBFile.js +2 -0
- package/dist/media/IDBFile.js.map +1 -0
- package/dist/media/PFile.d.ts +5 -5
- package/dist/media/PFile.d.ts.map +1 -1
- package/dist/media/PFile.js +16 -10
- package/dist/media/PFile.js.map +1 -1
- package/dist/pcomponents/BaseMaterial.d.ts +5 -6
- package/dist/pcomponents/BaseMaterial.d.ts.map +1 -1
- package/dist/pcomponents/BaseMaterial.js +3 -6
- package/dist/pcomponents/BaseMaterial.js.map +1 -1
- package/dist/pcomponents/PAnimator.d.ts +16 -14
- package/dist/pcomponents/PAnimator.d.ts.map +1 -1
- package/dist/pcomponents/PAnimator.js +21 -20
- package/dist/pcomponents/PAnimator.js.map +1 -1
- package/dist/pcomponents/PBackground.d.ts +4 -4
- package/dist/pcomponents/PBackground.d.ts.map +1 -1
- package/dist/pcomponents/PBackground.js +2 -5
- package/dist/pcomponents/PBackground.js.map +1 -1
- package/dist/pcomponents/PBasicMaterial.d.ts +3 -3
- package/dist/pcomponents/PBasicMaterial.d.ts.map +1 -1
- package/dist/pcomponents/PBasicMaterial.js +4 -5
- package/dist/pcomponents/PBasicMaterial.js.map +1 -1
- package/dist/pcomponents/PCallAction.d.ts +10 -5
- package/dist/pcomponents/PCallAction.d.ts.map +1 -1
- package/dist/pcomponents/PCallAction.js +20 -9
- package/dist/pcomponents/PCallAction.js.map +1 -1
- package/dist/pcomponents/PCameraPosition.d.ts +10 -9
- package/dist/pcomponents/PCameraPosition.d.ts.map +1 -1
- package/dist/pcomponents/PCameraPosition.js +15 -16
- package/dist/pcomponents/PCameraPosition.js.map +1 -1
- package/dist/pcomponents/PCameraTarget.d.ts +10 -9
- package/dist/pcomponents/PCameraTarget.d.ts.map +1 -1
- package/dist/pcomponents/PCameraTarget.js +15 -16
- package/dist/pcomponents/PCameraTarget.js.map +1 -1
- package/dist/pcomponents/PCollider.d.ts +7 -7
- package/dist/pcomponents/PCollider.d.ts.map +1 -1
- package/dist/pcomponents/PCollider.js +13 -14
- package/dist/pcomponents/PCollider.js.map +1 -1
- package/dist/pcomponents/PCompare.d.ts +32 -0
- package/dist/pcomponents/PCompare.d.ts.map +1 -0
- package/dist/pcomponents/PCompare.js +73 -0
- package/dist/pcomponents/PCompare.js.map +1 -0
- package/dist/pcomponents/PControllerInput.d.ts +9 -9
- package/dist/pcomponents/PControllerInput.d.ts.map +1 -1
- package/dist/pcomponents/PControllerInput.js +13 -14
- package/dist/pcomponents/PControllerInput.js.map +1 -1
- package/dist/pcomponents/PCubeGeometry.js +1 -1
- package/dist/pcomponents/PCubeGeometry.js.map +1 -1
- package/dist/pcomponents/PDebug.d.ts +7 -11
- package/dist/pcomponents/PDebug.d.ts.map +1 -1
- package/dist/pcomponents/PDebug.js +13 -17
- package/dist/pcomponents/PDebug.js.map +1 -1
- package/dist/pcomponents/PEnvironment.js +1 -1
- package/dist/pcomponents/PEnvironment.js.map +1 -1
- package/dist/pcomponents/PFadeAnimation.d.ts +10 -9
- package/dist/pcomponents/PFadeAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PFadeAnimation.js +15 -16
- package/dist/pcomponents/PFadeAnimation.js.map +1 -1
- package/dist/pcomponents/PHud.js +1 -1
- package/dist/pcomponents/PHud.js.map +1 -1
- package/dist/pcomponents/PImageCache.d.ts +2 -4
- package/dist/pcomponents/PImageCache.d.ts.map +1 -1
- package/dist/pcomponents/PImageCache.js +9 -23
- package/dist/pcomponents/PImageCache.js.map +1 -1
- package/dist/pcomponents/PImageDetector.d.ts +5 -7
- package/dist/pcomponents/PImageDetector.d.ts.map +1 -1
- package/dist/pcomponents/PImageDetector.js +5 -12
- package/dist/pcomponents/PImageDetector.js.map +1 -1
- package/dist/pcomponents/PInteger.d.ts +18 -16
- package/dist/pcomponents/PInteger.d.ts.map +1 -1
- package/dist/pcomponents/PInteger.js +29 -31
- package/dist/pcomponents/PInteger.js.map +1 -1
- package/dist/pcomponents/PIntegerAnimator.d.ts +10 -9
- package/dist/pcomponents/PIntegerAnimator.d.ts.map +1 -1
- package/dist/pcomponents/PIntegerAnimator.js +17 -18
- package/dist/pcomponents/PIntegerAnimator.js.map +1 -1
- package/dist/pcomponents/PLight.js +1 -1
- package/dist/pcomponents/PLight.js.map +1 -1
- package/dist/pcomponents/PLightDirectional.js +1 -1
- package/dist/pcomponents/PLightDirectional.js.map +1 -1
- package/dist/pcomponents/PMaskedMaterial.js +1 -1
- package/dist/pcomponents/PMaskedMaterial.js.map +1 -1
- package/dist/pcomponents/PMaterialModifier.d.ts +9 -9
- package/dist/pcomponents/PMaterialModifier.d.ts.map +1 -1
- package/dist/pcomponents/PMaterialModifier.js +13 -14
- package/dist/pcomponents/PMaterialModifier.js.map +1 -1
- package/dist/pcomponents/PModelAnnotation.d.ts +12 -11
- package/dist/pcomponents/PModelAnnotation.d.ts.map +1 -1
- package/dist/pcomponents/PModelAnnotation.js +19 -20
- package/dist/pcomponents/PModelAnnotation.js.map +1 -1
- package/dist/pcomponents/PModelAnnotations.d.ts +12 -11
- package/dist/pcomponents/PModelAnnotations.d.ts.map +1 -1
- package/dist/pcomponents/PModelAnnotations.js +19 -20
- package/dist/pcomponents/PModelAnnotations.js.map +1 -1
- package/dist/pcomponents/PModelGLTF.d.ts +7 -9
- package/dist/pcomponents/PModelGLTF.d.ts.map +1 -1
- package/dist/pcomponents/PModelGLTF.js +9 -15
- package/dist/pcomponents/PModelGLTF.js.map +1 -1
- package/dist/pcomponents/PModelNode.js +1 -1
- package/dist/pcomponents/PModelNode.js.map +1 -1
- package/dist/pcomponents/PMoveAnimation.d.ts +3 -3
- package/dist/pcomponents/PMoveAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PMoveAnimation.js +4 -5
- package/dist/pcomponents/PMoveAnimation.js.map +1 -1
- package/dist/pcomponents/PMoveToAnimation.d.ts +5 -5
- package/dist/pcomponents/PMoveToAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PMoveToAnimation.js +7 -8
- package/dist/pcomponents/PMoveToAnimation.js.map +1 -1
- package/dist/pcomponents/PNumberAnimator.d.ts +14 -13
- package/dist/pcomponents/PNumberAnimator.d.ts.map +1 -1
- package/dist/pcomponents/PNumberAnimator.js +25 -26
- package/dist/pcomponents/PNumberAnimator.js.map +1 -1
- package/dist/pcomponents/PPhysicalMaterial.d.ts +3 -3
- package/dist/pcomponents/PPhysicalMaterial.d.ts.map +1 -1
- package/dist/pcomponents/PPhysicalMaterial.js +4 -5
- package/dist/pcomponents/PPhysicalMaterial.js.map +1 -1
- package/dist/pcomponents/PPlaneDetector.d.ts +3 -3
- package/dist/pcomponents/PPlaneDetector.d.ts.map +1 -1
- package/dist/pcomponents/PPlaneDetector.js +4 -5
- package/dist/pcomponents/PPlaneDetector.js.map +1 -1
- package/dist/pcomponents/PPlaneGeometry.js +1 -1
- package/dist/pcomponents/PPlaneGeometry.js.map +1 -1
- package/dist/pcomponents/PProjectRoot.d.ts +20 -19
- package/dist/pcomponents/PProjectRoot.d.ts.map +1 -1
- package/dist/pcomponents/PProjectRoot.js +30 -31
- package/dist/pcomponents/PProjectRoot.js.map +1 -1
- package/dist/pcomponents/PRotateAnimation.d.ts +8 -7
- package/dist/pcomponents/PRotateAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PRotateAnimation.js +11 -12
- package/dist/pcomponents/PRotateAnimation.js.map +1 -1
- package/dist/pcomponents/PScaleAnimation.d.ts +5 -5
- package/dist/pcomponents/PScaleAnimation.d.ts.map +1 -1
- package/dist/pcomponents/PScaleAnimation.js +7 -8
- package/dist/pcomponents/PScaleAnimation.js.map +1 -1
- package/dist/pcomponents/PSceneContainer.d.ts +8 -7
- package/dist/pcomponents/PSceneContainer.d.ts.map +1 -1
- package/dist/pcomponents/PSceneContainer.js +15 -19
- package/dist/pcomponents/PSceneContainer.js.map +1 -1
- package/dist/pcomponents/PSceneRoot.d.ts +3 -3
- package/dist/pcomponents/PSceneRoot.d.ts.map +1 -1
- package/dist/pcomponents/PSceneRoot.js +4 -5
- package/dist/pcomponents/PSceneRoot.js.map +1 -1
- package/dist/pcomponents/PSlider.d.ts +9 -9
- package/dist/pcomponents/PSlider.d.ts.map +1 -1
- package/dist/pcomponents/PSlider.js +15 -16
- package/dist/pcomponents/PSlider.js.map +1 -1
- package/dist/pcomponents/PSound.d.ts +12 -13
- package/dist/pcomponents/PSound.d.ts.map +1 -1
- package/dist/pcomponents/PSound.js +14 -20
- package/dist/pcomponents/PSound.js.map +1 -1
- package/dist/pcomponents/PSphereGeometry.js +1 -1
- package/dist/pcomponents/PSphereGeometry.js.map +1 -1
- package/dist/pcomponents/PSprite.d.ts +2 -4
- package/dist/pcomponents/PSprite.d.ts.map +1 -1
- package/dist/pcomponents/PSprite.js +2 -8
- package/dist/pcomponents/PSprite.js.map +1 -1
- package/dist/pcomponents/PSpriteSheet.d.ts +6 -5
- package/dist/pcomponents/PSpriteSheet.d.ts.map +1 -1
- package/dist/pcomponents/PSpriteSheet.js +7 -8
- package/dist/pcomponents/PSpriteSheet.js.map +1 -1
- package/dist/pcomponents/PText.d.ts +8 -9
- package/dist/pcomponents/PText.d.ts.map +1 -1
- package/dist/pcomponents/PText.js +8 -14
- package/dist/pcomponents/PText.js.map +1 -1
- package/dist/pcomponents/PTransform.js +1 -1
- package/dist/pcomponents/PTransform.js.map +1 -1
- package/dist/pcomponents/PVarList.d.ts +21 -14
- package/dist/pcomponents/PVarList.d.ts.map +1 -1
- package/dist/pcomponents/PVarList.js +45 -29
- package/dist/pcomponents/PVarList.js.map +1 -1
- package/dist/pcomponents/PVideoPlayer.d.ts +10 -9
- package/dist/pcomponents/PVideoPlayer.d.ts.map +1 -1
- package/dist/pcomponents/PVideoPlayer.js +15 -16
- package/dist/pcomponents/PVideoPlayer.js.map +1 -1
- package/dist/pcomponents/PVisibility.d.ts +20 -18
- package/dist/pcomponents/PVisibility.d.ts.map +1 -1
- package/dist/pcomponents/PVisibility.js +32 -32
- package/dist/pcomponents/PVisibility.js.map +1 -1
- package/dist/pcomponents/PXRTools.d.ts +13 -13
- package/dist/pcomponents/PXRTools.d.ts.map +1 -1
- package/dist/pcomponents/PXRTools.js +19 -20
- package/dist/pcomponents/PXRTools.js.map +1 -1
- package/dist/ports/IDBInValue.d.ts +6 -0
- package/dist/ports/IDBInValue.d.ts.map +1 -0
- package/dist/ports/IDBInValue.js +2 -0
- package/dist/ports/IDBInValue.js.map +1 -0
- package/dist/ports/IDBLink.d.ts +17 -0
- package/dist/ports/IDBLink.d.ts.map +1 -0
- package/dist/ports/IDBLink.js +2 -0
- package/dist/ports/IDBLink.js.map +1 -0
- package/dist/ports/IDBPayloadValue.d.ts +5 -0
- package/dist/ports/IDBPayloadValue.d.ts.map +1 -0
- package/dist/ports/IDBPayloadValue.js +2 -0
- package/dist/ports/IDBPayloadValue.js.map +1 -0
- package/dist/ports/IValue.d.ts +10 -0
- package/dist/ports/IValue.d.ts.map +1 -0
- package/dist/ports/IValue.js +2 -0
- package/dist/ports/IValue.js.map +1 -0
- package/dist/ports/PInEventPort.d.ts +16 -0
- package/dist/ports/PInEventPort.d.ts.map +1 -0
- package/dist/ports/PInEventPort.js +22 -0
- package/dist/ports/PInEventPort.js.map +1 -0
- package/dist/ports/PInValue.d.ts +17 -0
- package/dist/ports/PInValue.d.ts.map +1 -0
- package/dist/ports/PInValue.js +31 -0
- package/dist/ports/PInValue.js.map +1 -0
- package/dist/ports/PInValuePort.d.ts +18 -0
- package/dist/ports/PInValuePort.d.ts.map +1 -0
- package/dist/ports/PInValuePort.js +49 -0
- package/dist/ports/PInValuePort.js.map +1 -0
- package/dist/ports/PLink.d.ts +23 -0
- package/dist/ports/PLink.d.ts.map +1 -0
- package/dist/ports/PLink.js +50 -0
- package/dist/ports/PLink.js.map +1 -0
- package/dist/ports/POutEventPort.d.ts +20 -0
- package/dist/ports/POutEventPort.d.ts.map +1 -0
- package/dist/ports/POutEventPort.js +65 -0
- package/dist/ports/POutEventPort.js.map +1 -0
- package/dist/ports/POutValuePort.d.ts +13 -0
- package/dist/ports/POutValuePort.d.ts.map +1 -0
- package/dist/ports/POutValuePort.js +21 -0
- package/dist/ports/POutValuePort.js.map +1 -0
- package/dist/ports/PPayloadValue.d.ts +16 -0
- package/dist/ports/PPayloadValue.d.ts.map +1 -0
- package/dist/ports/PPayloadValue.js +28 -0
- package/dist/ports/PPayloadValue.js.map +1 -0
- package/dist/ports/PPort.d.ts +21 -0
- package/dist/ports/PPort.d.ts.map +1 -0
- package/dist/ports/PPort.js +25 -0
- package/dist/ports/PPort.js.map +1 -0
- package/package.json +1 -1
- package/dist/DBEvent.d.ts +0 -22
- package/dist/DBEvent.d.ts.map +0 -1
- package/dist/DBEvent.js +0 -19
- package/dist/DBEvent.js.map +0 -1
- package/dist/DBNode.d.ts +0 -35
- package/dist/DBNode.d.ts.map +0 -1
- package/dist/DBNode.js +0 -33
- package/dist/DBNode.js.map +0 -1
- package/dist/DBScene.d.ts +0 -11
- package/dist/DBScene.d.ts.map +0 -1
- package/dist/DBScene.js +0 -9
- package/dist/DBScene.js.map +0 -1
- package/dist/DBVariable.d.ts +0 -22
- package/dist/DBVariable.d.ts.map +0 -1
- package/dist/DBVariable.js +0 -19
- package/dist/DBVariable.js.map +0 -1
- package/dist/PAction.d.ts +0 -77
- package/dist/PAction.d.ts.map +0 -1
- package/dist/PAction.js +0 -242
- package/dist/PAction.js.map +0 -1
- package/dist/POutValue.d.ts +0 -18
- package/dist/POutValue.d.ts.map +0 -1
- package/dist/POutValue.js +0 -28
- package/dist/POutValue.js.map +0 -1
- package/dist/media/MediaManager.d.ts +0 -17
- package/dist/media/MediaManager.d.ts.map +0 -1
- package/dist/media/MediaManager.js +0 -19
- package/dist/media/MediaManager.js.map +0 -1
- package/dist/pcomponents/PCallActions.d.ts +0 -24
- package/dist/pcomponents/PCallActions.d.ts.map +0 -1
- package/dist/pcomponents/PCallActions.js +0 -37
- package/dist/pcomponents/PCallActions.js.map +0 -1
- package/dist/pcomponents/PCompareBoolean.d.ts +0 -23
- package/dist/pcomponents/PCompareBoolean.d.ts.map +0 -1
- package/dist/pcomponents/PCompareBoolean.js +0 -38
- package/dist/pcomponents/PCompareBoolean.js.map +0 -1
- package/dist/pcomponents/PCompareInteger.d.ts +0 -32
- package/dist/pcomponents/PCompareInteger.d.ts.map +0 -1
- package/dist/pcomponents/PCompareInteger.js +0 -82
- package/dist/pcomponents/PCompareInteger.js.map +0 -1
- package/dist/pcomponents/PCompareNumber.d.ts +0 -25
- package/dist/pcomponents/PCompareNumber.d.ts.map +0 -1
- package/dist/pcomponents/PCompareNumber.js +0 -44
- package/dist/pcomponents/PCompareNumber.js.map +0 -1
- package/dist/pcomponents/PCompareString.d.ts +0 -25
- package/dist/pcomponents/PCompareString.d.ts.map +0 -1
- package/dist/pcomponents/PCompareString.js +0 -42
- package/dist/pcomponents/PCompareString.js.map +0 -1
- package/dist/pcomponents/PCompareVariable.d.ts +0 -28
- package/dist/pcomponents/PCompareVariable.d.ts.map +0 -1
- package/dist/pcomponents/PCompareVariable.js +0 -50
- package/dist/pcomponents/PCompareVariable.js.map +0 -1
- package/dist/pcomponents/PVarReader.d.ts +0 -19
- package/dist/pcomponents/PVarReader.d.ts.map +0 -1
- package/dist/pcomponents/PVarReader.js +0 -25
- package/dist/pcomponents/PVarReader.js.map +0 -1
- package/dist/pcomponents/PVarWriter.d.ts +0 -25
- package/dist/pcomponents/PVarWriter.d.ts.map +0 -1
- package/dist/pcomponents/PVarWriter.js +0 -45
- package/dist/pcomponents/PVarWriter.js.map +0 -1
package/dist/GameContext.d.ts
CHANGED
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { IDBEvent } from "./IDBEvent";
|
|
2
|
+
import { IDBNode } from "./IDBNode";
|
|
3
|
+
import { IDBVariable } from "./IDBVariable";
|
|
4
4
|
import PCanvas from "./PCanvas";
|
|
5
5
|
import { type IPNodeRenderer } from "./IPNodeRenderer";
|
|
6
6
|
import { type IEngine } from "./IEngine";
|
|
7
|
-
import { type IMediaManager } from "./media/MediaManager";
|
|
8
7
|
import PFile from "./media/PFile";
|
|
9
|
-
import { POutAction } from "./PAction";
|
|
10
8
|
import PComponent from "./PComponent";
|
|
11
|
-
import { Platform, Language, Coordinates } from "./PEnums";
|
|
9
|
+
import { Platform, Language, Coordinates, PortTypes } from "./PEnums";
|
|
12
10
|
import PEvent from "./PEvent";
|
|
13
11
|
import PNode from "./PNode";
|
|
14
12
|
import { PVariable } from "./PVariable";
|
|
@@ -17,7 +15,17 @@ import { type ICameraControls } from "./ICameraControls";
|
|
|
17
15
|
import { Tween } from "@tweenjs/tween.js";
|
|
18
16
|
import { type ICameraSettings } from "./settings/ICameraSettings";
|
|
19
17
|
import AssetLoader from "./assets/AssetLoader";
|
|
20
|
-
import
|
|
18
|
+
import PLink from "./ports/PLink";
|
|
19
|
+
import POutEventPort from "./ports/POutEventPort";
|
|
20
|
+
import POutValuePort from "./ports/POutValuePort";
|
|
21
|
+
import PFileUsage from "./PFileUsage";
|
|
22
|
+
import { IDBFileUsage } from "./IDBFileUsage";
|
|
23
|
+
import PFileSlot from "./PFileSlot";
|
|
24
|
+
import { IDBFile } from "./media/IDBFile";
|
|
25
|
+
import PInEventPort from "./ports/PInEventPort";
|
|
26
|
+
import { IValue } from "./ports/IValue";
|
|
27
|
+
import PScene from "./PScene";
|
|
28
|
+
import { IDBScene } from "./IDBScene";
|
|
21
29
|
declare enum Workers {
|
|
22
30
|
None = 0,
|
|
23
31
|
System = 1,
|
|
@@ -46,7 +54,6 @@ interface IGameContextOwner {
|
|
|
46
54
|
export { type IGameContextOwner };
|
|
47
55
|
export default class GameContext {
|
|
48
56
|
protected _owner: IGameContextOwner;
|
|
49
|
-
protected _mediaManager: IMediaManager;
|
|
50
57
|
protected _root: PNode | null;
|
|
51
58
|
protected _pcanvas: PCanvas | null;
|
|
52
59
|
protected _running: boolean;
|
|
@@ -59,9 +66,10 @@ export default class GameContext {
|
|
|
59
66
|
debug_fastVideo: boolean;
|
|
60
67
|
isAdmin(): boolean;
|
|
61
68
|
s3Url: string;
|
|
62
|
-
constructor(owner: IGameContextOwner, platform: Platform
|
|
69
|
+
constructor(owner: IGameContextOwner, platform: Platform);
|
|
63
70
|
setEngine(engine: IEngine | null): void;
|
|
64
71
|
getOwner(): IGameContextOwner;
|
|
72
|
+
pid(): number;
|
|
65
73
|
getIEngine(): IEngine;
|
|
66
74
|
getEngine<T>(): T;
|
|
67
75
|
getNodeRenderer(): IPNodeRenderer;
|
|
@@ -106,46 +114,58 @@ export default class GameContext {
|
|
|
106
114
|
* Render a single frame if sleeping
|
|
107
115
|
*/
|
|
108
116
|
snooze(): void;
|
|
109
|
-
protected _events: {
|
|
110
|
-
[field: string]: PEvent;
|
|
111
|
-
};
|
|
112
|
-
registerEvent: (dbEvent: DBEvent) => PEvent;
|
|
113
|
-
getEvents(): {
|
|
114
|
-
[field: string]: PEvent;
|
|
115
|
-
};
|
|
116
|
-
unregisterEvent: (dbEvent: DBEvent) => PEvent;
|
|
117
|
-
getEvent(id: string): PEvent | null;
|
|
118
|
-
getExternalEvent(name: string): PEvent | null;
|
|
119
117
|
onClick: (node: PNode | null, ctrl: boolean, shift: boolean) => void;
|
|
120
118
|
onHoverEnter: (node: PNode) => void;
|
|
121
119
|
onHoverExit: (node: PNode) => void;
|
|
122
|
-
protected
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
120
|
+
protected _events: PEvent[];
|
|
121
|
+
registerEvent(dbEvent: IDBEvent): PEvent;
|
|
122
|
+
getEvents(): PEvent[];
|
|
123
|
+
getEvent(id: string): PEvent | null;
|
|
124
|
+
getEventByPid(pid: number): PEvent | null;
|
|
125
|
+
getExternalEvent(name: string): PEvent | null;
|
|
126
|
+
protected _variables: PVariable[];
|
|
127
|
+
registerVariable(dbVariable: IDBVariable): PVariable;
|
|
128
|
+
getVariables(): PVariable[];
|
|
129
|
+
getVariableByPid(pid: number): PVariable | null;
|
|
130
130
|
getVariable(id: string): PVariable | null;
|
|
131
|
+
protected _pfiles: PFile[];
|
|
132
|
+
registerFile(dbItem: IDBFile): PFile;
|
|
133
|
+
protected _fileUsages: PFileUsage[];
|
|
134
|
+
registerFileUsage(dbItem: IDBFileUsage): PFileUsage;
|
|
135
|
+
findFileUsage(nodePid: number, componentPid: number, slot: number): PFileUsage | null;
|
|
136
|
+
findFile(id: string): PFile | null;
|
|
137
|
+
/**
|
|
138
|
+
* Called when a component slot changes value. Used in admin.
|
|
139
|
+
*/
|
|
140
|
+
setFileSlot(_fileSlot: PFileSlot, _id: string | null): PFile | null;
|
|
141
|
+
linkPorts(links: PLink[]): void;
|
|
131
142
|
createComponents(pnode: PNode, components: any[]): PComponent[];
|
|
132
143
|
protected _nodes: PNode[];
|
|
133
|
-
createPNodeTree(dbItem:
|
|
134
|
-
|
|
144
|
+
protected createPNodeTree(dbItem: IDBNode, dbNodes: IDBNode[], parent?: PNode): PNode;
|
|
145
|
+
/**
|
|
146
|
+
* [CREATE NODES]
|
|
147
|
+
* Create root node. For project or new nodes
|
|
148
|
+
*/
|
|
149
|
+
createRootNode(dbRoot: IDBNode, dbNodes: IDBNode[]): PNode;
|
|
135
150
|
findNode(id: string): PNode | null;
|
|
136
|
-
|
|
137
|
-
findNodeOutValue(id: string, value: string): POutValue | null;
|
|
151
|
+
findNodeByPid(pid: number): PNode | null;
|
|
138
152
|
rerenderNode(_node: PNode): void;
|
|
139
153
|
editor_render(): void;
|
|
140
154
|
getRoot(): PNode | null;
|
|
141
155
|
setRoot(root: PNode): void;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
156
|
+
findInEventPort(portType: PortTypes, pid: number, component: number, portId: number): PInEventPort | null;
|
|
157
|
+
findOutEventPort(portType: PortTypes, pid: number, component: number, portId: number): POutEventPort | null;
|
|
158
|
+
findOutValuePort(link: IValue): POutValuePort | null;
|
|
159
|
+
protected _loadedScenePids: number[];
|
|
160
|
+
protected _scenes: PScene[];
|
|
161
|
+
registerScene: (dbScene: IDBScene) => PScene;
|
|
162
|
+
getScene(pid: number): PScene | null;
|
|
163
|
+
isSceneLoaded(scenePid: number): boolean;
|
|
164
|
+
getSceneRoot(pid: number): PNode | null;
|
|
165
|
+
loadScene(scenePid: number, loader: PNode, loadAssets: boolean, onLoadedEvent?: POutEventPort | null): Promise<void>;
|
|
166
|
+
__unloadScene(pscene: PScene, root: PNode): void;
|
|
167
|
+
unloadScene(pscene: PScene): void;
|
|
168
|
+
unloadSceneNode(root: PNode): void;
|
|
149
169
|
private _mask;
|
|
150
170
|
mask: () => number;
|
|
151
171
|
/**
|
|
@@ -160,10 +180,10 @@ export default class GameContext {
|
|
|
160
180
|
getEngineCoordinates(): Coordinates;
|
|
161
181
|
getCoordinates(): Coordinates;
|
|
162
182
|
isInverted(): boolean;
|
|
163
|
-
|
|
183
|
+
protected _platform: Platform;
|
|
164
184
|
setPlatform(platform: Platform): void;
|
|
165
185
|
platform(): Platform;
|
|
166
|
-
|
|
186
|
+
protected _language: Language;
|
|
167
187
|
setLanguage(language: Language): void;
|
|
168
188
|
language(): Language;
|
|
169
189
|
isRunning(): boolean;
|
|
@@ -175,8 +195,6 @@ export default class GameContext {
|
|
|
175
195
|
enableInput(): void;
|
|
176
196
|
disableInput(): void;
|
|
177
197
|
isInputEnabled(): boolean;
|
|
178
|
-
requestFile(id: string | null, node?: PNode): PFile | null;
|
|
179
|
-
releaseFile(file: PFile): void;
|
|
180
198
|
addTween(tween: Tween): void;
|
|
181
199
|
error(msg: string, details?: any): void;
|
|
182
200
|
catch(error: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GameContext.d.ts","sourceRoot":"","sources":["../src/GameContext.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GameContext.d.ts","sourceRoot":"","sources":["../src/GameContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,MAAM,eAAe,CAAC;AAClC,OAAO,UAAU,MAAM,cAAc,CAAC;AAEtC,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W;IAInC,cAAc,IAAI,WAAW;IAI7B,UAAU;IAQV,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAoB;IAEjD,WAAW,CAAC,QAAQ,EAAE,QAAQ;IAI9B,QAAQ;IAQR,SAAS,CAAC,SAAS,EAAE,QAAQ,CAAoB;IAEjD,WAAW,CAAC,QAAQ,EAAE,QAAQ;IAI9B,QAAQ;IAQR,SAAS;IAQT,wBAAwB,CACtB,cAAc,EAAE,eAAe,GAAG,IAAI,GACrC,eAAe,GAAG,IAAI;IASzB,iBAAiB,IAAI,eAAe,GAAG,IAAI;IAQrC,kBAAkB;IAMxB,gBAAgB;IAQhB,aAAa,UAAS;IAEtB,WAAW,IAAI,IAAI;IAOnB,YAAY,IAAI,IAAI;IAOpB,cAAc,IAAI,OAAO;IAQzB,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI;IAQ5B,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG;IAIhC,KAAK,CAAC,KAAK,EAAE,GAAG;CAGjB"}
|
package/dist/GameContext.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import PFile from "./media/PFile";
|
|
2
|
+
import { Platform, Language, Coordinates, PortTypes } from "./PEnums";
|
|
2
3
|
import PEvent from "./PEvent";
|
|
3
4
|
import PNode from "./PNode";
|
|
4
5
|
import { PVariable } from "./PVariable";
|
|
6
|
+
import PFileUsage from "./PFileUsage";
|
|
7
|
+
import PScene from "./PScene";
|
|
5
8
|
var Workers;
|
|
6
9
|
(function (Workers) {
|
|
7
10
|
Workers[Workers["None"] = 0] = "None";
|
|
@@ -16,7 +19,6 @@ var Workers;
|
|
|
16
19
|
export { Workers };
|
|
17
20
|
export default class GameContext {
|
|
18
21
|
_owner;
|
|
19
|
-
_mediaManager;
|
|
20
22
|
_root = null;
|
|
21
23
|
_pcanvas = null;
|
|
22
24
|
_running = false;
|
|
@@ -31,10 +33,9 @@ export default class GameContext {
|
|
|
31
33
|
return false;
|
|
32
34
|
}
|
|
33
35
|
s3Url = "https://p100-pw.s3.eu-north-1.amazonaws.com/";
|
|
34
|
-
constructor(owner, platform
|
|
36
|
+
constructor(owner, platform) {
|
|
35
37
|
this._owner = owner;
|
|
36
38
|
this._platform = platform;
|
|
37
|
-
this._mediaManager = mediaManager;
|
|
38
39
|
}
|
|
39
40
|
setEngine(engine) {
|
|
40
41
|
this._engine = engine;
|
|
@@ -51,6 +52,13 @@ export default class GameContext {
|
|
|
51
52
|
return this._owner;
|
|
52
53
|
}
|
|
53
54
|
//
|
|
55
|
+
// PID
|
|
56
|
+
//
|
|
57
|
+
pid() {
|
|
58
|
+
console.error("MISSING PID");
|
|
59
|
+
return 0;
|
|
60
|
+
}
|
|
61
|
+
//
|
|
54
62
|
// PRENDERER
|
|
55
63
|
//
|
|
56
64
|
getIEngine() {
|
|
@@ -144,9 +152,11 @@ export default class GameContext {
|
|
|
144
152
|
node.dispose(false);
|
|
145
153
|
}
|
|
146
154
|
this._root = null;
|
|
147
|
-
this._nodes =
|
|
148
|
-
this.
|
|
149
|
-
this.
|
|
155
|
+
this._nodes.length = 0;
|
|
156
|
+
this._events.length = 0;
|
|
157
|
+
this._fileUsages.length = 0;
|
|
158
|
+
this._pfiles.length = 0;
|
|
159
|
+
this._variables.length = 0;
|
|
150
160
|
if (this._audioListener !== null) {
|
|
151
161
|
const audioListener = this._audioListener;
|
|
152
162
|
if (audioListener.dispose) {
|
|
@@ -176,8 +186,6 @@ export default class GameContext {
|
|
|
176
186
|
}
|
|
177
187
|
this._root = null;
|
|
178
188
|
this._nodes = [];
|
|
179
|
-
this._scenes = [];
|
|
180
|
-
this._mediaManager.dispose();
|
|
181
189
|
}
|
|
182
190
|
isLoading() {
|
|
183
191
|
return this.hasMediaQueue();
|
|
@@ -271,45 +279,6 @@ export default class GameContext {
|
|
|
271
279
|
this._pcanvas.snooze();
|
|
272
280
|
}
|
|
273
281
|
//
|
|
274
|
-
// Event System
|
|
275
|
-
//
|
|
276
|
-
_events = {};
|
|
277
|
-
registerEvent = (dbEvent) => {
|
|
278
|
-
const dupe = this._events[dbEvent._id];
|
|
279
|
-
if (dupe) {
|
|
280
|
-
dupe.name = dbEvent.name;
|
|
281
|
-
dupe.dataType = dbEvent.dataType;
|
|
282
|
-
dupe.description = dbEvent.description;
|
|
283
|
-
dupe.external = dbEvent.external;
|
|
284
|
-
}
|
|
285
|
-
else {
|
|
286
|
-
const pevent = new PEvent(dbEvent);
|
|
287
|
-
this._events[dbEvent._id] = pevent;
|
|
288
|
-
}
|
|
289
|
-
this._events = {
|
|
290
|
-
...this._events,
|
|
291
|
-
};
|
|
292
|
-
return this._events[dbEvent._id];
|
|
293
|
-
};
|
|
294
|
-
getEvents() {
|
|
295
|
-
return this._events;
|
|
296
|
-
}
|
|
297
|
-
unregisterEvent = (dbEvent) => {
|
|
298
|
-
const pevent = this._events[dbEvent._id];
|
|
299
|
-
delete this._events[dbEvent._id];
|
|
300
|
-
this._events = {
|
|
301
|
-
...this._events,
|
|
302
|
-
};
|
|
303
|
-
return pevent;
|
|
304
|
-
};
|
|
305
|
-
getEvent(id) {
|
|
306
|
-
return this._events[id] || null;
|
|
307
|
-
}
|
|
308
|
-
getExternalEvent(name) {
|
|
309
|
-
return (Object.values(this._events).find((e) => e.external && e.name === name) ||
|
|
310
|
-
null);
|
|
311
|
-
}
|
|
312
|
-
//
|
|
313
282
|
// NATIVE EVENTS
|
|
314
283
|
//
|
|
315
284
|
onClick = (node, ctrl, shift) => {
|
|
@@ -322,40 +291,97 @@ export default class GameContext {
|
|
|
322
291
|
this._owner?.onHoverExit(node);
|
|
323
292
|
};
|
|
324
293
|
//
|
|
325
|
-
//
|
|
294
|
+
// PEVENTS
|
|
326
295
|
//
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
const
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
return this.
|
|
345
|
-
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
296
|
+
_events = [];
|
|
297
|
+
registerEvent(dbEvent) {
|
|
298
|
+
const pevent = new PEvent(dbEvent);
|
|
299
|
+
this._events.push(pevent);
|
|
300
|
+
return pevent;
|
|
301
|
+
}
|
|
302
|
+
getEvents() {
|
|
303
|
+
return this._events;
|
|
304
|
+
}
|
|
305
|
+
getEvent(id) {
|
|
306
|
+
console.log("dont use getEvent(id: string)");
|
|
307
|
+
return this._events.find((e) => e._id == id) || null;
|
|
308
|
+
}
|
|
309
|
+
getEventByPid(pid) {
|
|
310
|
+
return this._events.find((e) => e.pid === pid) || null;
|
|
311
|
+
}
|
|
312
|
+
getExternalEvent(name) {
|
|
313
|
+
return this._events.find((e) => e.external && e.name === name) || null;
|
|
314
|
+
}
|
|
315
|
+
//
|
|
316
|
+
// PVARIABLES
|
|
317
|
+
//
|
|
318
|
+
_variables = [];
|
|
319
|
+
registerVariable(dbVariable) {
|
|
320
|
+
const pvariable = new PVariable(dbVariable);
|
|
321
|
+
this._variables.push(pvariable);
|
|
352
322
|
return pvariable;
|
|
353
|
-
}
|
|
323
|
+
}
|
|
354
324
|
getVariables() {
|
|
355
325
|
return this._variables;
|
|
356
326
|
}
|
|
327
|
+
getVariableByPid(pid) {
|
|
328
|
+
return this._variables.find((v) => v.pid === pid) || null;
|
|
329
|
+
}
|
|
357
330
|
getVariable(id) {
|
|
358
|
-
|
|
331
|
+
console.error("do not use getVariable(id: string)");
|
|
332
|
+
return this._variables.find((v) => v._id === id) || null;
|
|
333
|
+
}
|
|
334
|
+
//
|
|
335
|
+
// FILES
|
|
336
|
+
//
|
|
337
|
+
// This is overriden by EGameContext
|
|
338
|
+
_pfiles = [];
|
|
339
|
+
// This is overriden by EGameContext
|
|
340
|
+
registerFile(dbItem) {
|
|
341
|
+
const item = new PFile(dbItem);
|
|
342
|
+
this._pfiles.push(item);
|
|
343
|
+
return item;
|
|
344
|
+
}
|
|
345
|
+
//
|
|
346
|
+
// FILE USAGES
|
|
347
|
+
//
|
|
348
|
+
_fileUsages = [];
|
|
349
|
+
registerFileUsage(dbItem) {
|
|
350
|
+
const item = new PFileUsage(dbItem);
|
|
351
|
+
this._fileUsages.push(item);
|
|
352
|
+
return item;
|
|
353
|
+
}
|
|
354
|
+
findFileUsage(nodePid, componentPid, slot) {
|
|
355
|
+
return (this._fileUsages.find((f) => f.node === nodePid && f.component === componentPid && f.slot === slot) || null);
|
|
356
|
+
}
|
|
357
|
+
findFile(id) {
|
|
358
|
+
return this._pfiles.find((f) => f._id === id) || null;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Called when a component slot changes value. Used in admin.
|
|
362
|
+
*/
|
|
363
|
+
setFileSlot(_fileSlot, _id) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
//
|
|
367
|
+
// PLINKS
|
|
368
|
+
//
|
|
369
|
+
linkPorts(links) {
|
|
370
|
+
// Link nodes to their ports
|
|
371
|
+
for (const link of links) {
|
|
372
|
+
const outPort = this.findOutEventPort(link.outPortType, link.outPid, link.outComponentPid, link.outPortId);
|
|
373
|
+
const inPort = this.findInEventPort(link.inPortType, link.inPid, link.inComponentPid, link.inPortId);
|
|
374
|
+
if (!outPort) {
|
|
375
|
+
this.error("[Link Ports] out port not found");
|
|
376
|
+
continue;
|
|
377
|
+
}
|
|
378
|
+
if (!inPort) {
|
|
379
|
+
this.error("[Link Ports] in port not found");
|
|
380
|
+
continue;
|
|
381
|
+
}
|
|
382
|
+
// Link
|
|
383
|
+
outPort.link(this, inPort, link);
|
|
384
|
+
}
|
|
359
385
|
}
|
|
360
386
|
//
|
|
361
387
|
// PCOMPONENTS
|
|
@@ -376,31 +402,27 @@ export default class GameContext {
|
|
|
376
402
|
if (parent) {
|
|
377
403
|
parent.add(pnode);
|
|
378
404
|
}
|
|
379
|
-
const res = dbNodes.filter((n) => n.
|
|
405
|
+
const res = dbNodes.filter((n) => n.parent === dbItem.pid);
|
|
380
406
|
for (const childNode of res) {
|
|
381
407
|
this.createPNodeTree(childNode, dbNodes, pnode);
|
|
382
408
|
}
|
|
383
409
|
return pnode;
|
|
384
410
|
}
|
|
411
|
+
/**
|
|
412
|
+
* [CREATE NODES]
|
|
413
|
+
* Create root node. For project or new nodes
|
|
414
|
+
*/
|
|
385
415
|
createRootNode(dbRoot, dbNodes) {
|
|
386
416
|
// Create root PNode
|
|
387
417
|
const root = this.createPNodeTree(dbRoot, dbNodes);
|
|
418
|
+
root.traverse((n) => n.linkPorts());
|
|
388
419
|
return root;
|
|
389
420
|
}
|
|
390
421
|
findNode(id) {
|
|
391
|
-
return this._nodes.find((n) => n.
|
|
392
|
-
}
|
|
393
|
-
findNodeInAction(id, action) {
|
|
394
|
-
const node = this._nodes.find((n) => n.id === id) || null;
|
|
395
|
-
if (!node)
|
|
396
|
-
return null;
|
|
397
|
-
return node.getLocalInAction(action);
|
|
422
|
+
return this._nodes.find((n) => n._id === id) || null;
|
|
398
423
|
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
if (!node)
|
|
402
|
-
return null;
|
|
403
|
-
return node._outValues.find((a) => a.name === value) || null;
|
|
424
|
+
findNodeByPid(pid) {
|
|
425
|
+
return this._nodes.find((n) => n.pid === pid) || null;
|
|
404
426
|
}
|
|
405
427
|
rerenderNode(_node) {
|
|
406
428
|
// Editor
|
|
@@ -413,29 +435,103 @@ export default class GameContext {
|
|
|
413
435
|
this._root = root;
|
|
414
436
|
}
|
|
415
437
|
//
|
|
438
|
+
// PORTS & LINKS
|
|
439
|
+
//
|
|
440
|
+
findInEventPort(portType, pid, component, portId) {
|
|
441
|
+
// Supports only
|
|
442
|
+
if (portType === PortTypes.Event) {
|
|
443
|
+
const pevent = this.getEventByPid(pid);
|
|
444
|
+
if (pevent)
|
|
445
|
+
return pevent.inPort;
|
|
446
|
+
}
|
|
447
|
+
else if (portType === PortTypes.Variable) {
|
|
448
|
+
const pvariable = this.getVariableByPid(pid);
|
|
449
|
+
if (pvariable)
|
|
450
|
+
return pvariable.inPort;
|
|
451
|
+
}
|
|
452
|
+
else if (portType === PortTypes.PNode) {
|
|
453
|
+
const pnode = this.findNodeByPid(pid);
|
|
454
|
+
if (pnode) {
|
|
455
|
+
const pcomponent = pnode.findComponentByPid(component);
|
|
456
|
+
if (pcomponent)
|
|
457
|
+
return (pcomponent.inEventPorts.find((p) => p.portId === portId) || null);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
return null;
|
|
461
|
+
}
|
|
462
|
+
findOutEventPort(portType, pid, component, portId) {
|
|
463
|
+
// Supports only
|
|
464
|
+
if (portType === PortTypes.Event) {
|
|
465
|
+
const pevent = this.getEventByPid(pid);
|
|
466
|
+
if (pevent)
|
|
467
|
+
return pevent.outPort;
|
|
468
|
+
}
|
|
469
|
+
else if (portType === PortTypes.Variable) {
|
|
470
|
+
const pvariable = this.getVariableByPid(pid);
|
|
471
|
+
if (pvariable)
|
|
472
|
+
return pvariable.outPort;
|
|
473
|
+
}
|
|
474
|
+
else if (portType === PortTypes.PNode) {
|
|
475
|
+
const pnode = this.findNodeByPid(pid);
|
|
476
|
+
if (pnode) {
|
|
477
|
+
const pcomponent = pnode.findComponentByPid(component);
|
|
478
|
+
if (pcomponent)
|
|
479
|
+
return (pcomponent.outEventPorts.find((p) => p.portId === portId) || null);
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
return null;
|
|
483
|
+
}
|
|
484
|
+
findOutValuePort(link) {
|
|
485
|
+
// Supports only
|
|
486
|
+
if (link.portType === PortTypes.PNode) {
|
|
487
|
+
const pnode = this.findNodeByPid(link.pid);
|
|
488
|
+
if (pnode) {
|
|
489
|
+
const pcomponent = pnode.findComponentByPid(link.componentPid);
|
|
490
|
+
if (pcomponent) {
|
|
491
|
+
return (pcomponent.outValuePorts.find((v) => v.portId === link.portId) ||
|
|
492
|
+
null);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
else if (link.portType === PortTypes.Variable) {
|
|
497
|
+
const pvariable = this.getVariableByPid(link.pid);
|
|
498
|
+
if (pvariable)
|
|
499
|
+
return pvariable.outValue;
|
|
500
|
+
}
|
|
501
|
+
else {
|
|
502
|
+
console.error("Unsupported valuePortType", link);
|
|
503
|
+
}
|
|
504
|
+
return null;
|
|
505
|
+
}
|
|
506
|
+
//
|
|
416
507
|
// SCENES
|
|
417
508
|
//
|
|
509
|
+
_loadedScenePids = [];
|
|
418
510
|
_scenes = [];
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
511
|
+
registerScene = (dbScene) => {
|
|
512
|
+
const pscene = new PScene(dbScene);
|
|
513
|
+
this._scenes.push(pscene);
|
|
514
|
+
return pscene;
|
|
515
|
+
};
|
|
516
|
+
getScene(pid) {
|
|
517
|
+
return this._scenes.find((s) => s.pid === pid) || null;
|
|
518
|
+
}
|
|
519
|
+
isSceneLoaded(scenePid) {
|
|
520
|
+
return this._loadedScenePids.includes(scenePid);
|
|
521
|
+
}
|
|
522
|
+
getSceneRoot(pid) {
|
|
523
|
+
return (this._nodes.find((s) => s.parentPid === 0 && s.scenePid === pid) || null);
|
|
524
|
+
}
|
|
525
|
+
async loadScene(scenePid, loader, loadAssets, onLoadedEvent = null) {
|
|
526
|
+
const root = this.getSceneRoot(scenePid);
|
|
527
|
+
const pscene = this.getScene(scenePid);
|
|
528
|
+
if (!pscene || !root || !root.scenePid)
|
|
529
|
+
throw new Error("Scene not found");
|
|
530
|
+
if (pscene.isLoaded)
|
|
436
531
|
throw new Error("Scene was already loaded");
|
|
532
|
+
pscene.isLoaded = true;
|
|
437
533
|
this.increaseSceneLoader();
|
|
438
|
-
this.
|
|
534
|
+
this._loadedScenePids.push(root.scenePid);
|
|
439
535
|
loader.add(root);
|
|
440
536
|
root.enable();
|
|
441
537
|
root.update();
|
|
@@ -447,21 +543,32 @@ export default class GameContext {
|
|
|
447
543
|
await this._assetLoader?.loadAsync();
|
|
448
544
|
}
|
|
449
545
|
if (onLoadedEvent !== null)
|
|
450
|
-
onLoadedEvent.emit(root.
|
|
546
|
+
onLoadedEvent.emit(root._id);
|
|
451
547
|
if (this.isRunning()) {
|
|
452
548
|
const pscene = root.findComponent("PSceneRoot");
|
|
453
|
-
pscene.
|
|
549
|
+
pscene.outport_onSceneLoaded?.emit(root._id);
|
|
454
550
|
}
|
|
455
551
|
this.decreaseSceneLoader();
|
|
456
552
|
}
|
|
457
|
-
|
|
553
|
+
__unloadScene(pscene, root) {
|
|
554
|
+
if (!pscene.isLoaded)
|
|
555
|
+
throw new Error("Scene was not loaded");
|
|
556
|
+
pscene.isLoaded = false;
|
|
458
557
|
if (this.isRunning()) {
|
|
459
558
|
root.stop();
|
|
460
559
|
}
|
|
461
|
-
this.
|
|
560
|
+
this._loadedScenePids = this._loadedScenePids.filter((id) => id !== root.scenePid);
|
|
561
|
+
this._owner.onUnloadScene(root);
|
|
462
562
|
root.disable();
|
|
463
563
|
root.removeFromParent();
|
|
464
|
-
|
|
564
|
+
}
|
|
565
|
+
unloadScene(pscene) {
|
|
566
|
+
const root = this.getSceneRoot(pscene.pid);
|
|
567
|
+
this.__unloadScene(pscene, root);
|
|
568
|
+
}
|
|
569
|
+
unloadSceneNode(root) {
|
|
570
|
+
const pscene = this.getScene(root.scenePid);
|
|
571
|
+
this.__unloadScene(pscene, root);
|
|
465
572
|
}
|
|
466
573
|
//
|
|
467
574
|
// LAYERS
|
|
@@ -569,21 +676,6 @@ export default class GameContext {
|
|
|
569
676
|
return this._inputEnabled;
|
|
570
677
|
}
|
|
571
678
|
//
|
|
572
|
-
// Media Manager
|
|
573
|
-
//
|
|
574
|
-
requestFile(id, node) {
|
|
575
|
-
if (!id)
|
|
576
|
-
return null;
|
|
577
|
-
const file = this._mediaManager.requestFile(id);
|
|
578
|
-
if (!file) {
|
|
579
|
-
this.error("File not found: " + id + (node ? ", node: " + node?.name : ""));
|
|
580
|
-
}
|
|
581
|
-
return file;
|
|
582
|
-
}
|
|
583
|
-
releaseFile(file) {
|
|
584
|
-
return this._mediaManager.releaseFile(file);
|
|
585
|
-
}
|
|
586
|
-
//
|
|
587
679
|
// TWEENS
|
|
588
680
|
//
|
|
589
681
|
addTween(tween) {
|