using System;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

// Token: 0x02000026 RID: 38
public class DialogueSounds : MonoBehaviour
{
	// Token: 0x06000669 RID: 1641 RVA: 0x0008620B File Offset: 0x0008440B
	private void Start()
	{
	}

	// Token: 0x0600066A RID: 1642 RVA: 0x00086210 File Offset: 0x00084410
	public void PlaySound()
	{
		string parsedText = this.textComponent.GetParsedText();
		int maxVisibleCharacters = this.textComponent.maxVisibleCharacters;
		int num = 0;
		int num2 = 0;
		foreach (char c in parsedText)
		{
			if (num2 == maxVisibleCharacters)
			{
				num = (int)(char.ToUpper(c) - 'A');
				if (num < 0)
				{
					num = 26;
				}
			}
			num2++;
		}
		this.audioPlayer.clip = this.audioArray[num];
		this.audioPlayer.volume = Links.x.options.soundVolume * 0.3f;
		this.audioPlayer.Play();
	}

	// Token: 0x04000924 RID: 2340
	public TextMeshProUGUI textComponent;

	// Token: 0x04000925 RID: 2341
	public AudioSource audioPlayer;

	// Token: 0x04000926 RID: 2342
	public List<AudioClip> audioArray = new List<AudioClip>();
}
