Skip to content

Commit

Permalink
Merge branch 'main' into new-FAQs
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Earnshaw <[email protected]>
  • Loading branch information
nearnshaw authored Nov 21, 2024
2 parents ed49028 + e6f893f commit cf81385
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions content/creator/scene-editor/smart-items/combine-with-code.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ For example, if a scene has a button with the following generic **On Click** eve
<img src="/images/editor/restart-button.png" width="600" />

```ts
import { engine } from '@dcl/sdk/ecs'
import { getTriggerEvents, getActionEvents } from '@dcl/asset-packs/dist/events'
import { TriggerType } from '@dcl/asset-packs'

Expand All @@ -114,6 +115,7 @@ You can also use custom code to activate trigger events based on your own custom
<img src="/images/editor/door-triggers.png" width="600" />
```ts
import { engine } from '@dcl/sdk/ecs'
import { getTriggerEvents, getActionEvents } from '@dcl/asset-packs/dist/events'
import { TriggerType } from '@dcl/asset-packs'
Expand All @@ -137,6 +139,7 @@ For example, if a scene has a door with the following default **Open** action, y
<img src="/images/editor/door-actions.png" width="600" />

```ts
import { engine } from '@dcl/sdk/ecs'
import { getTriggerEvents, getActionEvents } from '@dcl/asset-packs/dist/events'
import { TriggerType } from '@dcl/asset-packs'

Expand All @@ -163,6 +166,7 @@ function main() {
You can also emit action events from your code, this allows you to take advantage of actions that are already defined inside the smart item's Action component. The following snippet calls the "Open" action on a door smart item whenever a button smart item is triggered.

```ts
import { engine } from '@dcl/sdk/ecs'
import { getTriggerEvents, getActionEvents } from '@dcl/asset-packs/dist/events'
import { TriggerType } from '@dcl/asset-packs'

Expand Down
2 changes: 1 addition & 1 deletion content/creator/sdk7/interactivity/runtime-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ Players can access Decentraland via various platforms, currently via the browser
Use `getPlatform()` to know what platform the current player is running Decentraland on.

```ts
import { getPlatform } from '~system/EnvironmentAPI'
import { getPlatform } from '~system/EnvironmentApi'

executeTask(async () => {
let data = await getPlatform()
Expand Down

0 comments on commit cf81385

Please sign in to comment.