### **Creating a Sample Conversation with GameObjects**
Let’s set up a simple conversation for **Merchant-NPC** using GameObjects.
#### **Step-by-Step**
1. **Add a Conversation:**
- Select **Merchant-NPC**.
- In **NPCConversationManager**, set **Conversations** size to 1.
- Name it **Greeting** under **Conversation Name**.
2. **Create DialogueRoot:**
- Right-click **Merchant-NPC** > **Create Empty**, name it **Greeting**.
- Drag **Greeting** into **Conversations[0] > Dialogue Root**.
- Add **Environment** component to **Greeting**:
- **Environment Image**: Assign **Assets/Resources/environment**background.sprite (or some other image you've created)
- **Ambient Audio**: Assign **Assets/Resources/environment/FieldsFullTrack.wav**. (or some other ambient sound -- music will be handled in a _**musicManager.**_)
3. **Add Dialogue Nodes:**
- Right-click **Greeting** > **Create Empty**, name it **Start**.
- Add **DialogueNodeAuthoring** component to **Start**:
- _Id_: **Start**.
- _Character Name_: **Merchant**.
- _Character Sprite_: **Resources/characterSprite**merchant.sprite.
- _Emotional State_: **Friendly**.
- _Dialogue Text_: **Welcome to my shop!**.
- _Audio To Play_: **Resources/audioToPlay****/**welcome.wav.
- _Animation To Play_: **Resources/animationToPlay****/**wave.anim.
- _Colors_: Set as desired (e.g., white for text).
- Drag Start into Conversations\[0] > Starting Node.
4. **Add a Choice Node:**
- Right-click **Greeting** > **Create Empty**, name it **Buy**.
- Add **DialogueNodeAuthoring** to **Buy**:
- _Id_: **Buy**.
- _Character Name_: **Merchant**.
- _Character Sprite_: **Resources/characterSprite**merchant.sprite.
- _Dialogue Text_: **Want to buy something?**.
- Set Choices size to 1:
- _Choice Text_: **Yes**.
- _Next Node_: **Leave null** (or add another node).
- In **Start**’s **Choices**, add one:
- Choice Text: **Ask to buy**.
- Next Node: Drag **Buy**.
5. **Test**:
- Press Play, hit **T**—dialogue should display with audio, animation, and ambient sound.
#### **Export to JSON**
- Right-click **Merchant-NPC** > **Export Selected Conversation to JSON**.
- Check **Assets/Resources/Conversations/Merchant-NPC/Greeting.json**—assets should be copied to **Resources/\[property]/**.
---
### **Sample Hierarchy Diagrams**
1. **Initial Scene Setup:**
```text
- Canvas-DialogueDisplay
- DialoguePanel
- CharacterPanel
- DialogueManager
- TypingAudioSource
- Merchant-NPC
```
2. **After Adding Greeting:**
```text
- Merchant-NPC
- Greeting (DialogueRoot, Environment)
- Start (DialogueNodeAuthoring)
- Buy (DialogueNodeAuthoring)
```