> 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/scene-editor/extend-with-code/script-component.md).

# 스크립트 컴포넌트 사용

프로젝트 전체 구조를 파고들 필요 없이 코드 기능을 부여하려면 Script 컴포넌트를 사용하세요.

새 Script Component를 사용하면 Entity 자체 내에서 사용자 지정 코드를 실행하는 Entity를 만들 수 있습니다.

Script Component를 사용하면 다음 항목을 직접 수정할 필요 없이 Entity의 사용자 지정 동작을 실행할 수 있습니다. `index.ts` 및 기타 파일일 수 있습니다.

## Script Component 설정

1. 버튼을 클릭한 다음 Script Component를 선택하여 Entity에 추가합니다. 새 Script를 만들려면 `+` 버튼을 클릭하고 선택합니다. 새 Script를 만들려면 **+ Add New Script Module** 를 클릭해 이름을 지정하거나 File Path를 사용합니다(기존 파일을 찾아 선택하거나 끌어다 놓기).

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-0a4b3eb7762a7f26eb37f920671705a1007d907f%2Fnew-script-component.webp?alt=media)

2. Component에서 CODE 버튼을 클릭하면 기본 코드 편집기가 열립니다. 구조를 살펴보겠습니다. 기본 편집기를 선택하고 관리하는 방법에 대한 자세한 내용은 다음을 참조하세요. [코드와 결합하기](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/extend-with-code/overview.md).

## 스크립트 구조 이해하기

스크립트를 처음 열면 다음 코드가 표시됩니다:

```ts
import { engine, Entity } from '@dcl/sdk/ecs'
import {} from '@dcl/sdk/math'

export class BuildingScript {
  /**
   * 속성
   * 메서드 간에 재사용할 클래스 필드를 정의합니다.
   * 사용 예: this.myVariable
   */
   // private myVariable: boolean = true

  /**
   * 생성자 / 입력
   * 여기에 선언한 매개변수는 Creator Hub의 스크립트 구성 요소 UI에 표시됩니다.
   * 지원되는 유형: Entity, String, Number, Boolean, ActionCallback, Slider
   * 슬라이더로 편집하는 숫자입니다. 예: public speed: Slider<0, 10, 0.5> = 1
   *
   * 참고: 이 파일을 편집한 후 Script 구성 요소 UI에서 새로고침 아이콘을 클릭하세요.
   * 업데이트된 입력 항목을 확인할 수 있습니다.
   *
   * 생성자의 `src` 및 `entity` 필드는 내부 참조에 필요합니다.
   */
  constructor(
    public src: string,     // 삭제하지 마세요
    public entity: Entity,   // 삭제하지 마세요
    // 아래에 사용자 지정 입력을 추가하세요
  ) {}

  /**
   * start()
   * 스크립트가 초기화될 때 한 번 호출됩니다.
   */
  start() {
    // 스크립트 초기화
    console.log("BuildingScript initialized for entity:", this.entity);
  }

  /**
   * update(dt)
   * 매 프레임 호출됩니다.
   * @param dt - (선택 사항) 마지막 프레임 이후 경과한 시간(초)
   */
  update(dt: number) {
    // 매 프레임 호출
  }
}
```

클래스는 세 가지 주요 부분으로 구성됩니다.

* 다음 **constructor**,
* 의 **start()** 메서드
* 해당 **update()** 메서드.

## 생성자

생성자에는 Creator Hub의 장면에서 동적으로 노출하고 수정하려는 매개변수가 포함됩니다.

```ts
export class BuildingScript {
  constructor(
    public src: string,
    public entity: Entity,
    public numericVariable: number, 
  ) {}
...
}
```

파일을 저장하면 **새로고침** 스크립트 구성 요소의 버튼을 눌러 모든 변경 사항을 업데이트합니다.

<img src="https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-8f1b521e1b68b5d9138dd1b60eeb40e4b13dbb0c%2Fscript-refresh-button.webp?alt=media" alt="새로고침 버튼" width="360">

