> 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\&token=56081304-f57b-475b-94e4-07c292805637)

또한 씬 코드에서도 스카이박스 시간을 설정할 수 있습니다. 그러려면 다음 섹션을 여러분의 `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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
