165 lines
4.4 KiB
C#
165 lines
4.4 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
using UnityEngine.Audio;
|
|
|
|
// Token: 0x02000028 RID: 40
|
|
[Token(Token = "0x2000028")]
|
|
public class VoiceController : MonoBehaviour
|
|
{
|
|
// Token: 0x17000011 RID: 17
|
|
// (get) Token: 0x06000142 RID: 322 RVA: 0x00005F48 File Offset: 0x00004148
|
|
[Token(Token = "0x17000011")]
|
|
private VolumeSettings Volume
|
|
{
|
|
[Token(Token = "0x6000142")]
|
|
[Address(RVA = "0x4B4CA0", Offset = "0x4B3CA0", VA = "0x1804B4CA0")]
|
|
get
|
|
{
|
|
return Game.Config.volumeSettings;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000143 RID: 323 RVA: 0x00005F68 File Offset: 0x00004168
|
|
[Token(Token = "0x6000143")]
|
|
[Address(RVA = "0x4B4300", Offset = "0x4B3300", VA = "0x1804B4300")]
|
|
public void InitData()
|
|
{
|
|
int num;
|
|
AudioSource audioSource;
|
|
do
|
|
{
|
|
AudioSource[] array = new AudioSource[2];
|
|
this.g_AS = array;
|
|
VoiceController.VoiceType[] array2 = new VoiceController.VoiceType[2];
|
|
this.g_VoiceType = array2;
|
|
AudioSource[] array3 = this.g_AS;
|
|
num = 0;
|
|
if (num >= array3.Length)
|
|
{
|
|
goto IL_81;
|
|
}
|
|
audioSource = base.gameObject.AddComponent<AudioSource>();
|
|
}
|
|
while (audioSource != 0 && audioSource == 0);
|
|
AudioSource audioSource2 = this.g_AS[num];
|
|
AudioMixerGroup amg = this.AMG;
|
|
audioSource2.outputAudioMixerGroup = amg;
|
|
VoiceController.VoiceType[] array4 = this.g_VoiceType;
|
|
num++;
|
|
array4[0] = (VoiceController.VoiceType)num;
|
|
AudioSource[] array5 = this.g_AS;
|
|
IL_81:
|
|
this.g_iIndex = num;
|
|
}
|
|
|
|
// Token: 0x06000144 RID: 324 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000144")]
|
|
[Address(RVA = "0x4B4860", Offset = "0x4B3860", VA = "0x1804B4860")]
|
|
public AudioSource PlayVoice(int iIndex)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000145 RID: 325 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x6000145")]
|
|
[Address(RVA = "0x4B44E0", Offset = "0x4B34E0", VA = "0x1804B44E0")]
|
|
public void PlayDefaultVoice(int Pitch)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x06000146 RID: 326 RVA: 0x00006004 File Offset: 0x00004204
|
|
[Token(Token = "0x6000146")]
|
|
[Address(RVA = "0x4B4B10", Offset = "0x4B3B10", VA = "0x1804B4B10")]
|
|
public void ResetVolume()
|
|
{
|
|
int num = 0;
|
|
AudioSource[] array = this.g_AS;
|
|
if (num < array.Length)
|
|
{
|
|
VoiceController.VoiceType voiceType = this.g_VoiceType[num];
|
|
if (voiceType == VoiceController.VoiceType.Default)
|
|
{
|
|
AudioSource audioSource = array[num];
|
|
VolumeSettings volume = this.Volume;
|
|
}
|
|
if (voiceType == VoiceController.VoiceType.Voice)
|
|
{
|
|
AudioSource audioSource2 = array[num];
|
|
int num2 = 0;
|
|
VolumeSettings volume2 = this.Volume;
|
|
audioSource2.volume = (float)num2;
|
|
}
|
|
AudioSource[] array2 = this.g_AS;
|
|
num++;
|
|
}
|
|
}
|
|
|
|
// Token: 0x06000147 RID: 327 RVA: 0x00006078 File Offset: 0x00004278
|
|
[Token(Token = "0x6000147")]
|
|
[Address(RVA = "0x4B4C90", Offset = "0x4B3C90", VA = "0x1804B4C90")]
|
|
public VoiceController()
|
|
{
|
|
}
|
|
|
|
// Token: 0x040001BA RID: 442
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x40001BA")]
|
|
public AudioMixerGroup AMG;
|
|
|
|
// Token: 0x040001BB RID: 443
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x40001BB")]
|
|
public AudioClip DefaultVoice;
|
|
|
|
// Token: 0x040001BC RID: 444
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x40001BC")]
|
|
public float Pitch = 1f;
|
|
|
|
// Token: 0x040001BD RID: 445
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x40001BD")]
|
|
public AudioClip[] Sound;
|
|
|
|
// Token: 0x040001BE RID: 446
|
|
[Token(Token = "0x40001BE")]
|
|
private const int g_iASNum = 2;
|
|
|
|
// Token: 0x040001BF RID: 447
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x40001BF")]
|
|
private AudioSource[] g_AS;
|
|
|
|
// Token: 0x040001C0 RID: 448
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x40001C0")]
|
|
private VoiceController.VoiceType[] g_VoiceType;
|
|
|
|
// Token: 0x040001C1 RID: 449
|
|
[Token(Token = "0x40001C1")]
|
|
private const float g_fDefaultVolume = 0.4f;
|
|
|
|
// Token: 0x040001C2 RID: 450
|
|
[Token(Token = "0x40001C2")]
|
|
private const float g_fVoiceVolume = 1f;
|
|
|
|
// Token: 0x040001C3 RID: 451
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x40001C3")]
|
|
private int g_iIndex;
|
|
|
|
// Token: 0x02000029 RID: 41
|
|
[Token(Token = "0x2000029")]
|
|
private enum VoiceType
|
|
{
|
|
// Token: 0x040001C5 RID: 453
|
|
[Token(Token = "0x40001C5")]
|
|
Default,
|
|
// Token: 0x040001C6 RID: 454
|
|
[Token(Token = "0x40001C6")]
|
|
Voice
|
|
}
|
|
}
|