1
1
import React , { useEffect } from 'react'
2
2
3
+ import { EntityUUID } from '@etherealengine/common/src/interfaces/EntityUUID'
4
+ import { isClient } from '@etherealengine/common/src/utils/getEnvironment'
5
+ import { SimulationSystemGroup , defineSystem , getComponent , setComponent } from '@etherealengine/ecs'
6
+ import { ECSState } from '@etherealengine/ecs/src/ECSState'
7
+ import { PrimitiveGeometryComponent } from '@etherealengine/engine/src/scene/components/PrimitiveGeometryComponent'
8
+ import { GeometryTypeEnum } from '@etherealengine/engine/src/scene/constants/GeometryTypeEnum'
3
9
import {
4
10
defineAction ,
5
11
defineState ,
@@ -9,23 +15,13 @@ import {
9
15
none ,
10
16
useHookstate
11
17
} from '@etherealengine/hyperflux'
12
-
13
- import { EntityUUID } from '@etherealengine/common/src/interfaces/EntityUUID'
14
-
15
- import { NetworkTopics } from '@etherealengine/spatial/src/networking/classes/Network'
16
- import { WorldNetworkAction } from '@etherealengine/spatial/src/networking/functions/WorldNetworkAction'
17
-
18
- import { isClient } from '@etherealengine/common/src/utils/getEnvironment'
19
- import { SimulationSystemGroup , defineSystem , getComponent , setComponent } from '@etherealengine/ecs'
20
- import { ECSState } from '@etherealengine/ecs/src/ECSState'
21
- import { PrimitiveGeometryComponent } from '@etherealengine/engine/src/scene/components/PrimitiveGeometryComponent'
22
- import { GeometryTypeEnum } from '@etherealengine/engine/src/scene/constants/GeometryTypeEnum'
18
+ import { NetworkState , NetworkTopics , WorldNetworkAction } from '@etherealengine/network'
23
19
import { NameComponent } from '@etherealengine/spatial/src/common/NameComponent'
24
20
import { UUIDComponent } from '@etherealengine/spatial/src/common/UUIDComponent'
25
- import { NetworkState } from '@etherealengine/spatial/src/networking/NetworkState'
26
21
import { ColliderComponent } from '@etherealengine/spatial/src/physics/components/ColliderComponent'
27
22
import { RigidBodyComponent } from '@etherealengine/spatial/src/physics/components/RigidBodyComponent'
28
23
import { VisibleComponent } from '@etherealengine/spatial/src/renderer/components/VisibleComponent'
24
+ import { SpawnObjectActions } from '@etherealengine/spatial/src/transform/SpawnObjectActions'
29
25
import { TransformComponent } from '@etherealengine/spatial/src/transform/components/TransformComponent'
30
26
import { Vector3 } from 'three'
31
27
@@ -36,7 +32,7 @@ import { Vector3 } from 'three'
36
32
37
33
const BasicActions = {
38
34
spawnAction : defineAction (
39
- WorldNetworkAction . spawnObject . extend ( {
35
+ SpawnObjectActions . spawnObject . extend ( {
40
36
type : 'ee.basic.SPAWN_OBJECT' ,
41
37
$topic : NetworkTopics . world
42
38
} )
@@ -57,7 +53,7 @@ const BasicState = defineState({
57
53
const state = getMutableState ( BasicState )
58
54
state [ action . entityUUID ] . merge ( { } )
59
55
} ) ,
60
- onDestroyObject : WorldNetworkAction . destroyObject . receive ( ( action ) => {
56
+ onDestroyObject : WorldNetworkAction . destroyEntity . receive ( ( action ) => {
61
57
const state = getMutableState ( BasicState )
62
58
state [ action . entityUUID ] . set ( none )
63
59
} )
0 commit comments