@directivegames/genesys.js 3.1.24
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/README.md +123 -0
- package/assets/animation-profiles/mixamo.skeleton-profile.json +63 -0
- package/assets/animation-profiles/rigify.skeleton-profile.json +61 -0
- package/assets/character/SKM_SB_MediumHuman.glb +0 -0
- package/assets/character/config/AnimationStateMachineComponent.md +107 -0
- package/assets/character/config/mannequin-anim.json +53 -0
- package/assets/character/mannequin.glb +0 -0
- package/assets/character/mannequinG.glb +0 -0
- package/assets/default.genesys-scene +194 -0
- package/assets/models/PickupActors/SM_Pickup_Health.glb +0 -0
- package/assets/models/PickupActors/SM_Pickup_Station.glb +0 -0
- package/assets/models/SM_Capsule.glb +0 -0
- package/assets/models/SM_ChamferCube.glb +0 -0
- package/assets/models/SM_Cone.glb +0 -0
- package/assets/models/SM_Cube.glb +0 -0
- package/assets/models/SM_Cylinder.glb +0 -0
- package/assets/models/SM_Plane.glb +0 -0
- package/assets/models/SM_Pyramid.glb +0 -0
- package/assets/models/SM_Sphere.glb +0 -0
- package/assets/models/SM_Torus.glb +0 -0
- package/assets/models/SM_Wedge.glb +0 -0
- package/assets/models/Weapons/SM_ShotGun_01.glb +0 -0
- package/assets/models/demo/Characters/Knightdude.glb +0 -0
- package/assets/models/demo/Characters/Spacedude.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Bush01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Bush02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Flower03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_GeneratedLandscape.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Grass03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Mushroom01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Mushroom02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_MushroomCluster01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_MushroomCluster02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Rock04.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree01.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree02.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree03.glb +0 -0
- package/assets/models/demo/LowPoly/SM_Tree04.glb +0 -0
- package/assets/models/demo/LowPoly/SM_TreeStump.glb +0 -0
- package/assets/models/demo/LowPoly/SM_TreeTrunk.glb +0 -0
- package/assets/models/demo/LowPoly/low_poly_ship_wreck.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Dirt.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Grass02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Grass02Patch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Gravel.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Lava.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_LavaStone.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Sand.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Stone.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_StoneA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_StoneC.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Wall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Blocks/SM_SB_Block_Water.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_Arachnids_Large_Spider.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Adventurer_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Adventurer_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aviator_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aviator_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aztec_F01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Aztec_M01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_MediumHuman.glb +0 -0
- package/assets/models/demo/SandboxAsset/Characters/SKM_SB_Shaman.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Cloud_04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_05.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_06.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_Env_Cloud_07.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_SmallCloud01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Clouds/SM_SB_SmallCloud_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_AztecStatue.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_Broken_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Claypot_Broken_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Calendar_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Calendar_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Crystal_Skull.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Goldpile_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Goldpile_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Rubble_Skeleton_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_TreasureChest.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_TreasureChestSmall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Decorations/SM_SB_Wall_Deco_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_AngledWall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Arch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Beams.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Beams02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Corner.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_CornerB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor2.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Floor3.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_GrowingTree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_HalfFloor.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_IronBucket.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Pillar.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Railing.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_RoofWindow.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Stairs01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Statue.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall03.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall03B.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_Wall04.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_WallB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Dungeon/SM_SB_WallTrim.glb +0 -0
- package/assets/models/demo/SandboxAsset/Floors/SM_SB_Floor_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Floors/SM_SB_Floor_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower01_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower01_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower02_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower02_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower03_ColorA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Flowers/SM_SB_Flower03_ColorB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Beach_Grass.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Birgaradier_Tree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Cactus_Long.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_ElephantEar01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Fern01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_GrassPatch.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Growing_Plant.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Leaf_bush01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Middle_Moss.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Oracle_Tree.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Plant01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_Tree01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Foliage/SM_SB_plant.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Arrow_large_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Arrow_large_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeEnd_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeEnd_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_HangingBridgeMiddle.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_MovingPlatform_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_MovingWall.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_ObsidianTrap.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Scull_Arrowshooter01.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Scull_Arrowshooter02.glb +0 -0
- package/assets/models/demo/SandboxAsset/GameItems/SM_SB_Snakepit.glb +0 -0
- package/assets/models/demo/SandboxAsset/Rocks/SM_SB_Rock01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Rocks/SM_SB_Rock02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Corner_L.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Corner_R.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Edge.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_End01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Slides/SM_SB_Slide_Module.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CaribbeanPine_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CaribbeanPine_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CoconutTree01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_CoconutTree02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_KapokTree_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_KapokTree_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_QueenPalm_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_QueenPalm_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trees/SM_SB_TreeTrunk.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimB.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimC.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimD.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimE.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimF.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimG.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimH.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimI.glb +0 -0
- package/assets/models/demo/SandboxAsset/Trims/SM_SB_TrimJ.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Aztec_Wall_01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Aztec_Wall_02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Brick01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_BrickBlock01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_BrickBlock02.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Vineswall01.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_WallDecoA.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_01B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_01_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02C_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02D_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_02_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_03B_128x96.glb +0 -0
- package/assets/models/demo/SandboxAsset/Walls/SM_SB_Wall_L_03_128x96.glb +0 -0
- package/assets/prefabs/actors/demo_health_pickup.prefab.json +114 -0
- package/assets/prefabs/actors/demo_health_pickup_spawner.prefab.json +102 -0
- package/assets/prefabs/actors/test.prefab.json +87 -0
- package/assets/shaders/M_Anisotropy_Brushed.material.json +89 -0
- package/assets/shaders/M_Anisotropy_Radial.material.json +55 -0
- package/assets/shaders/M_Chrome.material.json +18 -0
- package/assets/shaders/M_Emissive_Blue.material.json +26 -0
- package/assets/shaders/M_Glass_Frosted.material.json +24 -0
- package/assets/shaders/M_Glass_ThinFilm.material.json +23 -0
- package/assets/shaders/M_Glossy_Grey.material.json +20 -0
- package/assets/shaders/M_Matte_White.material.json +20 -0
- package/assets/shaders/M_Metal_Anisotropic_Gold.material.json +31 -0
- package/assets/shaders/M_Metal_Anisotropic_Silver.material.json +31 -0
- package/assets/shaders/M_Metal_Brushed.material.json +61 -0
- package/assets/shaders/M_Paint_Clearcoat.material.json +28 -0
- package/assets/shaders/M_Stone_Mossy.material.json +153 -0
- package/assets/shaders/M_Stone_Mossy_Snow.material.json +151 -0
- package/assets/shaders/M_Toon_Anime.material.json +49 -0
- package/assets/shaders/M_Toon_Anime_5Step.material.json +45 -0
- package/assets/shaders/M_Toon_Cel.material.json +49 -0
- package/assets/shaders/M_Transmission.material.json +42 -0
- package/assets/shaders/M_Velvet_Blue.material.json +33 -0
- package/assets/shaders/M_Velvet_Purple.material.json +30 -0
- package/assets/shaders/M_Velvet_Red.material.json +33 -0
- package/assets/shaders/M_Wax_SSSLite.material.json +55 -0
- package/assets/shaders/matcap/M_Matcap_Blue.material.json +27 -0
- package/assets/shaders/matcap/M_Matcap_Rainbow.material.json +26 -0
- package/assets/shaders/matcap/M_Matcap_White.material.json +28 -0
- package/assets/sounds/birds.mp3 +0 -0
- package/assets/sounds/explosion.mp3 +0 -0
- package/assets/sounds/game-gun-short.mp3 +0 -0
- package/assets/sounds/laser.mp3 +0 -0
- package/assets/sounds/pickup.mp3 +0 -0
- package/assets/sounds/tuba.mp3 +0 -0
- package/assets/textures/Checkerboard.png +0 -0
- package/assets/textures/Grid_10x10.png +0 -0
- package/assets/textures/T_AnisotropyMap_Radial.png +0 -0
- package/assets/textures/T_Anisotropy_Roughness.png +0 -0
- package/assets/textures/T_Gradient.png +0 -0
- package/assets/textures/T_Grid_01.png +0 -0
- package/assets/textures/T_Grid_01.texture.json +7 -0
- package/assets/textures/T_Metal_Brushed_Normal.png +0 -0
- package/assets/textures/T_Normal.png +0 -0
- package/assets/textures/T_Stone_Mossy_AmbientOcclusion.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_BaseColor.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Normal.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Roughness.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_AmbientOcclusion.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_BaseColor.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_Normal.jpg +0 -0
- package/assets/textures/T_Stone_Mossy_Snow_Roughness.jpg +0 -0
- package/assets/textures/T_Toon_Anime_4Step.png +0 -0
- package/assets/textures/T_Toon_Anime_5Step.png +0 -0
- package/assets/textures/T_Toon_Cel_2Step.png +0 -0
- package/assets/textures/T_Wax_Thickness.png +0 -0
- package/assets/textures/matcaps/T_Matcap_Rainbow.png.png +0 -0
- package/assets/textures/matcaps/beige.png +0 -0
- package/assets/textures/matcaps/black.png +0 -0
- package/assets/textures/matcaps/blue.png +0 -0
- package/assets/textures/matcaps/brown.png +0 -0
- package/assets/textures/matcaps/emeraldGreen.png +0 -0
- package/assets/textures/matcaps/gold.png +0 -0
- package/assets/textures/matcaps/gray.png +0 -0
- package/assets/textures/matcaps/green.png +0 -0
- package/assets/textures/matcaps/metal.png +0 -0
- package/assets/textures/matcaps/orange.png +0 -0
- package/assets/textures/matcaps/purple.png +0 -0
- package/assets/textures/matcaps/red.png +0 -0
- package/assets/textures/matcaps/white.png +0 -0
- package/assets/textures/matcaps/yellow.png +0 -0
- package/assets/textures/skybox/citrus_orchard_road_puresky_2k.hdr +0 -0
- package/assets/textures/skybox/venice_sunset_4k.hdr +0 -0
- package/assets/ui/styles/ammo-counter.css +58 -0
- package/assets/ui/styles/compass.css +54 -0
- package/assets/ui/styles/controls-help.css +21 -0
- package/assets/ui/styles/crosshair.css +51 -0
- package/assets/ui/styles/inventory-bar.css +112 -0
- package/assets/ui/styles/inventory-grid.css +257 -0
- package/assets/ui/styles/main-menu.css +59 -0
- package/assets/ui/styles/minimap.css +12 -0
- package/assets/ui/styles/number-display.css +18 -0
- package/assets/ui/styles/progress-bar.css +199 -0
- package/assets/ui/styles/reload-indicator.css +76 -0
- package/assets/ui/templates/ammo-counter.html +7 -0
- package/assets/ui/templates/compass.html +6 -0
- package/assets/ui/templates/controls-help.html +9 -0
- package/assets/ui/templates/crosshair.html +1 -0
- package/assets/ui/templates/inventory-bar.html +38 -0
- package/assets/ui/templates/inventory-grid.html +9 -0
- package/assets/ui/templates/main-menu.html +10 -0
- package/assets/ui/templates/minimap.html +3 -0
- package/assets/ui/templates/number-display.html +3 -0
- package/assets/ui/templates/progress-bar.html +7 -0
- package/assets/ui/templates/reload-indicator.html +13 -0
- package/dist/games/animation-demo.d.ts +21 -0
- package/dist/games/animation-demo.js +398 -0
- package/dist/games/animation-retarget-demo.d.ts +44 -0
- package/dist/games/animation-retarget-demo.js +574 -0
- package/dist/games/behavior-tree-demo.d.ts +100 -0
- package/dist/games/behavior-tree-demo.js +1656 -0
- package/dist/games/character_animation.d.ts +15 -0
- package/dist/games/character_animation.js +170 -0
- package/dist/games/collision-demo.d.ts +4 -0
- package/dist/games/collision-demo.js +134 -0
- package/dist/games/deprecated/advanced-grid-demo.d.ts +18 -0
- package/dist/games/deprecated/advanced-grid-demo.js +305 -0
- package/dist/games/deprecated/airplane-demo.d.ts +10 -0
- package/dist/games/deprecated/airplane-demo.js +136 -0
- package/dist/games/deprecated/character-controller.d.ts +6 -0
- package/dist/games/deprecated/character-controller.js +144 -0
- package/dist/games/deprecated/chase-game.d.ts +17 -0
- package/dist/games/deprecated/chase-game.js +269 -0
- package/dist/games/deprecated/collision-config.d.ts +7 -0
- package/dist/games/deprecated/collision-config.js +295 -0
- package/dist/games/deprecated/door-demo.d.ts +30 -0
- package/dist/games/deprecated/door-demo.js +562 -0
- package/dist/games/deprecated/fps-demo.d.ts +9 -0
- package/dist/games/deprecated/fps-demo.js +119 -0
- package/dist/games/deprecated/fps-shotgun-demo.d.ts +19 -0
- package/dist/games/deprecated/fps-shotgun-demo.js +221 -0
- package/dist/games/deprecated/index.d.ts +25 -0
- package/dist/games/deprecated/index.js +26 -0
- package/dist/games/deprecated/lightmapping-demo.d.ts +135 -0
- package/dist/games/deprecated/lightmapping-demo.js +1344 -0
- package/dist/games/deprecated/lights-demo.d.ts +93 -0
- package/dist/games/deprecated/lights-demo.js +815 -0
- package/dist/games/deprecated/matcap-demo.d.ts +54 -0
- package/dist/games/deprecated/matcap-demo.js +788 -0
- package/dist/games/deprecated/material-demo-2.d.ts +14 -0
- package/dist/games/deprecated/material-demo-2.js +521 -0
- package/dist/games/deprecated/material-demo.d.ts +8 -0
- package/dist/games/deprecated/material-demo.js +177 -0
- package/dist/games/deprecated/memory-leak-test.d.ts +6 -0
- package/dist/games/deprecated/memory-leak-test.js +20 -0
- package/dist/games/deprecated/model-stress-test.d.ts +10 -0
- package/dist/games/deprecated/model-stress-test.js +116 -0
- package/dist/games/deprecated/multiplayer-demo.d.ts +13 -0
- package/dist/games/deprecated/multiplayer-demo.js +377 -0
- package/dist/games/deprecated/physics-demo.d.ts +10 -0
- package/dist/games/deprecated/physics-demo.js +200 -0
- package/dist/games/deprecated/shadow-demo.d.ts +25 -0
- package/dist/games/deprecated/shadow-demo.js +402 -0
- package/dist/games/deprecated/shooting-demo.d.ts +19 -0
- package/dist/games/deprecated/shooting-demo.js +338 -0
- package/dist/games/deprecated/skybox-demo.d.ts +35 -0
- package/dist/games/deprecated/skybox-demo.js +323 -0
- package/dist/games/deprecated/sound-demo.d.ts +11 -0
- package/dist/games/deprecated/sound-demo.js +125 -0
- package/dist/games/deprecated/timer-demo.d.ts +11 -0
- package/dist/games/deprecated/timer-demo.js +150 -0
- package/dist/games/deprecated/voxel-demo.d.ts +5 -0
- package/dist/games/deprecated/voxel-demo.js +41 -0
- package/dist/games/deprecated/world-commands.d.ts +8 -0
- package/dist/games/deprecated/world-commands.js +168 -0
- package/dist/games/deprecated/world-loading.d.ts +6 -0
- package/dist/games/deprecated/world-loading.js +86 -0
- package/dist/games/examples/fps-advanced/const.d.ts +171 -0
- package/dist/games/examples/fps-advanced/const.js +116 -0
- package/dist/games/examples/fps-advanced/enemies.d.ts +21 -0
- package/dist/games/examples/fps-advanced/enemies.js +182 -0
- package/dist/games/examples/fps-advanced/game-mode.d.ts +53 -0
- package/dist/games/examples/fps-advanced/game-mode.js +353 -0
- package/dist/games/examples/fps-advanced/game.d.ts +9 -0
- package/dist/games/examples/fps-advanced/game.js +58 -0
- package/dist/games/examples/fps-advanced/pickups.d.ts +36 -0
- package/dist/games/examples/fps-advanced/pickups.js +225 -0
- package/dist/games/examples/fps-advanced/player.d.ts +12 -0
- package/dist/games/examples/fps-advanced/player.js +110 -0
- package/dist/games/examples/fps-advanced/ui/endgame-ui.d.ts +21 -0
- package/dist/games/examples/fps-advanced/ui/endgame-ui.js +291 -0
- package/dist/games/examples/fps-advanced/ui/game-hud.d.ts +17 -0
- package/dist/games/examples/fps-advanced/ui/game-hud.js +225 -0
- package/dist/games/examples/fps-advanced/ui/menu-ui.d.ts +13 -0
- package/dist/games/examples/fps-advanced/ui/menu-ui.js +224 -0
- package/dist/games/examples/fps-advanced/ui/weapon-hud.d.ts +27 -0
- package/dist/games/examples/fps-advanced/ui/weapon-hud.js +259 -0
- package/dist/games/examples/fps-advanced/weapons.d.ts +14 -0
- package/dist/games/examples/fps-advanced/weapons.js +173 -0
- package/dist/games/examples/index.d.ts +5 -0
- package/dist/games/examples/index.js +6 -0
- package/dist/games/examples/plugin-demo/game.d.ts +7 -0
- package/dist/games/examples/plugin-demo/game.js +168 -0
- package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.d.ts +8 -0
- package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.js +156 -0
- package/dist/games/examples/plugin-demo/plugins/instanced-forest.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/instanced-forest.js +194 -0
- package/dist/games/examples/plugin-demo/plugins/particle-fountain.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/particle-fountain.js +64 -0
- package/dist/games/examples/plugin-demo/plugins/physics-playground.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/physics-playground.js +185 -0
- package/dist/games/examples/plugin-demo/plugins/robot-follower.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/robot-follower.js +347 -0
- package/dist/games/examples/plugin-demo/plugins/scatter-models.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/scatter-models.js +70 -0
- package/dist/games/examples/plugin-demo/plugins/simple-cube.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/simple-cube.js +44 -0
- package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.d.ts +8 -0
- package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.js +526 -0
- package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.d.ts +7 -0
- package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.js +63 -0
- package/dist/games/examples/side-scroller-advanced/const.d.ts +97 -0
- package/dist/games/examples/side-scroller-advanced/const.js +82 -0
- package/dist/games/examples/side-scroller-advanced/game-mode.d.ts +54 -0
- package/dist/games/examples/side-scroller-advanced/game-mode.js +351 -0
- package/dist/games/examples/side-scroller-advanced/game.d.ts +9 -0
- package/dist/games/examples/side-scroller-advanced/game.js +70 -0
- package/dist/games/examples/side-scroller-advanced/level-generator.d.ts +68 -0
- package/dist/games/examples/side-scroller-advanced/level-generator.js +366 -0
- package/dist/games/examples/side-scroller-advanced/pickups.d.ts +18 -0
- package/dist/games/examples/side-scroller-advanced/pickups.js +147 -0
- package/dist/games/examples/side-scroller-advanced/player.d.ts +5 -0
- package/dist/games/examples/side-scroller-advanced/player.js +104 -0
- package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.d.ts +16 -0
- package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.js +290 -0
- package/dist/games/examples/side-scroller-advanced/ui/game-hud.d.ts +21 -0
- package/dist/games/examples/side-scroller-advanced/ui/game-hud.js +265 -0
- package/dist/games/examples/side-scroller-advanced/ui/menu-ui.d.ts +13 -0
- package/dist/games/examples/side-scroller-advanced/ui/menu-ui.js +222 -0
- package/dist/games/examples/vehicle/base-vehicle.d.ts +30 -0
- package/dist/games/examples/vehicle/base-vehicle.js +155 -0
- package/dist/games/examples/vehicle/game.d.ts +11 -0
- package/dist/games/examples/vehicle/game.js +140 -0
- package/dist/games/examples/vehicle/mesh-vehicle.d.ts +19 -0
- package/dist/games/examples/vehicle/mesh-vehicle.js +194 -0
- package/dist/games/examples/vehicle/player.d.ts +9 -0
- package/dist/games/examples/vehicle/player.js +87 -0
- package/dist/games/examples/vehicle/primitive-vehicle.d.ts +21 -0
- package/dist/games/examples/vehicle/primitive-vehicle.js +269 -0
- package/dist/games/examples/vr-game/VRAttachableCube.d.ts +8 -0
- package/dist/games/examples/vr-game/VRAttachableCube.js +41 -0
- package/dist/games/examples/vr-game/VRInteractableCylinder.d.ts +10 -0
- package/dist/games/examples/vr-game/VRInteractableCylinder.js +76 -0
- package/dist/games/examples/vr-game/VRPressableButton.d.ts +24 -0
- package/dist/games/examples/vr-game/VRPressableButton.js +135 -0
- package/dist/games/examples/vr-game/VRProjectileActor.d.ts +19 -0
- package/dist/games/examples/vr-game/VRProjectileActor.js +75 -0
- package/dist/games/examples/vr-game/VRRifleActor.d.ts +16 -0
- package/dist/games/examples/vr-game/VRRifleActor.js +142 -0
- package/dist/games/examples/vr-game/game.d.ts +9 -0
- package/dist/games/examples/vr-game/game.js +56 -0
- package/dist/games/examples/vr-game/index.d.ts +5 -0
- package/dist/games/examples/vr-game/index.js +9 -0
- package/dist/games/examples/vr-game/scene.d.ts +5 -0
- package/dist/games/examples/vr-game/scene.js +83 -0
- package/dist/games/hand-tracking-demo.d.ts +10 -0
- package/dist/games/hand-tracking-demo.js +65 -0
- package/dist/games/index.d.ts +21 -0
- package/dist/games/index.js +22 -0
- package/dist/games/instanced-mesh-demo.d.ts +45 -0
- package/dist/games/instanced-mesh-demo.js +416 -0
- package/dist/games/manifold-demo.d.ts +6 -0
- package/dist/games/manifold-demo.js +44 -0
- package/dist/games/navigation-demo.d.ts +30 -0
- package/dist/games/navigation-demo.js +336 -0
- package/dist/games/navmesh-primitives-demo.d.ts +167 -0
- package/dist/games/navmesh-primitives-demo.js +1105 -0
- package/dist/games/performance-test-demo.d.ts +13 -0
- package/dist/games/performance-test-demo.js +214 -0
- package/dist/games/postprocess-demo.d.ts +46 -0
- package/dist/games/postprocess-demo.js +829 -0
- package/dist/games/ragdoll-demo-simple.d.ts +34 -0
- package/dist/games/ragdoll-demo-simple.js +152 -0
- package/dist/games/ragdoll-demo.d.ts +30 -0
- package/dist/games/ragdoll-demo.js +258 -0
- package/dist/games/swipe-tap-demo.d.ts +24 -0
- package/dist/games/swipe-tap-demo.js +238 -0
- package/dist/games/tween-demo.d.ts +22 -0
- package/dist/games/tween-demo.js +122 -0
- package/dist/games/ui-demo.d.ts +75 -0
- package/dist/games/ui-demo.js +1054 -0
- package/dist/games/vfx-demo.d.ts +48 -0
- package/dist/games/vfx-demo.js +821 -0
- package/dist/games/vfx-wawa-demo.d.ts +7 -0
- package/dist/games/vfx-wawa-demo.js +471 -0
- package/dist/games/vr-ui-demo-minimal.d.ts +15 -0
- package/dist/games/vr-ui-demo-minimal.js +141 -0
- package/dist/games/vr-ui-demo.d.ts +32 -0
- package/dist/games/vr-ui-demo.js +871 -0
- package/dist/genesys.min.mjs +7035 -0
- package/dist/launcher.d.ts +1 -0
- package/dist/launcher.js +778 -0
- package/dist/scripts/build-browser-bundle.d.ts +5 -0
- package/dist/scripts/build-browser-bundle.js +69 -0
- package/dist/scripts/check-asset-path.d.ts +1 -0
- package/dist/scripts/check-asset-path.js +146 -0
- package/dist/scripts/dump-templates.d.ts +1 -0
- package/dist/scripts/dump-templates.js +16 -0
- package/dist/scripts/generate-dependencies.d.ts +1 -0
- package/dist/scripts/generate-dependencies.js +110 -0
- package/dist/scripts/generate-prefabs.d.ts +1 -0
- package/dist/scripts/generate-prefabs.js +106 -0
- package/dist/scripts/load-save-world.d.ts +2 -0
- package/dist/scripts/load-save-world.js +35 -0
- package/dist/scripts/loc.d.ts +1 -0
- package/dist/scripts/loc.js +80 -0
- package/dist/scripts/optimize-glb-wrapper.d.ts +1 -0
- package/dist/scripts/optimize-glb-wrapper.js +26 -0
- package/dist/scripts/optimize-glb.d.ts +41 -0
- package/dist/scripts/optimize-glb.js +296 -0
- package/dist/scripts/session-server.d.ts +117 -0
- package/dist/scripts/session-server.js +782 -0
- package/dist/scripts/test-world-loading.d.ts +14 -0
- package/dist/scripts/test-world-loading.js +19 -0
- package/dist/src/actors/Actor.d.ts +510 -0
- package/dist/src/actors/Actor.js +1180 -0
- package/dist/src/actors/GLTFMeshActor.d.ts +34 -0
- package/dist/src/actors/GLTFMeshActor.js +102 -0
- package/dist/src/actors/GlobalParticleManager.d.ts +154 -0
- package/dist/src/actors/GlobalParticleManager.js +365 -0
- package/dist/src/actors/Pawn.d.ts +191 -0
- package/dist/src/actors/Pawn.js +384 -0
- package/dist/src/actors/PlayerController.d.ts +177 -0
- package/dist/src/actors/PlayerController.js +763 -0
- package/dist/src/actors/PlayerStart.d.ts +8 -0
- package/dist/src/actors/PlayerStart.js +48 -0
- package/dist/src/actors/Projectile.d.ts +50 -0
- package/dist/src/actors/Projectile.js +157 -0
- package/dist/src/actors/RagdollTestActor.d.ts +31 -0
- package/dist/src/actors/RagdollTestActor.js +153 -0
- package/dist/src/actors/ThirdPersonCharacterPawn.d.ts +27 -0
- package/dist/src/actors/ThirdPersonCharacterPawn.js +149 -0
- package/dist/src/actors/index.d.ts +20 -0
- package/dist/src/actors/index.js +21 -0
- package/dist/src/animation/AnimationClipCache.d.ts +41 -0
- package/dist/src/animation/AnimationClipCache.js +97 -0
- package/dist/src/animation/AnimationRetargeting.d.ts +100 -0
- package/dist/src/animation/AnimationRetargeting.js +455 -0
- package/dist/src/animation/SkeletonProfile.d.ts +112 -0
- package/dist/src/animation/SkeletonProfile.js +84 -0
- package/dist/src/animation/index.d.ts +14 -0
- package/dist/src/animation/index.js +15 -0
- package/dist/src/animation/retargeting.d.ts +142 -0
- package/dist/src/animation/retargeting.js +834 -0
- package/dist/src/components/CharacterStatsComponent.d.ts +89 -0
- package/dist/src/components/CharacterStatsComponent.js +207 -0
- package/dist/src/components/CollisionShapeComponent.d.ts +102 -0
- package/dist/src/components/CollisionShapeComponent.js +232 -0
- package/dist/src/components/Component.d.ts +82 -0
- package/dist/src/components/Component.js +2 -0
- package/dist/src/components/FollowComponent.d.ts +67 -0
- package/dist/src/components/FollowComponent.js +128 -0
- package/dist/src/components/PrimitiveComponent.d.ts +183 -0
- package/dist/src/components/PrimitiveComponent.js +368 -0
- package/dist/src/components/ResetPositionComponent.d.ts +52 -0
- package/dist/src/components/ResetPositionComponent.js +161 -0
- package/dist/src/components/SceneComponent.d.ts +225 -0
- package/dist/src/components/SceneComponent.js +621 -0
- package/dist/src/components/audio/SoundComponent.d.ts +109 -0
- package/dist/src/components/audio/SoundComponent.js +353 -0
- package/dist/src/components/audio/index.d.ts +11 -0
- package/dist/src/components/audio/index.js +12 -0
- package/dist/src/components/csg/CSGCombiner.d.ts +87 -0
- package/dist/src/components/csg/CSGCombiner.js +240 -0
- package/dist/src/components/csg/CSGShapes.d.ts +173 -0
- package/dist/src/components/csg/CSGShapes.js +326 -0
- package/dist/src/components/csg/index.d.ts +12 -0
- package/dist/src/components/csg/index.js +13 -0
- package/dist/src/components/gameplay/BaseWeaponComponent.d.ts +175 -0
- package/dist/src/components/gameplay/BaseWeaponComponent.js +496 -0
- package/dist/src/components/gameplay/DoorComponent.d.ts +236 -0
- package/dist/src/components/gameplay/DoorComponent.js +928 -0
- package/dist/src/components/gameplay/Equipment.d.ts +22 -0
- package/dist/src/components/gameplay/Equipment.js +9 -0
- package/dist/src/components/gameplay/GenericEquipment.d.ts +37 -0
- package/dist/src/components/gameplay/GenericEquipment.js +90 -0
- package/dist/src/components/gameplay/InstantHitWeaponComponent.d.ts +96 -0
- package/dist/src/components/gameplay/InstantHitWeaponComponent.js +194 -0
- package/dist/src/components/gameplay/PickupComponent.d.ts +130 -0
- package/dist/src/components/gameplay/PickupComponent.js +429 -0
- package/dist/src/components/gameplay/ProjectileWeaponComponent.d.ts +49 -0
- package/dist/src/components/gameplay/ProjectileWeaponComponent.js +93 -0
- package/dist/src/components/gameplay/ShotgunComponent.d.ts +18 -0
- package/dist/src/components/gameplay/ShotgunComponent.js +216 -0
- package/dist/src/components/gameplay/SwitchComponent.d.ts +152 -0
- package/dist/src/components/gameplay/SwitchComponent.js +481 -0
- package/dist/src/components/gameplay/TriggerZoneComponent.d.ts +157 -0
- package/dist/src/components/gameplay/TriggerZoneComponent.js +312 -0
- package/dist/src/components/gameplay/index.d.ts +20 -0
- package/dist/src/components/gameplay/index.js +21 -0
- package/dist/src/components/index.d.ts +16 -0
- package/dist/src/components/index.js +18 -0
- package/dist/src/components/lights/AmbientLightComponent.d.ts +37 -0
- package/dist/src/components/lights/AmbientLightComponent.js +68 -0
- package/dist/src/components/lights/DirectionalLightComponent.d.ts +77 -0
- package/dist/src/components/lights/DirectionalLightComponent.js +146 -0
- package/dist/src/components/lights/HemisphereLightComponent.d.ts +67 -0
- package/dist/src/components/lights/HemisphereLightComponent.js +121 -0
- package/dist/src/components/lights/LightComponent.d.ts +145 -0
- package/dist/src/components/lights/LightComponent.js +315 -0
- package/dist/src/components/lights/PointLightComponent.d.ts +61 -0
- package/dist/src/components/lights/PointLightComponent.js +103 -0
- package/dist/src/components/lights/RectAreaLightComponent.d.ts +78 -0
- package/dist/src/components/lights/RectAreaLightComponent.js +135 -0
- package/dist/src/components/lights/SpotLightComponent.d.ts +100 -0
- package/dist/src/components/lights/SpotLightComponent.js +167 -0
- package/dist/src/components/lights/index.d.ts +17 -0
- package/dist/src/components/lights/index.js +18 -0
- package/dist/src/components/movement/AerialMovementComponent.d.ts +93 -0
- package/dist/src/components/movement/AerialMovementComponent.js +339 -0
- package/dist/src/components/movement/AirplaneMovementComponent.d.ts +59 -0
- package/dist/src/components/movement/AirplaneMovementComponent.js +215 -0
- package/dist/src/components/movement/BasePawnMovementComponent.d.ts +132 -0
- package/dist/src/components/movement/BasePawnMovementComponent.js +264 -0
- package/dist/src/components/movement/CharacterMovementComponent.d.ts +175 -0
- package/dist/src/components/movement/CharacterMovementComponent.js +448 -0
- package/dist/src/components/movement/DirectionalCharacterMovementComponent.d.ts +17 -0
- package/dist/src/components/movement/DirectionalCharacterMovementComponent.js +82 -0
- package/dist/src/components/movement/NpcMovementComponent.d.ts +232 -0
- package/dist/src/components/movement/NpcMovementComponent.js +890 -0
- package/dist/src/components/movement/PathMovementComponent.d.ts +54 -0
- package/dist/src/components/movement/PathMovementComponent.js +211 -0
- package/dist/src/components/movement/TopDownMovementComponent.d.ts +25 -0
- package/dist/src/components/movement/TopDownMovementComponent.js +79 -0
- package/dist/src/components/movement/TweenMovementComponent.d.ts +59 -0
- package/dist/src/components/movement/TweenMovementComponent.js +362 -0
- package/dist/src/components/movement/VehicleMovementComponent.d.ts +98 -0
- package/dist/src/components/movement/VehicleMovementComponent.js +402 -0
- package/dist/src/components/movement/index.d.ts +19 -0
- package/dist/src/components/movement/index.js +20 -0
- package/dist/src/components/physics/RagdollComponent.d.ts +118 -0
- package/dist/src/components/physics/RagdollComponent.js +671 -0
- package/dist/src/components/visual/AnimationComponent.d.ts +29 -0
- package/dist/src/components/visual/AnimationComponent.js +234 -0
- package/dist/src/components/visual/AnimationStateMachineComponent.d.ts +235 -0
- package/dist/src/components/visual/AnimationStateMachineComponent.js +1048 -0
- package/dist/src/components/visual/BaseInstancedMeshComponent.d.ts +253 -0
- package/dist/src/components/visual/BaseInstancedMeshComponent.js +763 -0
- package/dist/src/components/visual/BillboardComponent.d.ts +26 -0
- package/dist/src/components/visual/BillboardComponent.js +143 -0
- package/dist/src/components/visual/EditorOnlyMeshComponent.d.ts +17 -0
- package/dist/src/components/visual/EditorOnlyMeshComponent.js +53 -0
- package/dist/src/components/visual/FogComponent.d.ts +32 -0
- package/dist/src/components/visual/FogComponent.js +131 -0
- package/dist/src/components/visual/GLTFMeshComponent.d.ts +138 -0
- package/dist/src/components/visual/GLTFMeshComponent.js +411 -0
- package/dist/src/components/visual/InstancedGltfMeshComponent.d.ts +75 -0
- package/dist/src/components/visual/InstancedGltfMeshComponent.js +217 -0
- package/dist/src/components/visual/InstancedMeshComponent.d.ts +57 -0
- package/dist/src/components/visual/InstancedMeshComponent.js +114 -0
- package/dist/src/components/visual/MeshComponent.d.ts +71 -0
- package/dist/src/components/visual/MeshComponent.js +208 -0
- package/dist/src/components/visual/ParticleEmitterComponent.d.ts +145 -0
- package/dist/src/components/visual/ParticleEmitterComponent.js +569 -0
- package/dist/src/components/visual/SkyboxComponent.d.ts +135 -0
- package/dist/src/components/visual/SkyboxComponent.js +342 -0
- package/dist/src/components/visual/TerrainMeshComponent.d.ts +119 -0
- package/dist/src/components/visual/TerrainMeshComponent.js +309 -0
- package/dist/src/components/visual/UI3DComponent.d.ts +60 -0
- package/dist/src/components/visual/UI3DComponent.js +248 -0
- package/dist/src/components/visual/index.d.ts +23 -0
- package/dist/src/components/visual/index.js +24 -0
- package/dist/src/components/voxel/MagicaVoxelLoader.d.ts +18 -0
- package/dist/src/components/voxel/MagicaVoxelLoader.js +151 -0
- package/dist/src/components/voxel/VoxelMeshComponent.d.ts +66 -0
- package/dist/src/components/voxel/VoxelMeshComponent.js +246 -0
- package/dist/src/components/voxel/index.d.ts +2 -0
- package/dist/src/components/voxel/index.js +3 -0
- package/dist/src/const.d.ts +61 -0
- package/dist/src/const.js +62 -0
- package/dist/src/csg/CSGUtils.d.ts +118 -0
- package/dist/src/csg/CSGUtils.js +805 -0
- package/dist/src/csg/ManifoldWrapper.d.ts +172 -0
- package/dist/src/csg/ManifoldWrapper.js +629 -0
- package/dist/src/csg/index.d.ts +13 -0
- package/dist/src/csg/index.js +14 -0
- package/dist/src/dependencies.d.ts +125 -0
- package/dist/src/dependencies.js +72 -0
- package/dist/src/game/GameBuilder.d.ts +104 -0
- package/dist/src/game/GameBuilder.js +263 -0
- package/dist/src/game/GameLoop.d.ts +204 -0
- package/dist/src/game/GameLoop.js +545 -0
- package/dist/src/game/GameMode.d.ts +58 -0
- package/dist/src/game/GameMode.js +131 -0
- package/dist/src/game/Playable.d.ts +38 -0
- package/dist/src/game/Playable.js +83 -0
- package/dist/src/game/World.d.ts +512 -0
- package/dist/src/game/World.js +1467 -0
- package/dist/src/game/index.d.ts +18 -0
- package/dist/src/game/index.js +19 -0
- package/dist/src/index.d.ts +39 -0
- package/dist/src/index.js +40 -0
- package/dist/src/materials.d.ts +49 -0
- package/dist/src/materials.js +177 -0
- package/dist/src/multiplayer/MovementPrediction.d.ts +28 -0
- package/dist/src/multiplayer/MovementPrediction.js +204 -0
- package/dist/src/multiplayer/NetWorld.d.ts +125 -0
- package/dist/src/multiplayer/NetWorld.js +960 -0
- package/dist/src/multiplayer/implementations/MemorySession.d.ts +18 -0
- package/dist/src/multiplayer/implementations/MemorySession.js +112 -0
- package/dist/src/multiplayer/implementations/WebSocketSession.d.ts +134 -0
- package/dist/src/multiplayer/implementations/WebSocketSession.js +439 -0
- package/dist/src/multiplayer/implementations/index.d.ts +14 -0
- package/dist/src/multiplayer/implementations/index.js +15 -0
- package/dist/src/multiplayer/index.d.ts +16 -0
- package/dist/src/multiplayer/index.js +17 -0
- package/dist/src/multiplayer/interface.d.ts +134 -0
- package/dist/src/multiplayer/interface.js +87 -0
- package/dist/src/navigation/NavigationServer.d.ts +134 -0
- package/dist/src/navigation/NavigationServer.js +47 -0
- package/dist/src/navigation/RecastNavigationServer.d.ts +82 -0
- package/dist/src/navigation/RecastNavigationServer.js +325 -0
- package/dist/src/navigation/index.d.ts +16 -0
- package/dist/src/navigation/index.js +17 -0
- package/dist/src/npc/behavior-tree/BehaviorNode.d.ts +95 -0
- package/dist/src/npc/behavior-tree/BehaviorNode.js +177 -0
- package/dist/src/npc/behavior-tree/BehaviorTreeComponent.d.ts +104 -0
- package/dist/src/npc/behavior-tree/BehaviorTreeComponent.js +341 -0
- package/dist/src/npc/behavior-tree/behaviors/BehaviorAction.d.ts +52 -0
- package/dist/src/npc/behavior-tree/behaviors/BehaviorAction.js +70 -0
- package/dist/src/npc/behavior-tree/behaviors/ConditionEvaluator.d.ts +73 -0
- package/dist/src/npc/behavior-tree/behaviors/ConditionEvaluator.js +116 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.d.ts +33 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.js +138 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.d.ts +42 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.js +170 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.d.ts +27 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.js +86 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.d.ts +50 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.js +189 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/aerial/index.js +6 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.d.ts +37 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.js +172 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.d.ts +35 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.js +173 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/index.d.ts +2 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/combat/index.js +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.d.ts +34 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.js +148 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.d.ts +30 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.js +129 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.d.ts +27 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.js +115 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.d.ts +28 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.js +120 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.d.ts +35 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.js +172 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/index.d.ts +5 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/ground/index.js +7 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/index.js +10 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.d.ts +32 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.js +123 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.d.ts +43 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.js +140 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.d.ts +24 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.js +85 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/index.d.ts +3 -0
- package/dist/src/npc/behavior-tree/behaviors/actions/utility/index.js +5 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.d.ts +40 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.js +133 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.d.ts +29 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.js +167 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.d.ts +19 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.js +67 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.d.ts +25 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.js +94 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.d.ts +15 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.js +51 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.d.ts +19 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.js +66 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.d.ts +26 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.js +111 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.d.ts +24 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.js +81 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/index.d.ts +8 -0
- package/dist/src/npc/behavior-tree/behaviors/conditions/index.js +15 -0
- package/dist/src/npc/behavior-tree/behaviors/index.d.ts +4 -0
- package/dist/src/npc/behavior-tree/behaviors/index.js +8 -0
- package/dist/src/npc/behavior-tree/blackboard/Blackboard.d.ts +50 -0
- package/dist/src/npc/behavior-tree/blackboard/Blackboard.js +121 -0
- package/dist/src/npc/behavior-tree/blackboard/BlackboardKey.d.ts +35 -0
- package/dist/src/npc/behavior-tree/blackboard/BlackboardKey.js +66 -0
- package/dist/src/npc/behavior-tree/blackboard/index.d.ts +2 -0
- package/dist/src/npc/behavior-tree/blackboard/index.js +3 -0
- package/dist/src/npc/behavior-tree/index.d.ts +9 -0
- package/dist/src/npc/behavior-tree/index.js +19 -0
- package/dist/src/npc/behavior-tree/loader/BehaviorTreeLoader.d.ts +91 -0
- package/dist/src/npc/behavior-tree/loader/BehaviorTreeLoader.js +240 -0
- package/dist/src/npc/behavior-tree/nodes/CompositeNode.d.ts +46 -0
- package/dist/src/npc/behavior-tree/nodes/CompositeNode.js +93 -0
- package/dist/src/npc/behavior-tree/nodes/LeafNode.d.ts +8 -0
- package/dist/src/npc/behavior-tree/nodes/LeafNode.js +11 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SelectorNode.d.ts +15 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SelectorNode.js +61 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SequenceNode.d.ts +15 -0
- package/dist/src/npc/behavior-tree/nodes/composite/SequenceNode.js +61 -0
- package/dist/src/physics/BasePhysicsEngine.d.ts +389 -0
- package/dist/src/physics/BasePhysicsEngine.js +1227 -0
- package/dist/src/physics/IPhysicsVehicle.d.ts +150 -0
- package/dist/src/physics/IPhysicsVehicle.js +2 -0
- package/dist/src/physics/PhysicsEngine.d.ts +425 -0
- package/dist/src/physics/PhysicsEngine.js +69 -0
- package/dist/src/physics/PhysicsTypes.d.ts +91 -0
- package/dist/src/physics/PhysicsTypes.js +24 -0
- package/dist/src/physics/implementations/RapierDebugRender.d.ts +24 -0
- package/dist/src/physics/implementations/RapierDebugRender.js +66 -0
- package/dist/src/physics/implementations/RapierPhysics.d.ts +122 -0
- package/dist/src/physics/implementations/RapierPhysics.js +1191 -0
- package/dist/src/physics/implementations/RapierVehicle.d.ts +31 -0
- package/dist/src/physics/implementations/RapierVehicle.js +236 -0
- package/dist/src/physics/index.d.ts +16 -0
- package/dist/src/physics/index.js +17 -0
- package/dist/src/render/EdgeOutlineEffect.d.ts +40 -0
- package/dist/src/render/EdgeOutlineEffect.js +389 -0
- package/dist/src/render/PostProcessManager.d.ts +274 -0
- package/dist/src/render/PostProcessManager.js +932 -0
- package/dist/src/render/Renderer.d.ts +84 -0
- package/dist/src/render/Renderer.js +306 -0
- package/dist/src/render/Texture.d.ts +51 -0
- package/dist/src/render/Texture.js +144 -0
- package/dist/src/render/index.d.ts +20 -0
- package/dist/src/render/index.js +21 -0
- package/dist/src/render/lightmapping/LightmapAtlas.d.ts +52 -0
- package/dist/src/render/lightmapping/LightmapAtlas.js +201 -0
- package/dist/src/render/lightmapping/LightmapBaker.d.ts +99 -0
- package/dist/src/render/lightmapping/LightmapBaker.js +239 -0
- package/dist/src/render/lightmapping/LightmapManager.d.ts +148 -0
- package/dist/src/render/lightmapping/LightmapManager.js +630 -0
- package/dist/src/render/lightmapping/LightmapMaterial.d.ts +26 -0
- package/dist/src/render/lightmapping/LightmapMaterial.js +242 -0
- package/dist/src/render/lightmapping/LightmapSerialization.d.ts +379 -0
- package/dist/src/render/lightmapping/LightmapSerialization.js +244 -0
- package/dist/src/render/lightmapping/LightmapSerializer.d.ts +94 -0
- package/dist/src/render/lightmapping/LightmapSerializer.js +223 -0
- package/dist/src/render/lightmapping/MultiLightmapperMaterial.d.ts +41 -0
- package/dist/src/render/lightmapping/MultiLightmapperMaterial.js +424 -0
- package/dist/src/render/lightmapping/index.d.ts +9 -0
- package/dist/src/render/lightmapping/index.js +6 -0
- package/dist/src/render/postprocessing/EffectPassWrapper.d.ts +17 -0
- package/dist/src/render/postprocessing/EffectPassWrapper.js +47 -0
- package/dist/src/render/postprocessing/ObjectOutlineEffect.d.ts +49 -0
- package/dist/src/render/postprocessing/ObjectOutlineEffect.js +364 -0
- package/dist/src/render/postprocessing/index.d.ts +2 -0
- package/dist/src/render/postprocessing/index.js +3 -0
- package/dist/src/runtime/GameRuntime.d.ts +25 -0
- package/dist/src/runtime/GameRuntime.js +131 -0
- package/dist/src/runtime/InjectedDependencies.d.ts +13 -0
- package/dist/src/runtime/InjectedDependencies.js +63 -0
- package/dist/src/runtime/Utils.d.ts +16 -0
- package/dist/src/runtime/Utils.js +113 -0
- package/dist/src/runtime/index.d.ts +4 -0
- package/dist/src/runtime/index.js +5 -0
- package/dist/src/runtime/materials/MatcapShaderMaterial.d.ts +23 -0
- package/dist/src/runtime/materials/MatcapShaderMaterial.js +235 -0
- package/dist/src/runtime/materials/index.d.ts +1 -0
- package/dist/src/runtime/materials/index.js +2 -0
- package/dist/src/scripting/Plugin.d.ts +64 -0
- package/dist/src/scripting/Plugin.js +2 -0
- package/dist/src/scripting/PluginManager.d.ts +40 -0
- package/dist/src/scripting/PluginManager.js +111 -0
- package/dist/src/scripting/index.d.ts +1 -0
- package/dist/src/scripting/index.js +2 -0
- package/dist/src/storage/defaultStorageProvider.d.ts +15 -0
- package/dist/src/storage/defaultStorageProvider.js +73 -0
- package/dist/src/storage/index.d.ts +16 -0
- package/dist/src/storage/index.js +17 -0
- package/dist/src/storage/projectContext.d.ts +80 -0
- package/dist/src/storage/projectContext.js +164 -0
- package/dist/src/storage/storageProvider.d.ts +148 -0
- package/dist/src/storage/storageProvider.js +181 -0
- package/dist/src/systems/ClassRegistry.d.ts +98 -0
- package/dist/src/systems/ClassRegistry.js +478 -0
- package/dist/src/systems/ConsoleManager.d.ts +66 -0
- package/dist/src/systems/ConsoleManager.js +465 -0
- package/dist/src/systems/ConsoleVariableHandler.d.ts +17 -0
- package/dist/src/systems/ConsoleVariableHandler.js +120 -0
- package/dist/src/systems/ConsoleVariableManager.d.ts +128 -0
- package/dist/src/systems/ConsoleVariableManager.js +295 -0
- package/dist/src/systems/InputManager.d.ts +511 -0
- package/dist/src/systems/InputManager.js +1025 -0
- package/dist/src/systems/ObjectNamingSystem.d.ts +9 -0
- package/dist/src/systems/ObjectNamingSystem.js +34 -0
- package/dist/src/systems/Stats.d.ts +36 -0
- package/dist/src/systems/Stats.js +193 -0
- package/dist/src/systems/TimerSystem.d.ts +180 -0
- package/dist/src/systems/TimerSystem.js +292 -0
- package/dist/src/systems/TweenManager.d.ts +57 -0
- package/dist/src/systems/TweenManager.js +107 -0
- package/dist/src/systems/WorldSerialization.d.ts +216 -0
- package/dist/src/systems/WorldSerialization.js +1082 -0
- package/dist/src/systems/collision/CollisionConfig.d.ts +56 -0
- package/dist/src/systems/collision/CollisionConfig.js +249 -0
- package/dist/src/systems/collision/CollisionTypes.d.ts +138 -0
- package/dist/src/systems/collision/CollisionTypes.js +204 -0
- package/dist/src/systems/collision/index.d.ts +15 -0
- package/dist/src/systems/collision/index.js +16 -0
- package/dist/src/systems/index.d.ts +23 -0
- package/dist/src/systems/index.js +24 -0
- package/dist/src/templates/MyActor.d.ts +9 -0
- package/dist/src/templates/MyActor.js +25 -0
- package/dist/src/templates/MySceneComponent.d.ts +9 -0
- package/dist/src/templates/MySceneComponent.js +25 -0
- package/dist/src/ui/LoadingScreen.d.ts +15 -0
- package/dist/src/ui/LoadingScreen.js +103 -0
- package/dist/src/ui/UIElement.d.ts +74 -0
- package/dist/src/ui/UIElement.js +202 -0
- package/dist/src/ui/UILayout.d.ts +126 -0
- package/dist/src/ui/UILayout.js +244 -0
- package/dist/src/ui/UIManager.d.ts +44 -0
- package/dist/src/ui/UIManager.js +148 -0
- package/dist/src/ui/UIResource.d.ts +6 -0
- package/dist/src/ui/UIResource.js +24 -0
- package/dist/src/ui/components/AmmoCounter.d.ts +28 -0
- package/dist/src/ui/components/AmmoCounter.js +125 -0
- package/dist/src/ui/components/BaseUIComponent.d.ts +128 -0
- package/dist/src/ui/components/BaseUIComponent.js +342 -0
- package/dist/src/ui/components/Compass.d.ts +28 -0
- package/dist/src/ui/components/Compass.js +125 -0
- package/dist/src/ui/components/ControlsPanel.d.ts +37 -0
- package/dist/src/ui/components/ControlsPanel.js +47 -0
- package/dist/src/ui/components/Crosshair.d.ts +20 -0
- package/dist/src/ui/components/Crosshair.js +67 -0
- package/dist/src/ui/components/InventoryBar.d.ts +103 -0
- package/dist/src/ui/components/InventoryBar.js +177 -0
- package/dist/src/ui/components/InventoryGrid.d.ts +139 -0
- package/dist/src/ui/components/InventoryGrid.js +407 -0
- package/dist/src/ui/components/Minimap.d.ts +39 -0
- package/dist/src/ui/components/Minimap.js +156 -0
- package/dist/src/ui/components/NumberDisplay.d.ts +51 -0
- package/dist/src/ui/components/NumberDisplay.js +164 -0
- package/dist/src/ui/components/ProgressBar.d.ts +115 -0
- package/dist/src/ui/components/ProgressBar.js +347 -0
- package/dist/src/ui/components/ReloadIndicator.d.ts +29 -0
- package/dist/src/ui/components/ReloadIndicator.js +147 -0
- package/dist/src/ui/components/index.d.ts +11 -0
- package/dist/src/ui/components/index.js +13 -0
- package/dist/src/ui/index.d.ts +21 -0
- package/dist/src/ui/index.js +22 -0
- package/dist/src/ui/ui-loader.d.ts +49 -0
- package/dist/src/ui/ui-loader.js +83 -0
- package/dist/src/utils/Color.d.ts +48 -0
- package/dist/src/utils/Color.js +121 -0
- package/dist/src/utils/Delegate.d.ts +72 -0
- package/dist/src/utils/Delegate.js +102 -0
- package/dist/src/utils/DescriptionHelpers.d.ts +47 -0
- package/dist/src/utils/DescriptionHelpers.js +65 -0
- package/dist/src/utils/EditorClassMeta.d.ts +99 -0
- package/dist/src/utils/EditorClassMeta.js +2 -0
- package/dist/src/utils/GlobalAudioManager.d.ts +141 -0
- package/dist/src/utils/GlobalAudioManager.js +312 -0
- package/dist/src/utils/IAsyncLoadable.d.ts +94 -0
- package/dist/src/utils/IAsyncLoadable.js +52 -0
- package/dist/src/utils/MaterialHelpers.d.ts +67 -0
- package/dist/src/utils/MaterialHelpers.js +278 -0
- package/dist/src/utils/MathHelpers.d.ts +65 -0
- package/dist/src/utils/MathHelpers.js +60 -0
- package/dist/src/utils/NodeJs.d.ts +1 -0
- package/dist/src/utils/NodeJs.js +81 -0
- package/dist/src/utils/Perlin.d.ts +39 -0
- package/dist/src/utils/Perlin.js +380 -0
- package/dist/src/utils/ResourceManager.d.ts +183 -0
- package/dist/src/utils/ResourceManager.js +703 -0
- package/dist/src/utils/SceneGraphUtils.d.ts +26 -0
- package/dist/src/utils/SceneGraphUtils.js +139 -0
- package/dist/src/utils/Spawn.d.ts +27 -0
- package/dist/src/utils/Spawn.js +73 -0
- package/dist/src/utils/ThreeJsExtensions.d.ts +298 -0
- package/dist/src/utils/ThreeJsExtensions.js +817 -0
- package/dist/src/utils/TweenExtensions.d.ts +8 -0
- package/dist/src/utils/TweenExtensions.js +103 -0
- package/dist/src/utils/UserCodeEngine.d.ts +70 -0
- package/dist/src/utils/UserCodeEngine.js +235 -0
- package/dist/src/utils/Utils.d.ts +65 -0
- package/dist/src/utils/Utils.js +296 -0
- package/dist/src/utils/VRButtonUtils.d.ts +21 -0
- package/dist/src/utils/VRButtonUtils.js +88 -0
- package/dist/src/utils/browser-polyfills/module.d.ts +20 -0
- package/dist/src/utils/browser-polyfills/module.js +31 -0
- package/dist/src/utils/browser-polyfills/path.d.ts +69 -0
- package/dist/src/utils/browser-polyfills/path.js +188 -0
- package/dist/src/utils/index.d.ts +29 -0
- package/dist/src/utils/index.js +30 -0
- package/dist/src/utils/serialization/cdo.d.ts +6 -0
- package/dist/src/utils/serialization/cdo.js +74 -0
- package/dist/src/utils/serialization/clsAlias.d.ts +15 -0
- package/dist/src/utils/serialization/clsAlias.js +96 -0
- package/dist/src/utils/serialization/decorator.d.ts +132 -0
- package/dist/src/utils/serialization/decorator.js +66 -0
- package/dist/src/utils/serialization/index.d.ts +7 -0
- package/dist/src/utils/serialization/index.js +8 -0
- package/dist/src/utils/serialization/prefab.d.ts +9 -0
- package/dist/src/utils/serialization/prefab.js +55 -0
- package/dist/src/utils/serialization/prefabManager.d.ts +17 -0
- package/dist/src/utils/serialization/prefabManager.js +84 -0
- package/dist/src/utils/serialization/serializable.d.ts +23 -0
- package/dist/src/utils/serialization/serializable.js +2 -0
- package/dist/src/utils/serialization/serializer.d.ts +126 -0
- package/dist/src/utils/serialization/serializer.js +1032 -0
- package/dist/src/utils/serialization/specialization.d.ts +1 -0
- package/dist/src/utils/serialization/specialization.js +194 -0
- package/dist/src/utils/serialization/specializationUtils.d.ts +27 -0
- package/dist/src/utils/serialization/specializationUtils.js +137 -0
- package/dist/src/vfx/VFXComponent.d.ts +65 -0
- package/dist/src/vfx/VFXComponent.js +202 -0
- package/dist/src/vfx/index.d.ts +11 -0
- package/dist/src/vfx/index.js +11 -0
- package/dist/src/vfx/types.d.ts +146 -0
- package/dist/src/vfx/types.js +146 -0
- package/dist/src/world-commands/common.d.ts +23 -0
- package/dist/src/world-commands/common.js +2 -0
- package/dist/src/world-commands/generate-code.d.ts +3 -0
- package/dist/src/world-commands/generate-code.js +90 -0
- package/dist/src/world-commands/index.d.ts +19 -0
- package/dist/src/world-commands/index.js +20 -0
- package/dist/src/world-commands/place-gltf.d.ts +25 -0
- package/dist/src/world-commands/place-gltf.js +39 -0
- package/dist/src/world-commands/place-prefab.d.ts +25 -0
- package/dist/src/world-commands/place-prefab.js +40 -0
- package/dist/src/world-commands/place-primitive.d.ts +39 -0
- package/dist/src/world-commands/place-primitive.js +100 -0
- package/dist/src/world-commands/remove-actors.d.ts +23 -0
- package/dist/src/world-commands/remove-actors.js +9 -0
- package/dist/src/xr/VRActor.d.ts +46 -0
- package/dist/src/xr/VRActor.js +56 -0
- package/dist/src/xr/VRControllerHandler.d.ts +25 -0
- package/dist/src/xr/VRControllerHandler.js +74 -0
- package/dist/src/xr/VRControllerManager.d.ts +194 -0
- package/dist/src/xr/VRControllerManager.js +539 -0
- package/dist/src/xr/VRDeviceHandler.d.ts +47 -0
- package/dist/src/xr/VRDeviceHandler.js +61 -0
- package/dist/src/xr/VRHandHandler.d.ts +23 -0
- package/dist/src/xr/VRHandHandler.js +161 -0
- package/dist/src/xr/VRInputDevice.d.ts +100 -0
- package/dist/src/xr/VRInputDevice.js +367 -0
- package/dist/src/xr/VRPawn.d.ts +198 -0
- package/dist/src/xr/VRPawn.js +771 -0
- package/dist/src/xr/actor-components/CanvasUIComponent.d.ts +61 -0
- package/dist/src/xr/actor-components/CanvasUIComponent.js +418 -0
- package/dist/src/xr/actor-components/VRBaseComponent.d.ts +15 -0
- package/dist/src/xr/actor-components/VRBaseComponent.js +24 -0
- package/dist/src/xr/actor-components/VRGrabbableComponent.d.ts +31 -0
- package/dist/src/xr/actor-components/VRGrabbableComponent.js +81 -0
- package/dist/src/xr/actor-components/VRInteractableComponent.d.ts +19 -0
- package/dist/src/xr/actor-components/VRInteractableComponent.js +50 -0
- package/dist/src/xr/index.d.ts +17 -0
- package/dist/src/xr/index.js +18 -0
- package/dist/src/xr/pawn-components/VRGrabComponent.d.ts +36 -0
- package/dist/src/xr/pawn-components/VRGrabComponent.js +445 -0
- package/dist/src/xr/pawn-components/VRInteractComponent.d.ts +20 -0
- package/dist/src/xr/pawn-components/VRInteractComponent.js +81 -0
- package/dist/src/xr/pawn-components/VRSnapTurnComponent.d.ts +25 -0
- package/dist/src/xr/pawn-components/VRSnapTurnComponent.js +114 -0
- package/dist/src/xr/pawn-components/VRTeleportComponent.d.ts +42 -0
- package/dist/src/xr/pawn-components/VRTeleportComponent.js +318 -0
- package/dist/src/xr/ui/CanvasColorPicker.d.ts +33 -0
- package/dist/src/xr/ui/CanvasColorPicker.js +188 -0
- package/dist/src/xr/ui/CanvasKeyboard.d.ts +21 -0
- package/dist/src/xr/ui/CanvasKeyboard.js +281 -0
- package/dist/src/xr/ui/CanvasSlider.d.ts +21 -0
- package/dist/src/xr/ui/CanvasSlider.js +112 -0
- package/dist/src/xr/ui/CanvasUI.d.ts +129 -0
- package/dist/src/xr/ui/CanvasUI.js +876 -0
- package/dist/src/xr/ui/index.d.ts +8 -0
- package/dist/src/xr/ui/index.js +9 -0
- package/dist/test/absolute-transform.test.d.ts +1 -0
- package/dist/test/absolute-transform.test.js +796 -0
- package/dist/test/asset-path.test.d.ts +1 -0
- package/dist/test/asset-path.test.js +339 -0
- package/dist/test/component.test.d.ts +1 -0
- package/dist/test/component.test.js +24 -0
- package/dist/test/construction.test.d.ts +1 -0
- package/dist/test/construction.test.js +26 -0
- package/dist/test/default-options-validation.test.d.ts +1 -0
- package/dist/test/default-options-validation.test.js +186 -0
- package/dist/test/metadata.test.d.ts +1 -0
- package/dist/test/metadata.test.js +82 -0
- package/dist/test/nodeStorage.d.ts +19 -0
- package/dist/test/nodeStorage.js +85 -0
- package/dist/test/postprocess-manager.test.d.ts +1 -0
- package/dist/test/postprocess-manager.test.js +77 -0
- package/dist/test/prefab.test.d.ts +1 -0
- package/dist/test/prefab.test.js +903 -0
- package/dist/test/scene-component.test.d.ts +1 -0
- package/dist/test/scene-component.test.js +13 -0
- package/dist/test/scene-graph.test.d.ts +1 -0
- package/dist/test/scene-graph.test.js +163 -0
- package/dist/test/serialization-v1.test.d.ts +15 -0
- package/dist/test/serialization-v1.test.js +1057 -0
- package/dist/test/serialization.test.d.ts +1 -0
- package/dist/test/serialization.test.js +425 -0
- package/dist/test/spawn.test.d.ts +1 -0
- package/dist/test/spawn.test.js +137 -0
- package/dist/test/utils.d.ts +27 -0
- package/dist/test/utils.js +115 -0
- package/docs/agent-instructions.md +49 -0
- package/docs/deprecated/8-guide-user-interface-2.md +600 -0
- package/docs/deprecated/Agents.md +117 -0
- package/docs/deprecated/TELEGRAM_MINIAPP_SUPPORT_PLAN.md +283 -0
- package/docs/deprecated/summary-2.md +101 -0
- package/docs/engine-summary.md +104 -0
- package/docs/guides/0-world-and-gameloop.md +331 -0
- package/docs/guides/1-actors-and-components.md +955 -0
- package/docs/guides/10-camera-system.md +778 -0
- package/docs/guides/11-equipment-and-weapons.md +850 -0
- package/docs/guides/12-threejs-extensions.md +528 -0
- package/docs/guides/13-visual-effects-and-particles.md +530 -0
- package/docs/guides/14-sound-system.md +436 -0
- package/docs/guides/15-global-audio-manager.md +367 -0
- package/docs/guides/15-navigation-and-pathfinding.md +818 -0
- package/docs/guides/16-ragdoll-physics.md +479 -0
- package/docs/guides/17-asset-referencing.md +248 -0
- package/docs/guides/18-lightmapping-system.md +984 -0
- package/docs/guides/19-webxr-virtual-reality.md +367 -0
- package/docs/guides/2-player-inputs-and-controls.md +737 -0
- package/docs/guides/3-physics-and-collisions.md +248 -0
- package/docs/guides/4-visuals-and-rendering.md +946 -0
- package/docs/guides/5-animation.md +310 -0
- package/docs/guides/6-ai-and-behavior-trees.md +1316 -0
- package/docs/guides/7-building-levels.md +211 -0
- package/docs/guides/8-user-interface.md +291 -0
- package/docs/guides/9-multiplayer.md +181 -0
- package/docs/high-level-class-hierarchy.md +218 -0
- package/eslint-rules/constructor-type-consistency.js +251 -0
- package/eslint-rules/default-getter-return-type.js +42 -0
- package/eslint-rules/engine-class-name-consistency.js +62 -0
- package/eslint-rules/no-async-override-mismatch.js +100 -0
- package/eslint-rules/no-default-class-fields.js +66 -0
- package/eslint-rules/no-override-methods.js +158 -0
- package/games/animation-demo.ts +367 -0
- package/games/animation-retarget-demo.ts +553 -0
- package/games/behavior-tree-demo.ts +1774 -0
- package/games/character_animation.ts +194 -0
- package/games/collision-demo.ts +139 -0
- package/games/deprecated/advanced-grid-demo.ts +336 -0
- package/games/deprecated/airplane-demo.ts +156 -0
- package/games/deprecated/character-controller.ts +161 -0
- package/games/deprecated/chase-game.ts +310 -0
- package/games/deprecated/collision-config.ts +317 -0
- package/games/deprecated/door-demo.ts +641 -0
- package/games/deprecated/fps-demo.ts +128 -0
- package/games/deprecated/fps-shotgun-demo.ts +227 -0
- package/games/deprecated/index.ts +25 -0
- package/games/deprecated/lightmapping-demo.ts +1515 -0
- package/games/deprecated/lights-demo.ts +957 -0
- package/games/deprecated/matcap-demo.ts +823 -0
- package/games/deprecated/material-demo-2.ts +582 -0
- package/games/deprecated/material-demo.ts +204 -0
- package/games/deprecated/memory-leak-test.ts +23 -0
- package/games/deprecated/model-stress-test.ts +150 -0
- package/games/deprecated/multiplayer-demo.ts +392 -0
- package/games/deprecated/physics-demo.ts +199 -0
- package/games/deprecated/shadow-demo.ts +435 -0
- package/games/deprecated/shooting-demo.ts +352 -0
- package/games/deprecated/skybox-demo.ts +341 -0
- package/games/deprecated/sound-demo.ts +117 -0
- package/games/deprecated/timer-demo.ts +178 -0
- package/games/deprecated/voxel-demo.ts +50 -0
- package/games/deprecated/world-commands.ts +184 -0
- package/games/deprecated/world-loading.ts +90 -0
- package/games/examples/fps-advanced/const.ts +122 -0
- package/games/examples/fps-advanced/enemies.ts +174 -0
- package/games/examples/fps-advanced/game-mode.ts +347 -0
- package/games/examples/fps-advanced/game.ts +74 -0
- package/games/examples/fps-advanced/pickups.ts +225 -0
- package/games/examples/fps-advanced/player.ts +101 -0
- package/games/examples/fps-advanced/ui/endgame-ui.ts +277 -0
- package/games/examples/fps-advanced/ui/game-hud.ts +211 -0
- package/games/examples/fps-advanced/ui/menu-ui.ts +217 -0
- package/games/examples/fps-advanced/ui/weapon-hud.ts +254 -0
- package/games/examples/fps-advanced/weapons.ts +209 -0
- package/games/examples/index.ts +5 -0
- package/games/examples/plugin-demo/game.ts +175 -0
- package/games/examples/plugin-demo/plugins/dynamic-lighting.ts +146 -0
- package/games/examples/plugin-demo/plugins/instanced-forest.ts +186 -0
- package/games/examples/plugin-demo/plugins/particle-fountain.ts +63 -0
- package/games/examples/plugin-demo/plugins/physics-playground.ts +189 -0
- package/games/examples/plugin-demo/plugins/robot-follower.ts +306 -0
- package/games/examples/plugin-demo/plugins/scatter-models.ts +74 -0
- package/games/examples/plugin-demo/plugins/simple-cube.ts +44 -0
- package/games/examples/plugin-demo/plugins/tic-tac-toe.ts +522 -0
- package/games/examples/plugin-demo/plugins/wobbling-sphere.ts +66 -0
- package/games/examples/side-scroller-advanced/const.ts +88 -0
- package/games/examples/side-scroller-advanced/game-mode.ts +350 -0
- package/games/examples/side-scroller-advanced/game.ts +80 -0
- package/games/examples/side-scroller-advanced/level-generator.ts +384 -0
- package/games/examples/side-scroller-advanced/pickups.ts +132 -0
- package/games/examples/side-scroller-advanced/player.ts +105 -0
- package/games/examples/side-scroller-advanced/ui/endgame-ui.ts +278 -0
- package/games/examples/side-scroller-advanced/ui/game-hud.ts +238 -0
- package/games/examples/side-scroller-advanced/ui/menu-ui.ts +215 -0
- package/games/examples/vehicle/base-vehicle.ts +159 -0
- package/games/examples/vehicle/game.ts +154 -0
- package/games/examples/vehicle/mesh-vehicle.ts +191 -0
- package/games/examples/vehicle/player.ts +86 -0
- package/games/examples/vehicle/primitive-vehicle.ts +266 -0
- package/games/examples/vr-game/VRAttachableCube.ts +39 -0
- package/games/examples/vr-game/VRInteractableCylinder.ts +83 -0
- package/games/examples/vr-game/VRPressableButton.ts +113 -0
- package/games/examples/vr-game/VRProjectileActor.ts +69 -0
- package/games/examples/vr-game/VRRifleActor.ts +138 -0
- package/games/examples/vr-game/game.ts +69 -0
- package/games/examples/vr-game/index.ts +9 -0
- package/games/examples/vr-game/scene.ts +99 -0
- package/games/hand-tracking-demo.ts +71 -0
- package/games/index.ts +21 -0
- package/games/instanced-mesh-demo.ts +429 -0
- package/games/manifold-demo.ts +52 -0
- package/games/navigation-demo.ts +351 -0
- package/games/navmesh-primitives-demo.ts +1252 -0
- package/games/performance-test-demo.ts +237 -0
- package/games/postprocess-demo.ts +867 -0
- package/games/ragdoll-demo-simple.ts +163 -0
- package/games/ragdoll-demo.ts +272 -0
- package/games/swipe-tap-demo.ts +228 -0
- package/games/tween-demo.ts +125 -0
- package/games/ui-demo.ts +1058 -0
- package/games/vfx-demo.ts +922 -0
- package/games/vfx-wawa-demo.ts +540 -0
- package/games/vr-ui-demo-minimal.ts +156 -0
- package/games/vr-ui-demo.ts +972 -0
- package/package.json +104 -0
- package/scripts/build-browser-bundle.ts +75 -0
- package/scripts/check-asset-path.ts +166 -0
- package/scripts/dump-templates.ts +21 -0
- package/scripts/generate-dependencies.ts +145 -0
- package/scripts/generate-prefabs.ts +120 -0
- package/scripts/load-save-world.ts +44 -0
- package/scripts/loc.ts +112 -0
- package/scripts/optimize-glb-wrapper.ts +28 -0
- package/scripts/optimize-glb.ts +352 -0
- package/scripts/session-server.ts +861 -0
- package/scripts/test-world-loading.ts +23 -0
- package/src/actors/Actor.ts +1183 -0
- package/src/actors/GLTFMeshActor.ts +107 -0
- package/src/actors/GlobalParticleManager.ts +460 -0
- package/src/actors/Pawn.ts +370 -0
- package/src/actors/PlayerController.ts +646 -0
- package/src/actors/PlayerStart.ts +47 -0
- package/src/actors/Projectile.ts +179 -0
- package/src/actors/RagdollTestActor.ts +153 -0
- package/src/actors/ThirdPersonCharacterPawn.ts +139 -0
- package/src/actors/index.ts +21 -0
- package/src/animation/AnimationClipCache.ts +86 -0
- package/src/animation/AnimationRetargeting.ts +566 -0
- package/src/animation/SkeletonProfile.ts +137 -0
- package/src/animation/index.ts +14 -0
- package/src/animation/retargeting.ts +866 -0
- package/src/components/CharacterStatsComponent.ts +199 -0
- package/src/components/CollisionShapeComponent.ts +256 -0
- package/src/components/Component.ts +111 -0
- package/src/components/FollowComponent.ts +149 -0
- package/src/components/PrimitiveComponent.ts +368 -0
- package/src/components/ResetPositionComponent.ts +175 -0
- package/src/components/SceneComponent.ts +628 -0
- package/src/components/audio/SoundComponent.ts +385 -0
- package/src/components/audio/index.ts +11 -0
- package/src/components/csg/CSGCombiner.ts +268 -0
- package/src/components/csg/CSGShapes.ts +344 -0
- package/src/components/csg/index.ts +12 -0
- package/src/components/gameplay/BaseWeaponComponent.ts +597 -0
- package/src/components/gameplay/DoorComponent.ts +930 -0
- package/src/components/gameplay/Equipment.ts +30 -0
- package/src/components/gameplay/GenericEquipment.ts +96 -0
- package/src/components/gameplay/InstantHitWeaponComponent.ts +248 -0
- package/src/components/gameplay/PickupComponent.ts +473 -0
- package/src/components/gameplay/ProjectileWeaponComponent.ts +114 -0
- package/src/components/gameplay/ShotgunComponent.ts +220 -0
- package/src/components/gameplay/SwitchComponent.ts +466 -0
- package/src/components/gameplay/TriggerZoneComponent.ts +346 -0
- package/src/components/gameplay/index.ts +20 -0
- package/src/components/index.ts +19 -0
- package/src/components/lights/AmbientLightComponent.ts +72 -0
- package/src/components/lights/DirectionalLightComponent.ts +163 -0
- package/src/components/lights/HemisphereLightComponent.ts +132 -0
- package/src/components/lights/LightComponent.ts +351 -0
- package/src/components/lights/PointLightComponent.ts +115 -0
- package/src/components/lights/RectAreaLightComponent.ts +151 -0
- package/src/components/lights/SpotLightComponent.ts +193 -0
- package/src/components/lights/index.ts +17 -0
- package/src/components/movement/AerialMovementComponent.ts +348 -0
- package/src/components/movement/AirplaneMovementComponent.ts +236 -0
- package/src/components/movement/BasePawnMovementComponent.ts +297 -0
- package/src/components/movement/CharacterMovementComponent.ts +446 -0
- package/src/components/movement/DirectionalCharacterMovementComponent.ts +79 -0
- package/src/components/movement/NpcMovementComponent.ts +930 -0
- package/src/components/movement/PathMovementComponent.ts +190 -0
- package/src/components/movement/TopDownMovementComponent.ts +88 -0
- package/src/components/movement/TweenMovementComponent.ts +386 -0
- package/src/components/movement/VehicleMovementComponent.ts +469 -0
- package/src/components/movement/index.ts +19 -0
- package/src/components/physics/RagdollComponent.ts +730 -0
- package/src/components/visual/AnimationComponent.ts +208 -0
- package/src/components/visual/AnimationStateMachineComponent.ts +1079 -0
- package/src/components/visual/BaseInstancedMeshComponent.ts +904 -0
- package/src/components/visual/BillboardComponent.ts +127 -0
- package/src/components/visual/EditorOnlyMeshComponent.ts +54 -0
- package/src/components/visual/FogComponent.ts +131 -0
- package/src/components/visual/GLTFMeshComponent.ts +444 -0
- package/src/components/visual/InstancedGltfMeshComponent.ts +215 -0
- package/src/components/visual/InstancedMeshComponent.ts +118 -0
- package/src/components/visual/MeshComponent.ts +224 -0
- package/src/components/visual/ParticleEmitterComponent.ts +628 -0
- package/src/components/visual/SkyboxComponent.ts +381 -0
- package/src/components/visual/TerrainMeshComponent.ts +346 -0
- package/src/components/visual/UI3DComponent.ts +264 -0
- package/src/components/visual/index.ts +23 -0
- package/src/components/voxel/MagicaVoxelLoader.ts +184 -0
- package/src/components/voxel/VoxelMeshComponent.ts +274 -0
- package/src/components/voxel/index.ts +3 -0
- package/src/const.ts +68 -0
- package/src/csg/CSGUtils.ts +771 -0
- package/src/csg/ManifoldWrapper.ts +704 -0
- package/src/csg/index.ts +13 -0
- package/src/dependencies.ts +76 -0
- package/src/game/GameBuilder.ts +280 -0
- package/src/game/GameLoop.ts +614 -0
- package/src/game/GameMode.ts +127 -0
- package/src/game/Playable.ts +84 -0
- package/src/game/World.ts +1430 -0
- package/src/game/index.ts +18 -0
- package/src/global.d.ts +11 -0
- package/src/index.ts +39 -0
- package/src/materials.ts +181 -0
- package/src/multiplayer/MovementPrediction.ts +202 -0
- package/src/multiplayer/NetWorld.ts +920 -0
- package/src/multiplayer/README.md +349 -0
- package/src/multiplayer/implementations/MemorySession.ts +112 -0
- package/src/multiplayer/implementations/WebSocketSession.ts +468 -0
- package/src/multiplayer/implementations/index.ts +14 -0
- package/src/multiplayer/index.ts +16 -0
- package/src/multiplayer/interface.ts +174 -0
- package/src/navigation/NavigationServer.ts +170 -0
- package/src/navigation/RecastNavigationServer.ts +370 -0
- package/src/navigation/index.ts +17 -0
- package/src/npc/behavior-tree/BehaviorNode.ts +191 -0
- package/src/npc/behavior-tree/BehaviorTreeComponent.ts +351 -0
- package/src/npc/behavior-tree/behaviors/BehaviorAction.ts +97 -0
- package/src/npc/behavior-tree/behaviors/ConditionEvaluator.ts +128 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialMoveToTargetAction.ts +128 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialSearchAction.ts +159 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialTrackTargetAction.ts +76 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/AerialWanderAction.ts +160 -0
- package/src/npc/behavior-tree/behaviors/actions/aerial/index.ts +5 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/MeleeAttackAction.ts +151 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/ShootAction.ts +158 -0
- package/src/npc/behavior-tree/behaviors/actions/combat/index.ts +3 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/FleeFromTargetAction.ts +157 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/FollowActorAction.ts +131 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/MoveToPositionAction.ts +99 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/SetNextWaypointAction.ts +114 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/WanderAction.ts +146 -0
- package/src/npc/behavior-tree/behaviors/actions/ground/index.ts +6 -0
- package/src/npc/behavior-tree/behaviors/actions/index.ts +13 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/CalculateTacticalPositionAction.ts +117 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/LookAtTargetAction.ts +136 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/WaitAction.ts +70 -0
- package/src/npc/behavior-tree/behaviors/actions/utility/index.ts +4 -0
- package/src/npc/behavior-tree/behaviors/conditions/BlackboardValueCondition.ts +144 -0
- package/src/npc/behavior-tree/behaviors/conditions/CanSeeTargetCondition.ts +171 -0
- package/src/npc/behavior-tree/behaviors/conditions/HasLastKnownPositionCondition.ts +63 -0
- package/src/npc/behavior-tree/behaviors/conditions/HpAbovePercentCondition.ts +83 -0
- package/src/npc/behavior-tree/behaviors/conditions/IsPlayerNearCondition.ts +49 -0
- package/src/npc/behavior-tree/behaviors/conditions/TargetBelowHpPercentCondition.ts +61 -0
- package/src/npc/behavior-tree/behaviors/conditions/TargetInConeCondition.ts +106 -0
- package/src/npc/behavior-tree/behaviors/conditions/TimeLimitCondition.ts +65 -0
- package/src/npc/behavior-tree/behaviors/conditions/index.ts +19 -0
- package/src/npc/behavior-tree/behaviors/index.ts +9 -0
- package/src/npc/behavior-tree/blackboard/Blackboard.ts +127 -0
- package/src/npc/behavior-tree/blackboard/BlackboardKey.ts +59 -0
- package/src/npc/behavior-tree/blackboard/index.ts +2 -0
- package/src/npc/behavior-tree/index.ts +27 -0
- package/src/npc/behavior-tree/loader/BehaviorTreeLoader.ts +296 -0
- package/src/npc/behavior-tree/nodes/CompositeNode.ts +100 -0
- package/src/npc/behavior-tree/nodes/LeafNode.ts +11 -0
- package/src/npc/behavior-tree/nodes/composite/SelectorNode.ts +56 -0
- package/src/npc/behavior-tree/nodes/composite/SequenceNode.ts +56 -0
- package/src/physics/BasePhysicsEngine.ts +1486 -0
- package/src/physics/IPhysicsVehicle.ts +162 -0
- package/src/physics/PhysicsEngine.ts +517 -0
- package/src/physics/PhysicsTypes.ts +116 -0
- package/src/physics/implementations/RapierDebugRender.ts +55 -0
- package/src/physics/implementations/RapierPhysics.ts +1419 -0
- package/src/physics/implementations/RapierVehicle.ts +267 -0
- package/src/physics/index.ts +16 -0
- package/src/render/EdgeOutlineEffect.ts +365 -0
- package/src/render/PostProcessManager.ts +1025 -0
- package/src/render/Renderer.ts +310 -0
- package/src/render/Texture.ts +140 -0
- package/src/render/index.ts +22 -0
- package/src/render/lightmapping/LightmapAtlas.ts +248 -0
- package/src/render/lightmapping/LightmapBaker.ts +333 -0
- package/src/render/lightmapping/LightmapManager.ts +752 -0
- package/src/render/lightmapping/LightmapMaterial.ts +283 -0
- package/src/render/lightmapping/LightmapSerialization.ts +336 -0
- package/src/render/lightmapping/LightmapSerializer.ts +309 -0
- package/src/render/lightmapping/MultiLightmapperMaterial.ts +484 -0
- package/src/render/lightmapping/index.ts +18 -0
- package/src/render/postprocessing/EffectPassWrapper.ts +47 -0
- package/src/render/postprocessing/ObjectOutlineEffect.ts +356 -0
- package/src/render/postprocessing/index.ts +2 -0
- package/src/runtime/GameRuntime.ts +153 -0
- package/src/runtime/InjectedDependencies.ts +70 -0
- package/src/runtime/Utils.ts +146 -0
- package/src/runtime/index.ts +4 -0
- package/src/runtime/materials/MatcapShaderMaterial.ts +242 -0
- package/src/runtime/materials/index.ts +1 -0
- package/src/scripting/Plugin.ts +67 -0
- package/src/scripting/PluginManager.ts +99 -0
- package/src/scripting/index.ts +1 -0
- package/src/storage/defaultStorageProvider.ts +95 -0
- package/src/storage/index.ts +16 -0
- package/src/storage/projectContext.ts +176 -0
- package/src/storage/storageProvider.ts +271 -0
- package/src/systems/ClassRegistry.ts +484 -0
- package/src/systems/ConsoleManager.ts +484 -0
- package/src/systems/ConsoleVariableHandler.ts +105 -0
- package/src/systems/ConsoleVariableManager.ts +288 -0
- package/src/systems/InputManager.ts +1255 -0
- package/src/systems/ObjectNamingSystem.ts +30 -0
- package/src/systems/Stats.ts +178 -0
- package/src/systems/TimerSystem.ts +353 -0
- package/src/systems/TweenManager.ts +107 -0
- package/src/systems/WorldSerialization.ts +1211 -0
- package/src/systems/collision/CollisionConfig.ts +281 -0
- package/src/systems/collision/CollisionTypes.ts +185 -0
- package/src/systems/collision/index.ts +15 -0
- package/src/systems/index.ts +23 -0
- package/src/templates/MyActor.ts +29 -0
- package/src/templates/MySceneComponent.ts +29 -0
- package/src/templates/README.md +1 -0
- package/src/types/rapier-es.d.ts +16 -0
- package/src/types/stats.js.d.ts +22 -0
- package/src/ui/LoadingScreen.ts +110 -0
- package/src/ui/UIElement.ts +224 -0
- package/src/ui/UILayout.ts +269 -0
- package/src/ui/UIManager.ts +161 -0
- package/src/ui/UIResource.ts +20 -0
- package/src/ui/components/AmmoCounter.ts +126 -0
- package/src/ui/components/BaseUIComponent.md +296 -0
- package/src/ui/components/BaseUIComponent.ts +390 -0
- package/src/ui/components/Compass.ts +144 -0
- package/src/ui/components/ControlsPanel.ts +62 -0
- package/src/ui/components/Crosshair.ts +76 -0
- package/src/ui/components/InventoryBar.ts +224 -0
- package/src/ui/components/InventoryGrid.ts +471 -0
- package/src/ui/components/Minimap.ts +181 -0
- package/src/ui/components/NumberDisplay.ts +198 -0
- package/src/ui/components/ProgressBar.ts +403 -0
- package/src/ui/components/ReloadIndicator.ts +159 -0
- package/src/ui/components/index.ts +12 -0
- package/src/ui/index.ts +21 -0
- package/src/ui/ui-loader.ts +87 -0
- package/src/utils/Color.ts +51 -0
- package/src/utils/Delegate.ts +112 -0
- package/src/utils/DescriptionHelpers.ts +93 -0
- package/src/utils/EditorClassMeta.ts +91 -0
- package/src/utils/GlobalAudioManager.ts +370 -0
- package/src/utils/IAsyncLoadable.ts +122 -0
- package/src/utils/MaterialHelpers.ts +321 -0
- package/src/utils/MathHelpers.ts +79 -0
- package/src/utils/NodeJs.ts +79 -0
- package/src/utils/Perlin.ts +346 -0
- package/src/utils/ResourceManager.ts +716 -0
- package/src/utils/SceneGraphUtils.ts +173 -0
- package/src/utils/Spawn.ts +93 -0
- package/src/utils/ThreeJsExtensions.ts +1200 -0
- package/src/utils/TweenExtensions.ts +124 -0
- package/src/utils/UserCodeEngine.ts +243 -0
- package/src/utils/Utils.ts +328 -0
- package/src/utils/VRButtonUtils.ts +125 -0
- package/src/utils/browser-polyfills/module.ts +36 -0
- package/src/utils/browser-polyfills/path.ts +232 -0
- package/src/utils/index.ts +29 -0
- package/src/utils/serialization/cdo.ts +87 -0
- package/src/utils/serialization/clsAlias.ts +92 -0
- package/src/utils/serialization/decorator.ts +176 -0
- package/src/utils/serialization/index.ts +7 -0
- package/src/utils/serialization/prefab.ts +78 -0
- package/src/utils/serialization/prefabManager.ts +88 -0
- package/src/utils/serialization/serializable.ts +28 -0
- package/src/utils/serialization/serializer.ts +1111 -0
- package/src/utils/serialization/specialization.ts +224 -0
- package/src/utils/serialization/specializationUtils.ts +185 -0
- package/src/vfx/VFXComponent.ts +206 -0
- package/src/vfx/index.ts +17 -0
- package/src/vfx/types.ts +287 -0
- package/src/vfx/wawa-vfx-reference.md +399 -0
- package/src/world-commands/common.ts +25 -0
- package/src/world-commands/generate-code.ts +99 -0
- package/src/world-commands/index.ts +19 -0
- package/src/world-commands/place-gltf.ts +63 -0
- package/src/world-commands/place-prefab.ts +62 -0
- package/src/world-commands/place-primitive.ts +128 -0
- package/src/world-commands/remove-actors.ts +32 -0
- package/src/xr/VRActor.ts +71 -0
- package/src/xr/VRControllerHandler.ts +87 -0
- package/src/xr/VRControllerManager.ts +559 -0
- package/src/xr/VRDeviceHandler.ts +77 -0
- package/src/xr/VRHandHandler.ts +166 -0
- package/src/xr/VRInputDevice.ts +374 -0
- package/src/xr/VRPawn.ts +815 -0
- package/src/xr/actor-components/CanvasUIComponent.ts +425 -0
- package/src/xr/actor-components/VRBaseComponent.ts +26 -0
- package/src/xr/actor-components/VRGrabbableComponent.ts +73 -0
- package/src/xr/actor-components/VRInteractableComponent.ts +43 -0
- package/src/xr/index.ts +17 -0
- package/src/xr/pawn-components/VRGrabComponent.ts +435 -0
- package/src/xr/pawn-components/VRInteractComponent.ts +77 -0
- package/src/xr/pawn-components/VRSnapTurnComponent.ts +103 -0
- package/src/xr/pawn-components/VRTeleportComponent.ts +284 -0
- package/src/xr/ui/CanvasColorPicker.ts +172 -0
- package/src/xr/ui/CanvasKeyboard.ts +283 -0
- package/src/xr/ui/CanvasSlider.ts +83 -0
- package/src/xr/ui/CanvasUI.ts +879 -0
- package/src/xr/ui/index.ts +9 -0
|
@@ -0,0 +1,1111 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
|
|
3
|
+
import { SerializationVersion } from '../../const.js';
|
|
4
|
+
import { ClassRegistry } from '../../systems/ClassRegistry.js';
|
|
5
|
+
|
|
6
|
+
import { getAllPropertiesFromProto, getDefaultObject, getDefaultObjectFromName } from './cdo.js';
|
|
7
|
+
import {
|
|
8
|
+
getClassForDeserialization,
|
|
9
|
+
getClassSerializeName,
|
|
10
|
+
} from './clsAlias.js';
|
|
11
|
+
import { instantiatePrefab } from './prefab.js';
|
|
12
|
+
import { PrefabManager } from './prefabManager.js';
|
|
13
|
+
import { ISerializableObjectTag } from './serializable.js';
|
|
14
|
+
import {
|
|
15
|
+
getDeserializeFn,
|
|
16
|
+
getSerializeFn,
|
|
17
|
+
getStaticDeserializeFn
|
|
18
|
+
} from './specializationUtils.js';
|
|
19
|
+
import './specialization.js'; // make sure specializations are registered
|
|
20
|
+
|
|
21
|
+
import type { PropertyMetadata } from './decorator.js';
|
|
22
|
+
import type { ISerializableObject } from './serializable.js';
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
type RefType = number;
|
|
26
|
+
type Ref = { $ref: RefType };
|
|
27
|
+
type ClassInfo = { $class: string, $ctorArgs?: any[] };
|
|
28
|
+
export type PrefabInfo = { $path: string };
|
|
29
|
+
export type BaseInfo = ClassInfo | PrefabInfo;
|
|
30
|
+
type Meta = { editorOnly?: boolean }
|
|
31
|
+
type SerializedSubObject = { $id?: RefType, $value: any, $base?: BaseInfo, $meta?: Meta };
|
|
32
|
+
type RootSerializedData = { $root: any, $objects?: SerializedSubObject[] };
|
|
33
|
+
export type SerializedData = { $version: number } & RootSerializedData;
|
|
34
|
+
|
|
35
|
+
const VERSION = SerializationVersion.V1;
|
|
36
|
+
const UNREGISTERED_CLASS_PREFIX = 'UNREGISTERED.';
|
|
37
|
+
|
|
38
|
+
function isClassInfo(baseInfo: BaseInfo): baseInfo is ClassInfo {
|
|
39
|
+
return '$class' in baseInfo;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function isPrefabInfo(baseInfo: BaseInfo): baseInfo is PrefabInfo {
|
|
43
|
+
return '$path' in baseInfo;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function isSerializableObject(obj: any): obj is ISerializableObject {
|
|
47
|
+
return obj && typeof obj === 'object' && obj[ISerializableObjectTag] === true;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const DumpValueResult = {
|
|
51
|
+
Dumped: 0,
|
|
52
|
+
SkippedTransient: 1,
|
|
53
|
+
SkippedEqualToDefaultValue: 2,
|
|
54
|
+
SkippedOtherwise: 3,
|
|
55
|
+
} as const;
|
|
56
|
+
|
|
57
|
+
type DumpValueResult = typeof DumpValueResult[keyof typeof DumpValueResult];
|
|
58
|
+
|
|
59
|
+
type CtorArgProperty = {
|
|
60
|
+
name?: string;
|
|
61
|
+
value: any;
|
|
62
|
+
metadata?: PropertyMetadata;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The serialized data will either be $root + $objects, or $prefab + $diff
|
|
68
|
+
* if it's $prefab + $diff, the prefab data can be another prefab, forming a chain of prefabs
|
|
69
|
+
*
|
|
70
|
+
* A typical result of serialized (SerializedData) would look something like this:
|
|
71
|
+
* {
|
|
72
|
+
* $prefab: {
|
|
73
|
+
* $path: '@engine/prefabs/Prefab1.prefab.json'
|
|
74
|
+
* },
|
|
75
|
+
* $diff: {
|
|
76
|
+
* // only the differences from the prefab1
|
|
77
|
+
* }
|
|
78
|
+
* }
|
|
79
|
+
* Once all prefabs with paths are resolved, the final expanded data would look like this:
|
|
80
|
+
* {
|
|
81
|
+
* $prefab: {
|
|
82
|
+
* $path: '@engine/prefabs/Prefab1.prefab.json',
|
|
83
|
+
* $data: {
|
|
84
|
+
* // yet another prefab data here
|
|
85
|
+
* $prefab: {
|
|
86
|
+
* $path: '@engine/prefabs/Prefab2.prefab.json',
|
|
87
|
+
* $data: {
|
|
88
|
+
* // a prefab that's based on Actor instead of another prefab
|
|
89
|
+
* $root: {
|
|
90
|
+
* $class: 'ENGINE.Actor', ...
|
|
91
|
+
* },
|
|
92
|
+
* $objects: [
|
|
93
|
+
* // serialized objects here
|
|
94
|
+
* ]
|
|
95
|
+
* }
|
|
96
|
+
* },
|
|
97
|
+
* $diff: {
|
|
98
|
+
* // only the differences from the prefab2
|
|
99
|
+
* }
|
|
100
|
+
* }
|
|
101
|
+
* },
|
|
102
|
+
* $diff: {
|
|
103
|
+
* // only the differences from the prefab1
|
|
104
|
+
* }
|
|
105
|
+
* }
|
|
106
|
+
*/
|
|
107
|
+
|
|
108
|
+
// make sure it's kept in sync with RefType
|
|
109
|
+
function _isRef(v: any): v is { $ref: RefType } {
|
|
110
|
+
return v && typeof v === 'object' && typeof v.$ref === 'number';
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function getAllProperties(obj: any): Map<string, PropertyMetadata> {
|
|
114
|
+
let proto = Object.getPrototypeOf(obj);
|
|
115
|
+
return getAllPropertiesFromProto(proto);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function shouldSerializeRespectingMetadata(obj: any): boolean {
|
|
119
|
+
const properties = getAllProperties(obj);
|
|
120
|
+
const hasDecoratedProperties = properties.size > 0;
|
|
121
|
+
if (hasDecoratedProperties) {
|
|
122
|
+
return true;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const className = ClassRegistry.getClassName(obj);
|
|
126
|
+
const isClassRegistered = !!className;
|
|
127
|
+
return isClassRegistered;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
class Serializer {
|
|
131
|
+
protected get isDumping(): boolean {return false;}
|
|
132
|
+
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Dumper serializes objects into a structured format, handling references and class instances.
|
|
137
|
+
* If an object is referenced more than once, it will be assigned an ID and stored in the $objects array as SerializedObject[].
|
|
138
|
+
* If an object is a class instance, it will be stored with its class name, constructor arguments, and properties, basically an inlined `SerializedObject`
|
|
139
|
+
* otherwise, it will be inlined directly.
|
|
140
|
+
* The output format is `SerializedData`, with always a $root field, and optionally a $objects array.
|
|
141
|
+
* The following are possible outputs:
|
|
142
|
+
* plain objects: {a: 1, b: {x: 2, y: 3}} -> {$root: {a: 1, b: {x: 2, y:3}}}
|
|
143
|
+
* with shared/circular references: {a: obj1, b: obj1, c: {x: 1}} -> {$root: {a: {$ref: 1}, b: {$ref: 1}, c: {x: 1}}, $objects: [{ $id: 1, $value: {fields of obj1...} }]}
|
|
144
|
+
* with class: THREE.Vector3(1,2,3) -> {$root: { $class: 'THREE.Vector3', x:1, y:2, z:3 }}
|
|
145
|
+
* ENGINE.Actor({data: 3, position: new THREE.Vector3(1, 2, 3)}) -> {
|
|
146
|
+
* $root: {
|
|
147
|
+
* $class: 'ENGINE.Actor',
|
|
148
|
+
* $ctorArgs: [ {data: 3, position: {$class: 'THREE.Vector3', x:1, y:2, z:3}} ],
|
|
149
|
+
* actor properties...
|
|
150
|
+
* }
|
|
151
|
+
*/
|
|
152
|
+
|
|
153
|
+
export const DumperFlags = {
|
|
154
|
+
None: 0,
|
|
155
|
+
AsPrefab: 1 << 0,
|
|
156
|
+
Inline: 2 << 0 // work with AsPrefab, if exists, object will be dumped to modify its prefab, instead of a new prefab based on its prefab.
|
|
157
|
+
} as const;
|
|
158
|
+
export type DumperFlags = typeof DumperFlags[keyof typeof DumperFlags];
|
|
159
|
+
|
|
160
|
+
export interface DumperOptions {
|
|
161
|
+
flags?: DumperFlags,
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export const LoaderFlags = {
|
|
165
|
+
None: 0,
|
|
166
|
+
WithoutEditor: 1 << 0,
|
|
167
|
+
} as const;
|
|
168
|
+
export type LoaderFlags = typeof LoaderFlags[keyof typeof LoaderFlags];
|
|
169
|
+
|
|
170
|
+
export interface LoaderOptions {
|
|
171
|
+
flags?: LoaderFlags,
|
|
172
|
+
ctorArgsOverrides?: Record<string, any>[] | Record<string, any>
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export class Dumper extends Serializer {
|
|
176
|
+
private seen = new WeakMap<any, RefType>();
|
|
177
|
+
private objects: SerializedSubObject[] = [];
|
|
178
|
+
private idCounter = 1;
|
|
179
|
+
private currentRecord: SerializedSubObject | null = null;
|
|
180
|
+
private defaultValues: any = null;
|
|
181
|
+
private refCount = new Map<RefType, number>();
|
|
182
|
+
private pathStack: string[] = [];
|
|
183
|
+
private flags: DumperFlags;
|
|
184
|
+
|
|
185
|
+
constructor(options?: DumperOptions) {
|
|
186
|
+
super();
|
|
187
|
+
this.flags = options?.flags ?? DumperFlags.None;
|
|
188
|
+
if (this.hasFlags(DumperFlags.Inline)) {
|
|
189
|
+
// make sure AsPrefab is also set
|
|
190
|
+
this.flags |= DumperFlags.AsPrefab;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
protected override get isDumping(): boolean { return true; }
|
|
195
|
+
|
|
196
|
+
public hasFlags(flags: DumperFlags): boolean {
|
|
197
|
+
return (this.flags & flags) === flags;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
public get dumpingAsPrefab() {
|
|
201
|
+
return this.hasFlags(DumperFlags.AsPrefab);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
public dump(obj: any): SerializedData {
|
|
205
|
+
if (this.idCounter > 1 || this.objects.length > 0 || this.currentRecord) {
|
|
206
|
+
throw new Error('Dumper instances cannot be reused.');
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
let realPrefabPath: any;
|
|
210
|
+
if (this.hasFlags(DumperFlags.Inline) && obj.$prefab) {
|
|
211
|
+
// modify existing prefab to its parent
|
|
212
|
+
realPrefabPath = obj.$prefab;
|
|
213
|
+
const baseInfo = PrefabManager.getPrefabBaseInfo(realPrefabPath.$path);
|
|
214
|
+
if (baseInfo && isPrefabInfo(baseInfo)) {
|
|
215
|
+
obj.$prefab = baseInfo;
|
|
216
|
+
} else if (baseInfo && isClassInfo(baseInfo)) {
|
|
217
|
+
delete obj.$prefab;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
try {
|
|
222
|
+
const exported = this._dump(obj);
|
|
223
|
+
const objects = this.objects;
|
|
224
|
+
|
|
225
|
+
// result with all data fields serialized
|
|
226
|
+
const rootData: RootSerializedData = {
|
|
227
|
+
$root: exported,
|
|
228
|
+
};
|
|
229
|
+
if (objects.length > 0) {
|
|
230
|
+
rootData.$objects = objects;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// optimize to make objects that are only referenced once inlined
|
|
234
|
+
const optimizedExpandedResult = this._optimize(rootData);
|
|
235
|
+
|
|
236
|
+
// generate diff against base data if applicable
|
|
237
|
+
// const diff = deepDiff(expandedBaseData, optimizedExpandedResult);
|
|
238
|
+
const result: SerializedData = {
|
|
239
|
+
$version: VERSION,
|
|
240
|
+
...optimizedExpandedResult
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
return result;
|
|
244
|
+
} finally {
|
|
245
|
+
if (realPrefabPath) {
|
|
246
|
+
obj.$prefab = realPrefabPath;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
private _optimize(serializedData: RootSerializedData): RootSerializedData {
|
|
252
|
+
// flatten the objects that are only referenced once
|
|
253
|
+
const objectsMap = new Map<RefType, SerializedSubObject>();
|
|
254
|
+
if (serializedData.$objects) {
|
|
255
|
+
for (const record of serializedData.$objects) {
|
|
256
|
+
objectsMap.set(record.$id!, record);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// step 1: inline objects that are only referenced once
|
|
261
|
+
const inlineObject = (obj: any): any => {
|
|
262
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
267
|
+
if (_isRef(v)) {
|
|
268
|
+
const refId = v.$ref;
|
|
269
|
+
const refCount = this.refCount.get(refId)!;
|
|
270
|
+
if (refCount === 1) {
|
|
271
|
+
const record = objectsMap.get(refId)!;
|
|
272
|
+
if (record.$value && typeof record.$value === 'object' && !Array.isArray(record.$value)) {
|
|
273
|
+
const { $value = {}, $id, ...rest } = record;
|
|
274
|
+
obj[k] = {
|
|
275
|
+
...rest,
|
|
276
|
+
...$value,
|
|
277
|
+
};
|
|
278
|
+
} else {
|
|
279
|
+
obj[k] = record.$value;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
inlineObject(obj[k]);
|
|
285
|
+
}
|
|
286
|
+
};
|
|
287
|
+
|
|
288
|
+
// start inlining from the root
|
|
289
|
+
inlineObject(serializedData);
|
|
290
|
+
|
|
291
|
+
// step 2: rebuild the $objects array
|
|
292
|
+
if (serializedData.$objects) {
|
|
293
|
+
serializedData.$objects = serializedData.$objects?.filter(record => {
|
|
294
|
+
const refCount = this.refCount.get(record.$id!)!;
|
|
295
|
+
return refCount > 1;
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
if (serializedData.$objects.length === 0) {
|
|
299
|
+
delete serializedData.$objects;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// step 3: optional, reassign IDs to be sequential, this is mainly to make tests easier compose expected output
|
|
304
|
+
const idMap = new Map<RefType, RefType>();
|
|
305
|
+
let newIdCounter = 1;
|
|
306
|
+
if (serializedData.$objects) {
|
|
307
|
+
for (const record of serializedData.$objects) {
|
|
308
|
+
const oldId = record.$id!;
|
|
309
|
+
const newId = newIdCounter++;
|
|
310
|
+
idMap.set(oldId, newId);
|
|
311
|
+
record.$id = newId;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
const remapRefs = (obj: any) => {
|
|
316
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
317
|
+
return;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
321
|
+
if (_isRef(v)) {
|
|
322
|
+
v.$ref = idMap.get(v.$ref)!;
|
|
323
|
+
if (!v.$ref) {
|
|
324
|
+
throw new Error(`Dumper: remapRefs failed to find new ID for ref ${v.$ref}`);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
remapRefs(obj[k]);
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
|
|
331
|
+
// remap refs in the root object
|
|
332
|
+
remapRefs(serializedData);
|
|
333
|
+
|
|
334
|
+
// step 4: replace { $base: {$class: '...' } } with just {$bc: '...'} for smaller size
|
|
335
|
+
const shortenClassBaseInfoWithoutCtorArgs = (obj: any) => {
|
|
336
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
340
|
+
if (v && typeof v === 'object' && '$base' in v) {
|
|
341
|
+
const baseInfo = v.$base as BaseInfo;
|
|
342
|
+
if (isClassInfo(baseInfo) && !('$ctorArgs' in baseInfo)) {
|
|
343
|
+
(v as any).$bc = baseInfo.$class;
|
|
344
|
+
delete v.$base;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
shortenClassBaseInfoWithoutCtorArgs(v);
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
shortenClassBaseInfoWithoutCtorArgs(serializedData);
|
|
351
|
+
|
|
352
|
+
|
|
353
|
+
// step 5: handle float numbers to reduce size
|
|
354
|
+
const processNumbers = (obj: any) => {
|
|
355
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
360
|
+
if (typeof v === 'number') {
|
|
361
|
+
if (Number.isInteger(v)) {
|
|
362
|
+
obj[k] = v;
|
|
363
|
+
} else {
|
|
364
|
+
obj[k] = Math.round(v * 1000000) / 1000000;
|
|
365
|
+
}
|
|
366
|
+
} else {
|
|
367
|
+
processNumbers(obj[k]);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
|
|
372
|
+
processNumbers(serializedData);
|
|
373
|
+
|
|
374
|
+
return serializedData;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// instanceKey is the key in the parent object, used for getting the value on prefab
|
|
378
|
+
// return true if anything is dumped
|
|
379
|
+
public dumpValue(key: string, value: any, instanceKey?: string, metadata?: PropertyMetadata): DumpValueResult {
|
|
380
|
+
if (metadata?.transient) {
|
|
381
|
+
// skip transient properties
|
|
382
|
+
return DumpValueResult.SkippedTransient;
|
|
383
|
+
}
|
|
384
|
+
if (metadata?.transientOnPrefab && this.dumpingAsPrefab) {
|
|
385
|
+
// skip transientOnPrefab properties when dumping as prefab
|
|
386
|
+
return DumpValueResult.SkippedTransient;
|
|
387
|
+
}
|
|
388
|
+
if (value
|
|
389
|
+
&& typeof value === 'object'
|
|
390
|
+
&& (value[ISerializableObjectTag] === true || value instanceof THREE.Object3D)
|
|
391
|
+
&& value.isTransient
|
|
392
|
+
&& value.isTransient()
|
|
393
|
+
) {
|
|
394
|
+
// transient object, skip it
|
|
395
|
+
return DumpValueResult.SkippedTransient;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
const isCtorArgs = (metadata: PropertyMetadata) => {
|
|
399
|
+
return !!metadata?.ctorArg || metadata?.ctorArgIndex !== undefined;
|
|
400
|
+
};
|
|
401
|
+
if (metadata && isCtorArgs(metadata) && metadata.ctorArg !== 'ctorArgAndProperty') {
|
|
402
|
+
// already dumped as ctorArgs
|
|
403
|
+
return DumpValueResult.SkippedOtherwise;
|
|
404
|
+
}
|
|
405
|
+
if (this.defaultValues) {
|
|
406
|
+
const defaultValue = this.defaultValues[key];
|
|
407
|
+
if (value === null || typeof value !== 'object') {
|
|
408
|
+
if (value === defaultValue) {
|
|
409
|
+
// skip if values strictly equals to base instance value
|
|
410
|
+
return DumpValueResult.SkippedEqualToDefaultValue;
|
|
411
|
+
}
|
|
412
|
+
} else {
|
|
413
|
+
// object type, do a deep comparison
|
|
414
|
+
if (
|
|
415
|
+
defaultValue
|
|
416
|
+
&& Object.getPrototypeOf(value) === Object.getPrototypeOf(defaultValue)
|
|
417
|
+
&& JSON.stringify(value) === JSON.stringify(defaultValue)
|
|
418
|
+
) {
|
|
419
|
+
return DumpValueResult.SkippedEqualToDefaultValue;
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
return this._dumpTo(key, value, this.currentRecord!.$value, instanceKey, metadata) ? DumpValueResult.Dumped : DumpValueResult.SkippedOtherwise;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// [value, propertyName, propertyMetadata]
|
|
428
|
+
public dumpCtorArgs(args: CtorArgProperty[]): void {
|
|
429
|
+
const baseInfo = this.currentRecord!.$base;
|
|
430
|
+
if (!baseInfo || !(baseInfo as ClassInfo).$class)
|
|
431
|
+
{
|
|
432
|
+
// only dump ctor args if $class is present
|
|
433
|
+
// So this would skip
|
|
434
|
+
// - an instance whose base is a prefab
|
|
435
|
+
// - an instance whose base is a class that's not registered,
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
const classInfo = this.currentRecord!.$base as ClassInfo;
|
|
440
|
+
classInfo.$ctorArgs = [];
|
|
441
|
+
for (let i = 0; i < args.length; i++) {
|
|
442
|
+
// TODO: cannot skip dumping ctor args (`args[i].name ?? null` for base's corresponding filed) for now,
|
|
443
|
+
// as it will dump a `{}` if the ctor args are same as base, but it would cause big issue when loading
|
|
444
|
+
// should the base (cdo)'s corresponding ctor args be passed into instances? or do a deep copy? what if there are complex object in ctor args?
|
|
445
|
+
this._dumpTo(String(i), args[i].value, classInfo.$ctorArgs, /*args[i].name ??*/ null, args[i].metadata);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
public removeDumpedValue(key: string) {
|
|
450
|
+
if (key in this.currentRecord!.$value) {
|
|
451
|
+
delete this.currentRecord!.$value[key];
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
private _dumpTo(key: string, value: any, target: any, instanceKey?: string | null, metadata?: PropertyMetadata): boolean {
|
|
456
|
+
let dumped = false;
|
|
457
|
+
this.pathStack.push(key);
|
|
458
|
+
// const fullPath = this.pathStack.join('.');
|
|
459
|
+
// console.log('dumping key:', fullPath);
|
|
460
|
+
if (value !== undefined) {
|
|
461
|
+
// NOTE: if instanceKey is undefined, use `key`; but if `instanceKey` is null, don't use any key to get default values
|
|
462
|
+
const propertyName = instanceKey !== null ? (instanceKey ?? key) : null;
|
|
463
|
+
const defaultValues = propertyName ? this.defaultValues?.[propertyName] : undefined;
|
|
464
|
+
target[key] = this._dump(value, defaultValues, metadata?.serialize);
|
|
465
|
+
dumped = true;
|
|
466
|
+
}
|
|
467
|
+
this.pathStack.pop();
|
|
468
|
+
return dumped;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
public dumpProperties(obj: any) {
|
|
472
|
+
if (!shouldSerializeRespectingMetadata(obj)) {
|
|
473
|
+
const isArray = Array.isArray(obj);
|
|
474
|
+
// no decorated properties, do a deep dump
|
|
475
|
+
let outputIndex = 0;
|
|
476
|
+
const entries = isArray
|
|
477
|
+
? obj.map((val, i) => [i, val] as const)
|
|
478
|
+
: Object.entries(obj);
|
|
479
|
+
|
|
480
|
+
for (const [key, val] of entries) {
|
|
481
|
+
if (!isArray && (key as string).startsWith('$')) continue; // skip special properties, such as $prefab
|
|
482
|
+
|
|
483
|
+
// this has no problem with object, but with array, it can result in `undefined` entries, due to either skipping transient properties or default values
|
|
484
|
+
const dumpKey = isArray ? String(outputIndex) : key as string;
|
|
485
|
+
const dumpResult = this.dumpValue(dumpKey, val);
|
|
486
|
+
if (isArray && dumpResult !== DumpValueResult.SkippedTransient) {
|
|
487
|
+
// don't increase index if skipped due to transient
|
|
488
|
+
outputIndex += 1;
|
|
489
|
+
}
|
|
490
|
+
// TODO: should always dump for array, otherwise [1,2,3,4] changed to [1,2,999,4] will dump only [999], making loader yield incorrect result ([1,2,3,4,999])
|
|
491
|
+
// Should simply do the following
|
|
492
|
+
// `const dumped = this.dumpValue(key as string, val);`
|
|
493
|
+
// however we have an issue here `dumpValue` skips dumping and return undefined for
|
|
494
|
+
// both a value that equals default value, or a value that doesn't need to dump at all (i.e. transient object)
|
|
495
|
+
// [1, 2, 3, 4] -> [1, 2, 999, 4] dumps [undefined, undefined, 999, undefined]
|
|
496
|
+
// [GlobalParticleManager, Actor, Actor] dumps [undefined, {...}, {...}]
|
|
497
|
+
// and further more, `undefined` becomes `null` once stringified. we need to fix this
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
// if obj is an array, and it has default values, let's only record the "diff" here
|
|
501
|
+
if (isArray && Object.keys(this.defaultValues).length > 0) {
|
|
502
|
+
const dumpedArray = this.currentRecord!.$value;
|
|
503
|
+
this.currentRecord!.$value = {};
|
|
504
|
+
for (const [key, val] of Object.entries(dumpedArray)) {
|
|
505
|
+
if (val !== undefined) {
|
|
506
|
+
this.currentRecord!.$value[key] = val;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
const properties = getAllProperties(obj);
|
|
514
|
+
const isCtorArgs = (metadata: PropertyMetadata) => {
|
|
515
|
+
return !!metadata?.ctorArg || metadata?.ctorArgIndex !== undefined;
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
// first dump ctorArgs if exist
|
|
519
|
+
const ctorArgsMeta: Map<string, PropertyMetadata> = new Map(
|
|
520
|
+
[...properties].filter(([key, metadata]) => isCtorArgs(metadata))
|
|
521
|
+
);
|
|
522
|
+
|
|
523
|
+
// warning if multiple properties have same ctorArgIndex, the order is not guaranteed
|
|
524
|
+
if (ctorArgsMeta.size > 1) {
|
|
525
|
+
const indexSet = new Set<number>(
|
|
526
|
+
[...ctorArgsMeta.values()].map(meta => meta.ctorArgIndex ?? 0)
|
|
527
|
+
);
|
|
528
|
+
if (indexSet.size < ctorArgsMeta.size) {
|
|
529
|
+
console.warn('Dumper: Multiple properties have the same ctorArgIndex, the order is not guaranteed.');
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
if (ctorArgsMeta.size > 0) {
|
|
534
|
+
const ctorArgsArray: CtorArgProperty[] = [];
|
|
535
|
+
const sortedCtorArgs = [...ctorArgsMeta].sort((a, b) => {
|
|
536
|
+
const indexA = a[1].ctorArgIndex ?? 0;
|
|
537
|
+
const indexB = b[1].ctorArgIndex ?? 0;
|
|
538
|
+
return indexA - indexB;
|
|
539
|
+
});
|
|
540
|
+
for (const [key, metadata] of sortedCtorArgs) {
|
|
541
|
+
ctorArgsArray.push({ name: key, value: obj[key], metadata });
|
|
542
|
+
}
|
|
543
|
+
this.dumpCtorArgs(ctorArgsArray);
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
// then dump other properties
|
|
547
|
+
for (const [key, metadata] of properties) {
|
|
548
|
+
this.dumpValue(key, obj[key], key, metadata);
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
public markEditorOnly() {
|
|
553
|
+
if (!this.currentRecord?.$meta) {
|
|
554
|
+
this.currentRecord!.$meta = {};
|
|
555
|
+
}
|
|
556
|
+
this.currentRecord!.$meta.editorOnly = true;
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
private getId(obj: any): RefType {
|
|
560
|
+
if (!this.seen.has(obj)) {
|
|
561
|
+
const newId = this.idCounter++;
|
|
562
|
+
this.seen.set(obj, newId);
|
|
563
|
+
this.refCount.set(newId, 0);
|
|
564
|
+
}
|
|
565
|
+
return this.seen.get(obj)!;
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
// valuesOverriddenByPrefab comes from the outer prefab, i.e. from the component data in an actor prefab
|
|
569
|
+
private _dump(obj: any, valuesOverriddenByPrefab?: any, customSerialize?: (obj: any, dumper: Dumper) => any): Ref | any {
|
|
570
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
571
|
+
return obj;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
// Already serialized → return a reference
|
|
575
|
+
if (this.seen.has(obj)) {
|
|
576
|
+
const refId = this.getId(obj);
|
|
577
|
+
if (this.refCount.get(refId) === undefined || this.refCount.get(refId) === 0) {
|
|
578
|
+
throw new Error('Dumper: refCount for object does not exist at this point, this should not happen.');
|
|
579
|
+
}
|
|
580
|
+
this.refCount.set(refId, this.refCount.get(refId)! + 1);
|
|
581
|
+
return { $ref: refId };
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
const defaultValues: any = {};
|
|
585
|
+
Object.assign(defaultValues, getDefaultObject(obj));
|
|
586
|
+
Object.assign(defaultValues, valuesOverriddenByPrefab);
|
|
587
|
+
|
|
588
|
+
const refId = this.getId(obj);
|
|
589
|
+
const record: SerializedSubObject = { $id: refId, $value: Array.isArray(obj) ? [] : {} };
|
|
590
|
+
|
|
591
|
+
let baseInfo: BaseInfo | null = null;
|
|
592
|
+
const prefabPath = obj.$prefab?.$path;
|
|
593
|
+
if (prefabPath) {
|
|
594
|
+
baseInfo = { $path: prefabPath };
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
const clsName = getClassSerializeName(obj);
|
|
598
|
+
if (clsName) {
|
|
599
|
+
baseInfo = { $class: clsName }; // placeholder for ctorArgs
|
|
600
|
+
} else {
|
|
601
|
+
// if it's an unregistered class
|
|
602
|
+
if (typeof obj === 'object' && obj !== null && !Array.isArray(obj)) {
|
|
603
|
+
const proto = Object.getPrototypeOf(obj);
|
|
604
|
+
if (proto !== Object.prototype && proto !== String.prototype && proto !== Number.prototype && proto !== Boolean.prototype) {
|
|
605
|
+
baseInfo = { $class: `${UNREGISTERED_CLASS_PREFIX}${obj.constructor.name}` };
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
if (baseInfo) {
|
|
612
|
+
record.$base = baseInfo;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// actual dumping
|
|
616
|
+
const prevRecord = this.currentRecord;
|
|
617
|
+
this.currentRecord = record;
|
|
618
|
+
|
|
619
|
+
const prevBaseInstance = this.defaultValues;
|
|
620
|
+
this.defaultValues = defaultValues;
|
|
621
|
+
|
|
622
|
+
// push the record first to handle circular references
|
|
623
|
+
this.objects.push(record);
|
|
624
|
+
this.refCount.set(refId, this.refCount.get(refId)! + 1);
|
|
625
|
+
|
|
626
|
+
if (customSerialize) {
|
|
627
|
+
customSerialize(obj, this);
|
|
628
|
+
} else if (isSerializableObject(obj) && obj.serialize) {
|
|
629
|
+
obj.serialize(this);
|
|
630
|
+
} else {
|
|
631
|
+
const serializeFn = getSerializeFn(obj);
|
|
632
|
+
if (serializeFn) {
|
|
633
|
+
serializeFn(obj, this);
|
|
634
|
+
} else {
|
|
635
|
+
this.dumpProperties(obj);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
this.currentRecord = prevRecord;
|
|
639
|
+
this.defaultValues = prevBaseInstance;
|
|
640
|
+
|
|
641
|
+
return { $ref: refId };
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
export class Loader extends Serializer {
|
|
646
|
+
private objMap = new Map<RefType, any>();
|
|
647
|
+
private currentObjectRecord: any = null;
|
|
648
|
+
private objectsData = new Map<RefType, SerializedSubObject>();
|
|
649
|
+
private pathStack: string[] = [];
|
|
650
|
+
private flags: LoaderFlags;
|
|
651
|
+
private ctorArgsOverrides: Record<string, any>;
|
|
652
|
+
|
|
653
|
+
constructor(options?: LoaderOptions) {
|
|
654
|
+
super();
|
|
655
|
+
this.flags = options?.flags ?? LoaderFlags.None;
|
|
656
|
+
this.ctorArgsOverrides = Array.isArray(options?.ctorArgsOverrides) ? options.ctorArgsOverrides : (options?.ctorArgsOverrides ? [options?.ctorArgsOverrides] : []);
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// public API
|
|
660
|
+
public load(data: SerializedData): any {
|
|
661
|
+
return this.loadToInstance(data);
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
public async loadAsync(data: SerializedData): Promise<any> {
|
|
665
|
+
return this.loadToInstanceAsync(data);
|
|
666
|
+
}
|
|
667
|
+
|
|
668
|
+
public loadToInstance(data: SerializedData, target?: Record<string, any> | any[]): any {
|
|
669
|
+
const startTime = performance.now();
|
|
670
|
+
this._prepareLoader(data);
|
|
671
|
+
const result = this._load(data.$root, '$root', target);
|
|
672
|
+
const endTime = performance.now();
|
|
673
|
+
console.log(`Loader.loadToInstance execution time: ${endTime - startTime}ms`);
|
|
674
|
+
return result;
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
public async loadToInstanceAsync(data: SerializedData, target?: Record<string, any> | any[]): Promise<any> {
|
|
678
|
+
const startTime = performance.now();
|
|
679
|
+
this._prepareLoader(data);
|
|
680
|
+
|
|
681
|
+
// collect and load all prefab data first
|
|
682
|
+
const traverseAndLoadPrefabs = async (data: any): Promise<void> => {
|
|
683
|
+
if (data && typeof data === 'object') {
|
|
684
|
+
if (data.$base && isPrefabInfo(data.$base)) {
|
|
685
|
+
const prefabPath = data.$base.$path;
|
|
686
|
+
const prefabData = await PrefabManager.getOrLoadPrefabData(prefabPath);
|
|
687
|
+
// traverse the prefab data
|
|
688
|
+
await traverseAndLoadPrefabs(prefabData);
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
for (const value of Object.values(data)) {
|
|
692
|
+
await traverseAndLoadPrefabs(value);
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
await traverseAndLoadPrefabs(data);
|
|
697
|
+
|
|
698
|
+
const result = this._load(data.$root, '$root', target);
|
|
699
|
+
const endTime = performance.now();
|
|
700
|
+
console.log(`Loader.loadToInstanceAsync execution time: ${endTime - startTime}ms`);
|
|
701
|
+
return result;
|
|
702
|
+
}
|
|
703
|
+
|
|
704
|
+
public hasFlags(flags: LoaderFlags): boolean {
|
|
705
|
+
return (this.flags & flags) === flags;
|
|
706
|
+
}
|
|
707
|
+
// end public API
|
|
708
|
+
|
|
709
|
+
private _prepareLoader(data: SerializedData) {
|
|
710
|
+
if (this.objMap.size > 0 || this.objectsData.size > 0 || this.currentObjectRecord || this.pathStack.length > 0) {
|
|
711
|
+
throw new Error('Loader instances cannot be reused.');
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
if (data.$objects) {
|
|
715
|
+
for (const record of data.$objects) {
|
|
716
|
+
this.objectsData.set(record.$id!, record);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
// convert $bc -> {$base: {$class: ...} }
|
|
721
|
+
const extractClassBaseInfoWithoutCtorArgs = (obj: any) => {
|
|
722
|
+
if (typeof obj !== 'object' || obj === null) {
|
|
723
|
+
return;
|
|
724
|
+
}
|
|
725
|
+
for (const [k, v] of Object.entries(obj)) {
|
|
726
|
+
if (v && typeof v === 'object' && '$bc' in v) {
|
|
727
|
+
const className = v.$bc;
|
|
728
|
+
(v as any).$base = { $class: className };
|
|
729
|
+
delete v.$bc;
|
|
730
|
+
}
|
|
731
|
+
extractClassBaseInfoWithoutCtorArgs(v);
|
|
732
|
+
}
|
|
733
|
+
};
|
|
734
|
+
extractClassBaseInfoWithoutCtorArgs(data);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
private findInstance(id: RefType | null): any | null {
|
|
738
|
+
if (id !== null && this.objMap.has(id)) {
|
|
739
|
+
return this.objMap.get(id) ?? null;
|
|
740
|
+
}
|
|
741
|
+
return null;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
private containsReference(data: any, id: RefType | null): boolean {
|
|
745
|
+
if (id === null) return false;
|
|
746
|
+
if (typeof data !== 'object' || data === null) {
|
|
747
|
+
return false;
|
|
748
|
+
}
|
|
749
|
+
if (_isRef(data)) {
|
|
750
|
+
return data.$ref === id;
|
|
751
|
+
}
|
|
752
|
+
for (const value of Object.values(data)) {
|
|
753
|
+
if (this.containsReference(value, id)) {
|
|
754
|
+
return true;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
return false;
|
|
758
|
+
}
|
|
759
|
+
|
|
760
|
+
private findOrCreateInstance(baseInfo: BaseInfo | undefined, propertiesData: any, id: RefType | null): NonNullable<any> {
|
|
761
|
+
// Already created
|
|
762
|
+
const existingInstance = this.findInstance(id);
|
|
763
|
+
if (existingInstance) {
|
|
764
|
+
return existingInstance;
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
if (baseInfo && isPrefabInfo(baseInfo)) {
|
|
768
|
+
try {
|
|
769
|
+
return instantiatePrefab(baseInfo.$path);
|
|
770
|
+
} catch (error) {
|
|
771
|
+
if (error instanceof Error) {
|
|
772
|
+
// Could happen due to prefab renames, we don't want to crash the game/editor
|
|
773
|
+
console.warn(`Loader: Failed to instantiate prefab at path ${baseInfo.$path}: ${error.message}. Creating plain object instead.`);
|
|
774
|
+
return {};
|
|
775
|
+
} else {
|
|
776
|
+
throw error;
|
|
777
|
+
}
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
|
|
781
|
+
// If it's a class instance
|
|
782
|
+
const clsName = baseInfo && isClassInfo(baseInfo) ? baseInfo.$class : undefined;
|
|
783
|
+
const ctorArgsData = baseInfo && isClassInfo(baseInfo) ? baseInfo.$ctorArgs : undefined;
|
|
784
|
+
const isIdValid = id !== null;
|
|
785
|
+
if (clsName) {
|
|
786
|
+
const cls = getClassForDeserialization(clsName);
|
|
787
|
+
if (!cls) {
|
|
788
|
+
// class not found, leave a warning here
|
|
789
|
+
console.warn(`Loader: Class not found for name ${clsName}, creating plain object instead.`);
|
|
790
|
+
}
|
|
791
|
+
else {
|
|
792
|
+
const makeCtorArgs = (): any[] => {
|
|
793
|
+
const defaultCtorArgs: any[] = [];
|
|
794
|
+
const ctorArgs = (this._load(ctorArgsData, '$ctorArgs', defaultCtorArgs) ?? []) as any[] ;
|
|
795
|
+
if (this.pathStack.length === 1 && this.pathStack[0] === '$root') {
|
|
796
|
+
// TODO: how do we know the root object's ctor args? what if a user makes an Actor, whose constructor takes 3 args, like `new Actor(a,options,b)`?
|
|
797
|
+
// In that case a user when instantiating a prefab will never know what type they're actually dealing with
|
|
798
|
+
// for now I just assume that each element in this.ctorArgsOverrides corresponds to each of the constructor args
|
|
799
|
+
// one way to fix this is to make Dumper yell if Actor/Component contains more than one args
|
|
800
|
+
const overrides = this.ctorArgsOverrides;
|
|
801
|
+
for (let i = 0; i < overrides.length; i++) {
|
|
802
|
+
const o = overrides[i];
|
|
803
|
+
if (o === undefined) continue;
|
|
804
|
+
|
|
805
|
+
if (o === null || Array.isArray(o) || typeof o !== 'object') {
|
|
806
|
+
// override is a primitive, just replace the ctor arg directly
|
|
807
|
+
ctorArgs[i] = o;
|
|
808
|
+
}
|
|
809
|
+
else {
|
|
810
|
+
let target = ctorArgs[i];
|
|
811
|
+
if (target === null || Array.isArray(target) || typeof target !== 'object') {
|
|
812
|
+
target = {};
|
|
813
|
+
ctorArgs[i] = target;
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
Object.assign(target, o);
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
return ctorArgs;
|
|
821
|
+
};
|
|
822
|
+
|
|
823
|
+
if (isIdValid) {
|
|
824
|
+
// if ctorArgs data contains reference to itself,
|
|
825
|
+
// must create a placeholder instance first to handle circular references (by ctorArgs)
|
|
826
|
+
// this happens because we allow passing instances to ctor args, check the following example:
|
|
827
|
+
// class A { constructor(public b: B) {} }
|
|
828
|
+
// class B { constructor(public a: A) {} }
|
|
829
|
+
// const a = new A();
|
|
830
|
+
// const b = new B(a);
|
|
831
|
+
// a.b = b;
|
|
832
|
+
// When deserializing B, we need to create a placeholder for it first, so that A can be constructed and populated properly
|
|
833
|
+
let placeholder: any = null;
|
|
834
|
+
if (this.containsReference(ctorArgsData, id)) {
|
|
835
|
+
placeholder = Object.create(cls.prototype);
|
|
836
|
+
this.objMap.set(id, placeholder);
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
// recursively load ctor args
|
|
840
|
+
const ctorArgs = makeCtorArgs();
|
|
841
|
+
|
|
842
|
+
// Now construct the real instance
|
|
843
|
+
const instance = new cls(...ctorArgs);
|
|
844
|
+
|
|
845
|
+
if (placeholder){
|
|
846
|
+
// Replace the placeholder with the actual instance, but we have no idea if there is anything referencing the placeholder already
|
|
847
|
+
// so it must be mutated in place
|
|
848
|
+
Object.assign(placeholder, instance);
|
|
849
|
+
return placeholder;
|
|
850
|
+
} else {
|
|
851
|
+
this.objMap.set(id, instance);
|
|
852
|
+
return instance;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
else {
|
|
856
|
+
// no $id, meaning it's not a referenced object, just create it directly
|
|
857
|
+
const ctorArgs = makeCtorArgs();
|
|
858
|
+
const instance = new cls(...ctorArgs);
|
|
859
|
+
return instance;
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const instance = Array.isArray(propertiesData) ? [] : {};
|
|
865
|
+
if (isIdValid) {
|
|
866
|
+
this.objMap.set(id, instance);
|
|
867
|
+
}
|
|
868
|
+
return instance;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
private _populate(value: any, key: string, target: any, baseInfo: BaseInfo | null, metadata?: PropertyMetadata): void {
|
|
872
|
+
const prevObjectRecord = this.currentObjectRecord;
|
|
873
|
+
this.currentObjectRecord = value;
|
|
874
|
+
|
|
875
|
+
// target ??= Array.isArray(value) ? [] : {};
|
|
876
|
+
|
|
877
|
+
if (metadata?.deserialize) {
|
|
878
|
+
// if metadata has custom deserialize function, use it
|
|
879
|
+
metadata.deserialize(target, this);
|
|
880
|
+
} else if (isSerializableObject(target) && target.deserialize) {
|
|
881
|
+
// If it's a class instance and implements ISerializableObject, call its serialize method
|
|
882
|
+
target.deserialize(this);
|
|
883
|
+
} else {
|
|
884
|
+
const deserializeFn = getDeserializeFn(target);
|
|
885
|
+
if (deserializeFn) {
|
|
886
|
+
deserializeFn(target, this);
|
|
887
|
+
} else {
|
|
888
|
+
this.loadProperties(target);
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
if (baseInfo && isPrefabInfo(baseInfo) && baseInfo.$path) {
|
|
893
|
+
target.$prefab = { $path: baseInfo.$path };
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
this.currentObjectRecord = prevObjectRecord;
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
private _matchesExisting(existing: any, refId: RefType | undefined, className: string | null, dataValue: any): boolean {
|
|
900
|
+
if (refId !== undefined && this.objMap.has(refId)) {
|
|
901
|
+
// if it's a referenced object, must match by identity
|
|
902
|
+
return this.objMap.get(refId) === existing;
|
|
903
|
+
}
|
|
904
|
+
if (Array.isArray(existing) && Array.isArray(dataValue)) {
|
|
905
|
+
return true;
|
|
906
|
+
}
|
|
907
|
+
if (className) {
|
|
908
|
+
const cls = getClassForDeserialization(className);
|
|
909
|
+
if (cls) {
|
|
910
|
+
// registered class
|
|
911
|
+
if (!(existing instanceof cls)) return false;
|
|
912
|
+
const existingInstanceClsName = getClassSerializeName(existing);
|
|
913
|
+
if (existingInstanceClsName !== className) return false;
|
|
914
|
+
|
|
915
|
+
// There should be an absolute truth here to tell if the serialized data matches the existing instance
|
|
916
|
+
// For now I can only guess
|
|
917
|
+
if (existing.name && dataValue?.name && existing.name !== dataValue.name) {
|
|
918
|
+
return false;
|
|
919
|
+
}
|
|
920
|
+
|
|
921
|
+
// return true here for now
|
|
922
|
+
return true;
|
|
923
|
+
} else {
|
|
924
|
+
if (className.startsWith(UNREGISTERED_CLASS_PREFIX)) {
|
|
925
|
+
// unregistered class, just check the constructor name
|
|
926
|
+
const expectedCtorName = className.substring(UNREGISTERED_CLASS_PREFIX.length);
|
|
927
|
+
return existing.constructor.name === expectedCtorName;
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
} else if (typeof existing === 'object' && existing !== null && !Array.isArray(existing)) {
|
|
931
|
+
// plain object, return true because we have no way to tell its default state, so basically treating the existing instance as "default"
|
|
932
|
+
return true;
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
return false;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
// target is the existing object to resolve into if it's able to
|
|
939
|
+
// it is required so as to avoid re-creating objects that are already present
|
|
940
|
+
public loadValue(key: string, target?: any, metadata?: PropertyMetadata): any {
|
|
941
|
+
return this._load(this.currentObjectRecord[key], key, target, metadata);
|
|
942
|
+
}
|
|
943
|
+
|
|
944
|
+
private _findClass(baseInfo: BaseInfo, seen?: Set<string>): string | null {
|
|
945
|
+
if (isClassInfo(baseInfo)) {
|
|
946
|
+
return baseInfo.$class;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
seen ??= new Set<string>();
|
|
950
|
+
|
|
951
|
+
const prefabPath = isPrefabInfo(baseInfo) ? baseInfo.$path : null;
|
|
952
|
+
if (prefabPath) {
|
|
953
|
+
if (seen.has(prefabPath)) {
|
|
954
|
+
throw new Error(`Loader: Circular prefab reference detected for prefab ${prefabPath}, aborting class lookup.`);
|
|
955
|
+
}
|
|
956
|
+
seen.add(prefabPath);
|
|
957
|
+
const baseInfo = PrefabManager.getPrefabBaseInfo(prefabPath);
|
|
958
|
+
if (baseInfo) {
|
|
959
|
+
return this._findClass(baseInfo, seen);
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
return null;
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
// key is only for path tracking, but it's required just to be clear
|
|
967
|
+
private _load(serializedValue: any, key: string, target?: any, metadata?: PropertyMetadata): any {
|
|
968
|
+
const _internalLoad = (serializedValue: any, key: string, target: any, metadata: PropertyMetadata) => {
|
|
969
|
+
if (Array.isArray(serializedValue) || Array.isArray(target)) {
|
|
970
|
+
// if `serializedValue` is array, `target` may or may not be an array. Usually it's not, but if calling `loadInstanceTo(data, [])`, then it can can be an array
|
|
971
|
+
if (Array.isArray(serializedValue)) {
|
|
972
|
+
const result = serializedValue.map((v, index) => this._load(serializedValue[index], String(index), Array.isArray(target) ? target[index] : undefined));
|
|
973
|
+
if (Array.isArray(target)) {
|
|
974
|
+
// push into the items that's not already present
|
|
975
|
+
const seen = new Set(target);
|
|
976
|
+
target.push(...result.filter(item => !seen.has(item)));
|
|
977
|
+
return target;
|
|
978
|
+
}
|
|
979
|
+
return result;
|
|
980
|
+
}
|
|
981
|
+
else if (serializedValue && typeof serializedValue === 'object'){
|
|
982
|
+
// target is an array, but serializedValue is not. It means we have a default value being array,
|
|
983
|
+
// and `serializedValue` is a delta, that contains { index -> overriddenValue }
|
|
984
|
+
const result = target;
|
|
985
|
+
for (const [k, v] of Object.entries(serializedValue)) {
|
|
986
|
+
result[k] = this._load(serializedValue[k], String(k), result[k]);
|
|
987
|
+
}
|
|
988
|
+
return result;
|
|
989
|
+
}
|
|
990
|
+
}
|
|
991
|
+
else if (!serializedValue || typeof serializedValue !== 'object') {
|
|
992
|
+
return serializedValue;
|
|
993
|
+
} else {
|
|
994
|
+
// handle object, two possible cases for `serializedValue`:
|
|
995
|
+
// a ref obj: { $ref: 1 }
|
|
996
|
+
// full serialized object: { $value: {...}, $class?: 'ClassName', $ctorArgs?: [...] }, note $class and $ctorArgs are optional
|
|
997
|
+
// it's always two steps: instantiate the object (findOrCreateInstance), then populate its properties (_populate)
|
|
998
|
+
|
|
999
|
+
let referencedObject: SerializedSubObject | null = null;
|
|
1000
|
+
if (_isRef(serializedValue)) {
|
|
1001
|
+
const refId = serializedValue.$ref;
|
|
1002
|
+
const record = this.objectsData.get(refId);
|
|
1003
|
+
if (!record) throw new Error(`Loader: No object record found for ref ${refId}`);
|
|
1004
|
+
referencedObject = record;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
const existingInstance = this.findInstance(referencedObject?.$id ?? null);
|
|
1008
|
+
if (existingInstance) {
|
|
1009
|
+
return existingInstance;
|
|
1010
|
+
}
|
|
1011
|
+
|
|
1012
|
+
const data = referencedObject ? referencedObject.$value : serializedValue;
|
|
1013
|
+
const meta = referencedObject ? referencedObject.$meta : serializedValue.$meta;
|
|
1014
|
+
if (meta?.editorOnly && this.hasFlags(LoaderFlags.WithoutEditor)) {
|
|
1015
|
+
return null;
|
|
1016
|
+
}
|
|
1017
|
+
const baseInfo: BaseInfo | undefined = referencedObject ? referencedObject.$base : serializedValue.$base;
|
|
1018
|
+
|
|
1019
|
+
// if the instance doesn't exist yet, and it's not required to populate value onto a given target
|
|
1020
|
+
// we can give user a chance to construct and populate an instance using `data`, `cls` and `ctorArgsData`
|
|
1021
|
+
// but for now let's only use it internally by specialization
|
|
1022
|
+
if (!target) {
|
|
1023
|
+
const cls: string | undefined = baseInfo && isClassInfo(baseInfo) ? baseInfo.$class : undefined;
|
|
1024
|
+
const staticDeserializeFn = getStaticDeserializeFn(cls);
|
|
1025
|
+
if (staticDeserializeFn) {
|
|
1026
|
+
let instance;
|
|
1027
|
+
if (typeof data !== 'object' || data === null) {
|
|
1028
|
+
instance = staticDeserializeFn(data);
|
|
1029
|
+
}
|
|
1030
|
+
else {
|
|
1031
|
+
// extract data for user in case it contains complex type
|
|
1032
|
+
const extracted: any = Array.isArray(data) ? [] : {};
|
|
1033
|
+
for (const [k, v] of Object.entries(data)) {
|
|
1034
|
+
if (k.startsWith('$')) continue;
|
|
1035
|
+
extracted[k] = this._load(v, k);
|
|
1036
|
+
}
|
|
1037
|
+
instance = staticDeserializeFn(extracted);
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
if (instance) {
|
|
1041
|
+
// it's important to always add to objMap to prevent circular reference issues
|
|
1042
|
+
if (referencedObject && !this.objMap.has(referencedObject.$id!)) {
|
|
1043
|
+
this.objMap.set(referencedObject.$id!, instance);
|
|
1044
|
+
}
|
|
1045
|
+
return instance;
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
// should we directly load into target, or should we create a new instance
|
|
1051
|
+
// this is common case for loading into a component on actor, which is also created in the actor's ctor
|
|
1052
|
+
const cls = baseInfo ? this._findClass(baseInfo) : null;
|
|
1053
|
+
const result = target && this._matchesExisting(target, referencedObject?.$id, cls, serializedValue) ?
|
|
1054
|
+
target :
|
|
1055
|
+
// objMap is set in findOrCreateInstance
|
|
1056
|
+
this.findOrCreateInstance(
|
|
1057
|
+
baseInfo,
|
|
1058
|
+
serializedValue, // pass the whole object for properties, though we could remove $class and $ctorArgs for clarity
|
|
1059
|
+
referencedObject?.$id ?? null
|
|
1060
|
+
);
|
|
1061
|
+
|
|
1062
|
+
// must do it prior to _populate to avoid circular reference issues
|
|
1063
|
+
if (referencedObject && !this.objMap.has(referencedObject.$id!)) {
|
|
1064
|
+
this.objMap.set(referencedObject.$id!, result);
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
this._populate(data, key, result, baseInfo ?? null, metadata);
|
|
1068
|
+
return result;
|
|
1069
|
+
}
|
|
1070
|
+
};
|
|
1071
|
+
|
|
1072
|
+
this.pathStack.push(key);
|
|
1073
|
+
// // skip the first $root
|
|
1074
|
+
// const fullPath = this.pathStack.slice(1).join('.');
|
|
1075
|
+
// console.log('loading key:', fullPath);
|
|
1076
|
+
const loaded = _internalLoad(serializedValue, key, target, metadata ?? {});
|
|
1077
|
+
this.pathStack.pop();
|
|
1078
|
+
return loaded;
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
public loadProperties(obj: any) {
|
|
1082
|
+
if (!shouldSerializeRespectingMetadata(obj)) {
|
|
1083
|
+
const modifiedKeys = new Set();
|
|
1084
|
+
for (const [key, val] of Object.entries(this.currentObjectRecord)) {
|
|
1085
|
+
if (key.startsWith('$')) continue; // skip the special fields
|
|
1086
|
+
modifiedKeys.add(key);
|
|
1087
|
+
const loaded = this._load(this.currentObjectRecord[key], key, obj[key]);
|
|
1088
|
+
if (loaded === obj[key]) continue; // skip assignment if same
|
|
1089
|
+
obj[key] = loaded;
|
|
1090
|
+
}
|
|
1091
|
+
return;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
const properties = getAllProperties(obj);
|
|
1095
|
+
for (const [key, metadata] of properties) {
|
|
1096
|
+
if (key in this.currentObjectRecord) {
|
|
1097
|
+
if (metadata?.editorOnly && this.hasFlags(LoaderFlags.WithoutEditor)) {
|
|
1098
|
+
// skip editorOnly properties when not loading with editor
|
|
1099
|
+
// but should I mark the property as undefined on the object?
|
|
1100
|
+
continue;
|
|
1101
|
+
}
|
|
1102
|
+
// don't worry about transient properties here, they are already skipped when dumping
|
|
1103
|
+
const val = this.currentObjectRecord[key];
|
|
1104
|
+
const result = this._load(val, key, obj[key], metadata);
|
|
1105
|
+
if (result !== obj[key]) {
|
|
1106
|
+
obj[key] = result;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|