새로 고침하면 Script Component에 다음 항목이 표시됩니다. `numericVariable` 코드에 추가된 항목입니다.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-18eb30b39910dc3dacecb48e7c6e6c3a26551c4a%2Fparameter-script-component.webp?alt=media)

## 매개변수

서로 다른 Entity가 Script component에서 같은 파일을 사용하더라도, 각 Entity에는 별도의 매개변수가 있습니다. 장면에 건물이 두 채 있는 경우, `building1` 과 `building2`가 모두 `BuildingScript.ts` 파일을 가리키는 Script Component를 사용하더라도, 각 건물에는 독립적으로 수정할 수 있는 자체 `numericVariable` 매개변수가 있습니다.

{% hint style="warning" %}
**중요**:  `public src: string` 와 `public entity: Entity`를 수정하거나 삭제하지 마세요. 이 항목 뒤에 새 입력을 추가할 수 있습니다.
{% endhint %}

생성자 매개변수에 허용되는 유형은 다음과 같습니다.

* `Entity`
* `string`
* `number`
* `boolean`
* `ActionCallback`
* `Slider<Min, Max, Step>`
* 다음과 같은 문자열 선택 항목 `'small' | 'large'`
* 다음과 같은 객체 `{ x: number; y: number }`
* 다음과 같은 목록 `string[]` 또는 `Array<{ entity: Entity; label: string }>`

Creator Hub는 각 매개변수 이름을 읽기 쉬운 레이블로 표시합니다. `maxHealth` 는 다음과 같이 표시됩니다. **최대 체력**.

### 슬라이더가 있는 숫자 매개변수

숫자 매개변수를 `Slider<Min, Max, Step>` 로 지정하면 일반 숫자 입력란 대신 슬라이더로 편집할 수 있습니다. Creator Hub에는 슬라이더와 숫자 입력란이 모두 표시됩니다.

```ts
constructor(
  public src: string,
  public entity: Entity,
  // 0부터 10까지, 0.5씩 이동하는 슬라이더
  public speed: Slider<0, 10, 0.5> = 1,
) {}
```

* `Step` 은 선택 사항이며 기본값은 `1`.
* 음수 범위도 허용됩니다. 예를 들어 `Slider<-90, 90>`.
* 런타임에서 값은 일반 `number`, 따라서 `this.speed` 는 다른 숫자 매개변수와 똑같이 작동합니다.

