> 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/tutorials-and-examples/ui-camera-player/npc-toolkit.md).

# NPC 툴킷

SDK7 씬을 위한 재사용 가능한 NPC 동작과 대화 UI.

SDK7 씬에서 재사용 가능한 NPC 동작과 대화 UI를 사용하세요.

## 프로젝트 정보

**관리자:** Decentraland

[소스 보기](https://github.com/decentraland-scenes/dcl-npc-toolkit)

**라이선스:** [Apache-2.0](https://github.com/decentraland-scenes/dcl-npc-toolkit/blob/main/LICENSE). 재사용하기 전에 원본 프로젝트의 이용 약관을 확인하세요. 코드와 에셋에 서로 다른 약관이 적용될 수 있습니다.

## 코드 살펴보기

이 링크는 특정 소스 스냅샷을 가리키므로, 상위 프로젝트의 개발이 계속되어도 설명을 유용하게 참고할 수 있습니다. 학습을 위한 참고 자료이며 보안 평가 자료는 아닙니다.

### 대화 표시와 대화 진행을 분리하기

`handleDialogClick`, `rushText`, 그리고 `confirmText` 는 텍스트가 아직 입력 중일 때 남은 문자를 먼저 모두 표시합니다. 이후 입력하면 스크립트가 진행되거나 숫자로 된 대화 분기를 선택하며, 게임 동작을 실행하는 콜백도 호출됩니다.

**프로젝트 맥락:** UI 입력이 대화를 어떻게 제어하는지 이해하려면 툴킷의 `Dialog` 데이터와 `npcDialogComponent` 상태도 함께 살펴보세요.

**소스 참고:**

* [`handleDialogClick`, `rushText`, 그리고 `confirmText`](https://github.com/decentraland-scenes/dcl-npc-toolkit/blob/60e327c67a126d92e47ecf8e7eda342ce1191076/src/dialog.ts#L489-L549)

### 근접 입력과 포인터 입력을 NPC 상호작용에 연결하기

`addClickReactions` 및 `addTriggerArea` 는 포인터 콜백과 자식 구형 트리거를 구성하며, 클릭으로만 활성화하는 설정과 플레이어가 멀어져도 대화를 계속하는 설정을 제공합니다. `activate` 및 `endInteraction` 는 활성 NPC, 대기 시간, 대화 및 선택적 플레이어 바라보기 동작을 조정합니다.

**프로젝트 맥락:** 이 함수들은 툴킷의 콜백 맵과 추적 시스템을 사용합니다.

**소스 참고:**

* [`addClickReactions` 및 `addTriggerArea`](https://github.com/decentraland-scenes/dcl-npc-toolkit/blob/60e327c67a126d92e47ecf8e7eda342ce1191076/src/npc.ts#L410-L531)
* [`activate` 및 `endInteraction`](https://github.com/decentraland-scenes/dcl-npc-toolkit/blob/60e327c67a126d92e47ecf8e7eda342ce1191076/src/npc.ts#L769-L823)


---

# 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/tutorials-and-examples/ui-camera-player/npc-toolkit.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.
