@dcl/playground-assets 7.2.4 → 7.2.5-5349283574.commit-e063cf0
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.
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/sdk",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.2.
|
|
4
|
+
"version": "7.2.5-5349283574.commit-e063cf0",
|
|
5
5
|
"author": "Decentraland",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"@dcl/ecs": "file:../ecs",
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"types": "./index.d.ts",
|
|
36
36
|
"typings": "./index.d.ts",
|
|
37
|
-
"commit": "
|
|
37
|
+
"commit": "e063cf0ef37943aaa6d25b05b3834ff348ebdf3e"
|
|
38
38
|
}
|
|
@@ -1,24 +1,7 @@
|
|
|
1
1
|
import { Color4 } from '@dcl/sdk/math'
|
|
2
|
-
import ReactEcs, {
|
|
3
|
-
UiEntity,
|
|
4
|
-
Label,
|
|
5
|
-
ReactEcsRenderer,
|
|
6
|
-
Dropdown
|
|
7
|
-
} from '@dcl/sdk/react-ecs'
|
|
2
|
+
import ReactEcs, { UiEntity, Label, ReactEcsRenderer, Dropdown } from '@dcl/sdk/react-ecs'
|
|
8
3
|
|
|
9
|
-
const colorList = [
|
|
10
|
-
'Red',
|
|
11
|
-
'Green',
|
|
12
|
-
'Blue',
|
|
13
|
-
'Black',
|
|
14
|
-
'White',
|
|
15
|
-
'Purple',
|
|
16
|
-
'Magenta',
|
|
17
|
-
'Yellow',
|
|
18
|
-
'Gray',
|
|
19
|
-
'Teal',
|
|
20
|
-
'Clear'
|
|
21
|
-
]
|
|
4
|
+
const colorList = ['Red', 'Green', 'Blue', 'Black', 'White', 'Purple', 'Magenta', 'Yellow', 'Gray', 'Teal', 'Clear']
|
|
22
5
|
|
|
23
6
|
let selectedColorIndex = 0
|
|
24
7
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
1
2
|
import {
|
|
2
3
|
Entity,
|
|
3
4
|
engine,
|
|
@@ -5,15 +6,12 @@ import {
|
|
|
5
6
|
MeshRenderer,
|
|
6
7
|
MeshCollider,
|
|
7
8
|
InputAction,
|
|
8
|
-
inputSystem,
|
|
9
9
|
PointerEvents,
|
|
10
10
|
PointerEventType
|
|
11
11
|
} from '@dcl/sdk/ecs'
|
|
12
12
|
import { Vector3, Color4, Quaternion } from '@dcl/sdk/math'
|
|
13
13
|
import { ReactEcs, UiEntity, Label, ReactEcsRenderer, Button } from '@dcl/sdk/react-ecs'
|
|
14
14
|
|
|
15
|
-
let counter = 0
|
|
16
|
-
|
|
17
15
|
// Cube factory
|
|
18
16
|
function createCube(x: number, y: number, z: number, spawner = true): Entity {
|
|
19
17
|
const meshEntity = engine.addEntity()
|
|
@@ -51,19 +49,9 @@ function circularSystem(dt: number) {
|
|
|
51
49
|
}
|
|
52
50
|
}
|
|
53
51
|
|
|
54
|
-
function spawnerSystem() {
|
|
55
|
-
const clickedCubes = engine.getEntitiesWith(PointerEvents)
|
|
56
|
-
for (const [entity] of clickedCubes) {
|
|
57
|
-
if (inputSystem.isTriggered(InputAction.IA_PRIMARY, PointerEventType.PET_DOWN, entity)) {
|
|
58
|
-
counter++
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
52
|
// Init
|
|
64
53
|
createCube(8, 1, 8)
|
|
65
54
|
engine.addSystem(circularSystem)
|
|
66
|
-
engine.addSystem(spawnerSystem)
|
|
67
55
|
|
|
68
56
|
type GenesisPlazaContent = string
|
|
69
57
|
const sceneThumbnail: GenesisPlazaContent = 'models/Magazinev1.png'
|
|
@@ -76,7 +64,7 @@ const uiComponent = () => (
|
|
|
76
64
|
// { top: 16, right: 0, bottom: 8 left: 270 },
|
|
77
65
|
margin: '16px 0 8px 270px',
|
|
78
66
|
// { top: 4, bottom: 4, left: 4, right: 4 },
|
|
79
|
-
padding: 4
|
|
67
|
+
padding: 4
|
|
80
68
|
}}
|
|
81
69
|
uiBackground={{ color: Color4.create(0.5, 0.8, 0.1, 0.6) }}
|
|
82
70
|
>
|
|
@@ -88,7 +76,7 @@ const uiComponent = () => (
|
|
|
88
76
|
alignItems: 'center',
|
|
89
77
|
justifyContent: 'space-between'
|
|
90
78
|
}}
|
|
91
|
-
uiBackground={{ color: Color4.fromHexString(
|
|
79
|
+
uiBackground={{ color: Color4.fromHexString('#70ac76ff') }}
|
|
92
80
|
>
|
|
93
81
|
<UiEntity
|
|
94
82
|
uiTransform={{
|
|
@@ -99,27 +87,31 @@ const uiComponent = () => (
|
|
|
99
87
|
uiBackground={{
|
|
100
88
|
textureMode: 'center',
|
|
101
89
|
texture: {
|
|
102
|
-
src: sceneThumbnail
|
|
103
|
-
}
|
|
90
|
+
src: sceneThumbnail
|
|
91
|
+
}
|
|
104
92
|
}}
|
|
105
93
|
uiText={{ value: 'SDK7', fontSize: 18 }}
|
|
106
94
|
/>
|
|
107
95
|
<Label
|
|
108
|
-
onMouseDown={() => {
|
|
96
|
+
onMouseDown={() => {
|
|
97
|
+
console.log('Player Position clicked !')
|
|
98
|
+
}}
|
|
109
99
|
value={`Player: ${getPlayerPosition()}`}
|
|
110
100
|
fontSize={18}
|
|
111
|
-
uiTransform={{ width: '100%', height: 30 }
|
|
101
|
+
uiTransform={{ width: '100%', height: 30 }}
|
|
112
102
|
/>
|
|
113
103
|
<Label
|
|
114
|
-
onMouseDown={() => {
|
|
104
|
+
onMouseDown={() => {
|
|
105
|
+
console.log('# Cubes clicked !')
|
|
106
|
+
}}
|
|
115
107
|
value={`# Cubes: ${[...engine.getEntitiesWith(MeshRenderer)].length}`}
|
|
116
108
|
fontSize={18}
|
|
117
|
-
uiTransform={{ width: '100%', height: 30 }
|
|
109
|
+
uiTransform={{ width: '100%', height: 30 }}
|
|
118
110
|
/>
|
|
119
111
|
<Button
|
|
120
112
|
uiTransform={{ width: 100, height: 40, margin: 8 }}
|
|
121
|
-
value=
|
|
122
|
-
variant=
|
|
113
|
+
value="Spawn cube"
|
|
114
|
+
variant="primary"
|
|
123
115
|
fontSize={14}
|
|
124
116
|
onMouseDown={() => {
|
|
125
117
|
createCube(1 + Math.random() * 8, Math.random() * 8, 1 + Math.random() * 8, false)
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/playground-assets",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "7.2.
|
|
4
|
+
"version": "7.2.5-5349283574.commit-e063cf0",
|
|
5
5
|
"author": "Decentraland",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dcl/js-runtime": "7.2.
|
|
8
|
-
"@dcl/sdk": "7.2.
|
|
7
|
+
"@dcl/js-runtime": "7.2.5-5349283574.commit-e063cf0",
|
|
8
|
+
"@dcl/sdk": "7.2.5-5349283574.commit-e063cf0"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@microsoft/api-extractor": "^7.33.8"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
},
|
|
33
33
|
"types": "./dist/index.d.ts",
|
|
34
34
|
"typings": "./dist/index.d.ts",
|
|
35
|
-
"commit": "
|
|
35
|
+
"commit": "e063cf0ef37943aaa6d25b05b3834ff348ebdf3e"
|
|
36
36
|
}
|