{% hint style="info" %}
**📔 참고**: `public` 와 `private`  생성자 매개변수는 모두 Creator Hub에 표시됩니다. `private` 키워드는 `BuildingScript`  클래스 내부에서만 접근을 제한합니다. 자세한 내용은 공식 TypeScript 문서의\
[매개변수 속성](https://www.typescriptlang.org/docs/handbook/2/classes.html#parameter-properties).
{% endhint %}

### 선택 매개변수

문자열 매개변수를 문자열 유니언으로 지정하면 드롭다운에서 편집할 수 있습니다. 처음에 선택되는 값은 기본값입니다.

```ts
constructor(
  public src: string,
  public entity: Entity,
  // 'player'를 기본값으로 하는 세 가지 옵션의 드롭다운
  public target: 'all' | 'player' | 'non_player' = 'player',
) {}
```

### 객체로 매개변수 그룹화

매개변수를 객체로 지정하면 필드가 함께 그룹으로 표시되어 펼치거나 접을 수 있습니다. 그룹은 접힌 상태로 시작합니다.

```ts
constructor(
  public src: string,
  public entity: Entity,
  // X, Y, Z 필드가 있는 "Spawn Point" 그룹으로 표시
  public spawnPoint: { x: number; y: number; z: number } = { x: 8, y: 0, z: 8 },
) {}
```

객체에는 다른 객체와 목록을 포함할 수 있습니다. 위와 같이 형태를 인라인으로 작성하세요. Creator Hub는 이름이 지정된 타입을 읽지 않으므로, 다른 곳에서 선언한 `interface`  또는 `type`  별칭으로 매개변수 타입을 지정해도 해당 필드는 표시되지 않습니다.

### 목록 매개변수

매개변수를 배열로 지정하면 제작자가 필요한 만큼 행을 추가할 수 있습니다. 각 행에는 휴지통 버튼이 있으며, **추가**  버튼을 누르면 새 행이 추가됩니다.

```ts
constructor(
  public src: string,
  public entity: Entity,
  // 각 행에 Entity 선택기와 텍스트 필드가 표시됩니다
  public targets: Array<{ entity: Entity; label: string }> = [],
) {}
```

`T[]` 와 `Array<T>` 는 같은 방식으로 작동합니다.

### 태그로 선택기 범위 좁히기

다음 태그 중 하나를 `/** */` 매개변수 바로 앞이나 객체 매개변수의 필드 바로 앞 주석에 추가하면 Creator Hub에서 해당 항목을 편집하는 방식이 바뀝니다. 목록에 태그를 적용하면 각 행에 적용됩니다.

| 태그                     | 적용 대상        | 기능                                 |
| ---------------------- | ------------ | ---------------------------------- |
| `@components <name> …` | 하나의 `Entity` | 나열된 컴포넌트 중 하나를 가진 엔티티만 선택할 수 있습니다. |
| `@actionsOf <field>`   | 하나의 `string` | 같은 그룹의 `<field>`.                  |
| `@format wallet`       | 하나의 `string` | 값을 지갑 주소로 편집합니다.                   |

```ts
constructor(
  public src: string,
  public entity: Entity,
  public buttons: Array<{
    /** @components asset-packs::Actions */
    entity: Entity
    /** @actionsOf entity */
    action: string
  }> = [],
  /** @format wallet */
  public owner: string = '',
) {}
```

이 예시에서는 각 행의 **버튼** 에는 액션이 있는 항목만 선택할 수 있으며, **액션** 드롭다운에는 해당 행에서 선택한 항목의 액션이 표시됩니다. 항목을 선택하기 전까지 드롭다운에는 **먼저 항목을 선택하세요**라고 표시됩니다. 저장된 액션이 더 이상 해당 항목에 없으면 필드에 그 사실이 표시됩니다.

태그는 편집기에만 영향을 줍니다. 런타임에 스크립트는 엔티티, 액션 이름이 담긴 문자열, 주소가 담긴 문자열 등 일반 값을 받습니다.

### 파일 매개변수

문자열 매개변수에는 스크립트에 포함된 사운드나 모델 같은 파일의 이름을 지정할 수 있습니다. 스크립트는 다음과 같이 자체 폴더에서 해당 파일을 읽습니다. `` `${this.src}/${this.sound}` ``. 자세한 내용은 [기본 매개변수](#default-parameters).

Creator Hub는 이 값을 확인합니다. 스크립트 폴더에 있어야 하지만 실제로 없는 파일을 값으로 지정하면 필드에 `"<file name>" is missing`가 표시됩니다. URL과 일반 텍스트는 경고하지 않습니다.

의 스크립트 폴더 안에서 파일 이름을 변경하거나 파일을 이동하면, 해당 파일을 사용하는 매개변수가 자동으로 업데이트되며 파일을 삭제하려고 하면 사용 중이라는 경고가 표시됩니다. **로컬 에셋** 탭에서 스크립트 폴더 밖으로 파일을 옮기면 변경 사항을 추적할 수 없으며, Creator Hub에서 일부 참조를 업데이트하지 못했다는 알림을 표시합니다.

### 스크립트 내에서 매개변수에 액세스하기

코드에서 매개변수 값을 가져오려면 다음 표기법을 사용합니다. `this.definedParameter`. 예를 들면 다음과 같습니다. `this.numericVariable` 또는 `this.entity`.

기본 Script 템플릿의 start() 메서드에는 다음 줄이 포함되어 있습니다.

`console.log("BuildingScript initialized for entity:", this.entity);`.

생성자에서 정의한 값이 로그에 표시되도록 다음과 같이 변경합니다.

`console.log("BuildingScript initialized with numericVariable:`, `this.numericVariable);`

Creator Hub UI에서 매개변수 값을 변경하면 로그에 표시되는 값도 그에 따라 바뀌어야 합니다.

### 기본 매개변수

생성자에는 기본적으로 `src` 와 `entity` 매개변수가 포함되어 있습니다. 이 매개변수는 스크립트 코드에서 매우 유용합니다.

* `this.entity` 는 항상 해당 `Script` 컴포넌트를 사용하면 엔티티 정보에 액세스하거나 엔티티에 컴포넌트를 추가할 수 있습니다.
* `this.src` 는 스크립트가 저장된 경로입니다. 다른 사람이 사용할 스마트 아이템을 만들 때 특히 유용합니다. 이 필드를 사용하면 스마트 아이템의 경로가 변경되거나 이름이 바뀌더라도 스마트 아이템에 포함된 파일의 경로를 구성할 수 있습니다.

```ts
export class BuildingScript {
  constructor(
    public src: string,
    public entity: Entity,
  ) {}

  start() {
    Material.setPbrMaterial(this.entity, {
      texture: Material.Texture.Common({
        src: this.src + '/images/myImage.png',
      })
    });
  }
}
```

위 스크립트는 스크립트를 소유한 엔티티를 가져와 텍스처를 적용합니다. 텍스처는 스마트 아이템 폴더의 `.png` 파일에서 가져오며, 이 파일은 `/images`라는 하위 폴더에 포함되어 있습니다. `this.src`를 사용하면 스마트 아이템을 씬에 `/assets/custom/itemName` 또는 `/assets/asset-packs/itemName`

### 경로로 가져오더라도 파일 경로를 항상 알 수 있습니다.

매개변수에 툴팁 추가하기

사용자가 입력란의 용도와 허용되는 값을 알 수 있도록 입력 매개변수에 툴팁을 추가하세요. 사용자는 Script 컴포넌트 UI에서 각 입력란 옆에 있는 툴팁 아이콘을 보고, 아이콘 위에 마우스를 올려 사용자 지정 텍스트를 확인할 수 있습니다. `생성자에 툴팁을 추가하려면 생성자 바로 앞에 주석 처리된 블록을 추가하고, 각 툴팁마다` @param 뒤에 입력란 이름과 설명을 적으세요.

```ts
  /**
   * @param startDate - YYYY-MM-DD 형식의 이벤트 시작 날짜
   * @param yOffset - 지면에서 아이템을 표시할 높이(미터)
   */
  constructor(
    public src: string,
    public entity: Entity,
    public startDate?: string,
    public yOffset: number = 0.5,
  ) {
  }
```

툴팁 변경 사항을 확인하려면 Script 컴포넌트 UI에서 새로고침 아이콘을 클릭해야 할 수 있습니다.

<img src="https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-8f1b521e1b68b5d9138dd1b60eeb40e4b13dbb0c%2Fscript-refresh-button.webp?alt=media" alt="새로고침 버튼" width="360">

## start() 및 update() 메서드

&#x20;**start()**  메서드에는 엔티티가 생성될 때(이 경우 씬이 처음 로드될 때) 한 번만 실행되는 코드가 포함됩니다.

씬을 미리 보고 로그를 확인하세요(**팁**: 다음 단축키를 사용할 수 있습니다. `` ` `` 새 메시지와 `numericVariable` 매개변수가 표시됩니다.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-fabd7facf4936fb649ae429b9c37fc419ba7d0b6%2Fscript-log-message.webp?alt=media)

&#x20;**update()**  메서드는 반면 게임의 매 프레임마다(System과 마찬가지로) 코드를 실행합니다. 예를 들어 `PlayerEntity` 의 값을 확인하여 스크립트에서 동작을 트리거할 수 있습니다.

다음 코드는 게임의 매 프레임마다 `PlayerEntity` 가 앞서 정의한 `numericVariable`보다 높으면 로그를 출력합니다. 이 값은 Script 컴포넌트 UI에서 제작자가 동적으로 제공합니다.

```ts
update(dt: number) {
    if (Transform.get(engine.PlayerEntity).position.y > this.numericVariable ) {
      console.log("The player's height is over ", this.numericVariable);
    }}
```

<img src="https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-7825c3d4095279d79c52337e7210e1935f796703%2Fupdate-script-logs.webp?alt=media" alt="Update Method" data-size="line">

첫 번째 로그는 start() 메서드에 속하며 numericVariable을 설정했음을 나타냅니다. 두 번째 로그는 update() 메서드에 속하며 플레이어가 해당 값보다 높을 때 표시됩니다.

## Creator Hub에 액션 노출하기

다음을 정의할 수 있습니다. `Action` Script Component 스크립트 안에서 사용하고 Creator Hub UI에서 사용할 수 있도록 합니다. 이렇게 하면 다른 Entity에서 이 작업을 트리거할 수 있습니다. `Action` 다른 Entity에서 트리거할 수 있습니다.

```ts
  /**
   * 이 작업을 트리거할 수 있도록 공개합니다.
   * @action
   */
  exposedAction(creatorHubParameter: number) {
    console.log("Triggered from another entity using parameter: ", this.creatorHubParameter);
  }
```

`creatorHubParameter` 은(는) `Action` 매개변수로 공개되어 사용자 지정 값을 지정할 수 있습니다. Script Component를 새로 고치면 새 작업을 Actions 드롭다운에서 선택할 수 있습니다.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-b2347abdf8b6704b2c7b1f7090de49b535beaf5d%2Fscript-component-action.webp?alt=media)

Action을 추가한 후에는 Creator Hub의 모든 Entity에서 `Triggers`

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-d5af1dd8d6a6bbf64f9202976f66bfab49e65189%2Fscript-component-action-trigger.webp?alt=media)

{% hint style="info" %}
**📔 참고**: 스크립트 안에 필요한 만큼 Action을 추가할 수 있습니다. 추가한 Action은 각각 `Action` 드롭다운에서 사용할 수 있습니다.
{% endhint %}

## 외부에서 Script 메서드 호출하기

다른 Script 또는 `src/index.ts`에서 Script 메서드를 호출하려면 다음 단계를 따르세요.

1. Script 클래스 안에 `public` 메서드를 만듭니다.
2. 씬의 루트 디렉터리에서 `npm run build` 를 실행합니다.
3. public 메서드를 사용할 파일에 다음을 추가합니다. `import { callScriptMethod } from '~sdk/script-utils'`.
4. 필요한 매개변수를 전달하여 `callScriptMethod` 을(를) 호출합니다(이 경우에는 `someParamter`).

다음은 `public` 메서드를 공개하는 예시입니다.

```ts
export class BuildingScript {
  constructor(
    public src: string,
    public entity: Entity,
    ...,
  ) {}

  public publicMethod(boolParameter: boolean, someNumberParameter: number) {
    if (boolParameter) {
      console.log("Public method called with parameter true!: ", someNumberParameter);
    } else {
      console.log("Public method called with parameter: false!", someNumberParameter);
    }
  }
...
}
```

이를 `src/index.ts`에서 호출하려면 다음을 사용합니다.

```ts
import { callScriptMethod } from '~sdk/script-utils'


export function main() {
    const buildingEntity = engine.getEntityOrNullByName("building")
    if (buildingEntity) {
        const scriptMethod = callScriptMethod(
            buildingEntity,
            "assets/scene/Scripts/BuildingScript.tsx",
            "publicMethod",
            false,
            3,
        )

        scriptMethod
    }
}
```

먼저, `main` 함수는 Script 컴포넌트가 있는 `Entity` 를 찾습니다. 다음으로 해당 항목이 `Entity` 존재하면 `callScriptMethod` 가 다음 매개변수와 함께 호출됩니다.

1. `entity`: `Entity` 에는 `public` 메서드가 있습니다.
2. `scriptPath`: `path` 는 `Script` 클래스가 있는 경로입니다.
3. `methodName`: 호출할 `public` 메서드의 이름입니다.
4. `...args`: 메서드의 인수입니다. 이 경우 인수는 두 개입니다. 순서대로 하나씩 추가해야 합니다.

마지막으로 정의된 `callScriptMethod`, 즉 이 경우에는 `scriptMethod`.

를 호출합니다. 주어진 매개변수 값을 사용하면 출력 결과는 다음과 같습니다.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-761e5092a6f0de732888f475223cd391bf158f46%2Fscript-component-public-method.webp?alt=media)

{% hint style="info" %}
**📔 참고**: 같은 로직을 사용하여 다른 스크립트나 파일에서 `public` Script 메서드를 호출할 수 있습니다. 이를 통해 Script 클래스의 `public` 변수 값을 가져오거나 변경할 수 있습니다.
{% endhint %}

## Script에서 다른 Entity의 Action 트리거하기

Script 클래스 생성자에서 `ActionCallback` 유형의 매개변수를 사용할 수 있습니다. 이를 통해 다른 `Entity`의 `Action` 을 Script의 메서드에서 트리거할 수 있습니다. 이 Action은 Creator Hub UI에서 정의합니다.

이 예제에서는 `anotherEntityAction` 이 `public` 매개변수로 추가됩니다.

```ts
export class BuildingScript {
  constructor(
    public src: string,
    public entity: Entity,
    public anotherEntityAction: ActionCallback,
    ...,
  ) {}
  ...
}
```

선택 가능한 `Entity` 및 `Action` 은(는) Creator Hub UI에서 Script Component를 새로 고치면 사용할 수 있습니다. `Sphere` 은(는) Scale이라는 액션이 있는, 씬에 이미 존재하는 Entity입니다. `Scale`.

![](https://3980763956-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoPnXBby9S6MrsW83Y9qZ%2Fuploads%2Fgit-blob-eebee3acf257773a5b63ed040f18d1010a481420%2Fscript-component-action-callback.webp?alt=media)

다른 Entity의 액션을 이제 Script 클래스에서 사용할 수 있습니다. 여러 가지 방법으로 활용할 수 있습니다. 다음 예시에서는 `this.anotherEntityAction` 을(를) 호출하도록 `pointerEventsSystem` 을(를) `start` 메서드에서 정의하면 E 키를 눌렀을 때 실행됩니다.

```ts
  start() {
    pointerEventsSystem.onPointerDown(
      {
        entity: this.entity,
        opts: {
          button: InputAction.IA_PRIMARY,
          hoverText: "Press E to trigger an Action from another Entity.",
        },
      },
      () => {
        this.anotherEntityAction();
      }
    );
  }
```

### 선택적 액션 콜백

크리에이터가 연결하지 않은 `ActionCallback` 매개변수는 `undefined`이며, 해당 매개변수의 유형은 `ActionCallback | undefined`입니다. 액션이 연결되어 있든 아니든 스크립트가 작동하도록 호출 전에 확인하세요.

```ts
if (this.anotherEntityAction) {
  this.anotherEntityAction();
}
```

{% hint style="info" %}
**📔 참고**: 노출과 트리거 결합 `Actions` 은(는) 매우 강력한 도구입니다. 한 Entity에 Script Component를 정의하고 `public` 메서드를 사용해 액션을 노출한 다음, 다른 Entity의 Script Component에서 `ActionCallback` 매개변수를 사용해 해당 액션을 트리거할 수 있습니다.
{% endhint %}

## 관련 항목

* [스마트 아이템 - 기본](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/smart-items.md)
* [스마트 아이템 - 고급](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/smart-items-advanced.md)
* [상태 및 조건](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/states-and-conditions.md)
* [모든 아이템을 스마트하게 만들기](https://docs.decentraland.org/creator/content-creator-ko/scene-editor/interactivity/make-any-item-smart.md)
* [SDK 빠른 시작](https://docs.decentraland.org/creator/content-creator-ko/sdk7/getting-started/sdk-101.md): 빠른 입문을 원한다면 이 짧은 튜토리얼을 따라 해 보세요.
* [개발 워크플로](https://docs.decentraland.org/creator/content-creator-ko/sdk7/getting-started/dev-workflow.md): 처음부터 끝까지 씬을 만드는 방법을 알아보려면 이 문서를 읽어 보세요.
* [예제](https://docs.decentraland.org/creator/content-creator-ko/tutorials-and-examples/examples.md): 바로 예제 씬을 살펴보세요.


---

# 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/scene-editor/extend-with-code/script-component.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.
