> For the complete documentation index, see [llms.txt](https://docs.decentraland.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/skybox-control.md).

# 스카이박스 제어

스카이박스 시간을 변경하세요

플레이어가 당신의 씬에 서 있을 때마다 스카이박스를 어떻게 보게 할지 변경할 수 있으며, 이는 전역 조명의 색조와 방향에도 영향을 줍니다.

Decentraland의 하늘은 완료하는 데 2시간이 걸리는 기본 낮/밤 주기를 따르므로, 실제 하루에 12번의 전체 주기가 있습니다. 씬이 고정된 시간대를 강제하지 않는다면, 플레이어는 UI의 슬라이더를 조정하여 특정 시간대로 전환할 수도 있습니다.

플레이어가 다른 시간대의 씬에 들어오거나, 씬이 동적으로 시간대를 변경할 때마다 스카이박스는 몇 초에 걸쳐 이 새로운 값으로 부드럽게 전환됩니다.

## 고정된 시간대

씬에 고정된 시간대를 설정할 수 있습니다. 모든 플레이어는 이 시간대의 씬을 보게 되며, 스카이박스는 낮/밤 주기를 따르지 않습니다.

Creator Hub에서 씬 설정을 열고 **설정** 탭을 클릭해 **스카이박스** 섹션을 찾으세요. **자동** 옵션을 클릭한 다음 원하는 시간대를 설정하세요.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-85bd070c455c7e5852eba1e78902edb88dbfd17b%2Ffixed-time-of-day.png?alt=media)

씬 코드에서도 스카이박스 시간대를 설정할 수 있습니다. 이렇게 하려면 다음 섹션을 `scene.json` 루트 수준에 추가할 수도 있습니다:

```json
 "skyboxConfig": {
    "fixedTime": 36000
  }
```

이 숫자는 하루가 시작된 이후의 초 수를 의미하며, 0부터(이는 *00:00*)부터 86400까지(이는 *24:00*). 86400보다 큰 숫자도 자정으로 해석됩니다.

유효한 값의 추가 예시는 다음과 같습니다:

* 0초 => *00:00*
* 21600초 => *06:00*
* 43200초 => *12:00*
* 64800초 => *18:00*
* 86400초 => *24:00*

## 시간대 읽기

다음을 사용하여 씬 코드에서 시간대를 읽을 수 있습니다: `getWorldTime()` 함수를 실행 중이라고 가정합니다.

```ts
import { getWorldTime } from '~system/Runtime'

executeTask(async () => {
  let time = await getWorldTime({})
  console.log(time.seconds)
})
```

이 함수는 0과 86400 사이의 숫자를 반환하며, 0은 자정이고 86400은 24:00입니다. 씬이 시간대를 동적으로 변경하거나 플레이어가 UI에서 시간대를 변경하면 이 값이 업데이트됩니다. 그렇지 않으면 기본 낮/밤 주기에 상대적인 값을 반환합니다.

## 시간대를 동적으로 변경하기

다음을 사용하여 시간대를 동적으로 변경할 수 있습니다: `SkyboxTime` 컴포넌트입니다. 이 컴포넌트는 씬의 루트 엔티티에만 추가할 수 있습니다 `engine.RootEntity`.

```ts
import { SkyboxTime } from '@dcl/sdk/ecs'

function main() {
  SkyboxTime.create(engine.RootEntity, { fixedTime: 36000 })
}
```

그 `fixed_time` 속성은 0과 86400 사이의 숫자이며, 0은 자정이고 86400은 24:00입니다. 86400보다 큰 숫자도 자정으로 해석됩니다.

이 컴포넌트가 추가되거나 제거되거나, 또는 `fixed_time` 속성이 변경될 때마다 스카이박스의 시간대는 몇 초에 걸쳐 이 새 값으로 부드럽게 전환됩니다. 플레이어가 씬 밖으로 나가거나 씬 안으로 들어올 때도 동일하게 발생합니다. 스카이박스의 시간대가 고정되면, 스카이박스는 더 이상 낮/밤 주기의 진행을 따르지 않으며 플레이어는 UI를 통해 시간대를 변경할 수 없습니다.

기본적으로 전환은 항상 정방향으로 발생하지만, 다음을 설정하여 이를 변경할 수 있습니다: `transitionMode` 속성을 `TransitionMode.TM_FORWARD` 또는 `TransitionMode.TM_BACKWARD`.

```ts
import { SkyboxTime, TransitionMode } from '@dcl/sdk/ecs'

function main() {
  SkyboxTime.create(engine.RootEntity, { fixedTime: 36000, transitionMode: TransitionMode.TM_BACKWARD })
}
```

{% hint style="info" %}
**💡 팁**: 스카이박스 제어의 작업 예시는 다음을 참조하세요: [`2,1-skybox-sdk-scene-a`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/2,1-skybox-sdk-scene-a) 및 [`3,1-skybox-sdk-scene-b`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/3,1-skybox-sdk-scene-b) 테스트 씬을 참조하세요. 해당 씬에서는 `SkyboxTime` 및 `TransitionMode` 를 UI 패널에서 실시간으로 조정하며, 그리고 [`2,0-skybox-scene-json`](https://github.com/decentraland/sdk7-test-scenes/tree/main/scenes/2,0-skybox-scene-json)에서는 다음을 읽습니다: `fixedTime` 에 설정된 `scene.json` 런타임에 다음을 통해 다시 `getSceneInformation()`.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.decentraland.org/creator/content-creator-ko/sdk7/interactivity/skybox-control.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
