File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
packages/@dcl/inspector/src/lib/data-layer/host/utils/migrations Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { IEngine , LastWriteWinElementSetComponentDefinition } from '@dcl/ecs'
2
+
3
+ import { EditorComponentNames , EditorComponentsTypes } from '../../../../sdk/components'
4
+ import { GizmoType } from '../../../../utils/gizmo'
5
+
6
+ export function selectSceneEntity ( engine : IEngine ) {
7
+ const Selection = engine . getComponentOrNull (
8
+ EditorComponentNames . Selection
9
+ ) as LastWriteWinElementSetComponentDefinition < EditorComponentsTypes [ 'Selection' ] > | null
10
+
11
+ if ( Selection ) {
12
+ for ( const [ entity ] of engine . getEntitiesWith ( Selection ) ) {
13
+ Selection . deleteFrom ( entity )
14
+ }
15
+
16
+ function system ( ) {
17
+ engine . removeSystem ( system )
18
+ Selection ! . createOrReplace ( engine . RootEntity , { gizmo : GizmoType . FREE } )
19
+ }
20
+
21
+ engine . addSystem ( system )
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments