424 lines
16 KiB
C#
424 lines
16 KiB
C#
using System;
|
|
using Cpp2IlInjected;
|
|
using UnityEngine;
|
|
using UnityEngine.Audio;
|
|
|
|
// Token: 0x0200001D RID: 29
|
|
[Token(Token = "0x200001D")]
|
|
public class SoundEffect : MonoBehaviour
|
|
{
|
|
// Token: 0x1700000F RID: 15
|
|
// (get) Token: 0x060000BD RID: 189 RVA: 0x00003F08 File Offset: 0x00002108
|
|
[Token(Token = "0x1700000F")]
|
|
private VolumeSettings volumeSettings
|
|
{
|
|
[Token(Token = "0x60000BD")]
|
|
[Address(RVA = "0x11FA820", Offset = "0x11F9620", VA = "0x1811FA820")]
|
|
get
|
|
{
|
|
return Game.Config.volumeSettings;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000BE RID: 190 RVA: 0x00003F28 File Offset: 0x00002128
|
|
[Token(Token = "0x60000BE")]
|
|
[Address(RVA = "0x11F8E10", Offset = "0x11F7C10", VA = "0x1811F8E10")]
|
|
public void InitData(string type)
|
|
{
|
|
while (!this.isInitialized)
|
|
{
|
|
this.isInitialized = true;
|
|
this.soundEffectType = type;
|
|
int audioSourceNum = this.AudioSourceNum;
|
|
if (audioSourceNum > 0)
|
|
{
|
|
AudioSource[] array = new AudioSource[audioSourceNum];
|
|
this.g_AS = array;
|
|
int num = 0;
|
|
if (this.AudioSourceNum > num)
|
|
{
|
|
AudioSource[] array2 = this.g_AS;
|
|
AudioSource audioSource = base.gameObject.AddComponent<AudioSource>();
|
|
if (audioSource != 0 && audioSource == 0)
|
|
{
|
|
continue;
|
|
}
|
|
array2[0] = audioSource;
|
|
AudioSource[] array3 = this.g_AS;
|
|
string text = this.soundEffectType;
|
|
AudioSource audioSource2 = array3[num];
|
|
if (text != 0)
|
|
{
|
|
if (string.Equals(text, "SoundEffect"))
|
|
{
|
|
float soundEffectVolume = this.volumeSettings.GetSoundEffectVolume();
|
|
}
|
|
if (string.Equals(text, "Voice"))
|
|
{
|
|
float voiceVolume = this.volumeSettings.GetVoiceVolume();
|
|
}
|
|
}
|
|
float wholeVolume = this.volumeSettings.GetWholeVolume();
|
|
audioSource2.volume = wholeVolume;
|
|
AudioSource audioSource3 = this.g_AS[num];
|
|
AudioMixerGroup amg = this.AMG;
|
|
audioSource3.outputAudioMixerGroup = amg;
|
|
AudioSource audioSource4 = this.g_AS[num];
|
|
float pitch = this.Pitch;
|
|
audioSource4.pitch = pitch;
|
|
AudioSource audioSource5 = this.g_AS[num];
|
|
bool playOnAwake = this.PlayOnAwake;
|
|
audioSource5.playOnAwake = playOnAwake;
|
|
AudioSource audioSource6 = this.g_AS[num];
|
|
float spatialBlend = this.SpatialBlend;
|
|
audioSource6.spatialBlend = spatialBlend;
|
|
AudioSource audioSource7 = this.g_AS[num];
|
|
float distanceMin = this.DistanceMin;
|
|
audioSource7.minDistance = distanceMin;
|
|
AudioSource audioSource8 = this.g_AS[num];
|
|
float distanceMax = this.DistanceMax;
|
|
audioSource8.maxDistance = distanceMax;
|
|
AudioSource audioSource9 = this.g_AS[num];
|
|
int priority = this.Priority;
|
|
audioSource9.priority = priority;
|
|
AudioSource audioSource10 = this.g_AS[num];
|
|
AudioRolloffMode rolloff = this.Rolloff;
|
|
audioSource10.rolloffMode = rolloff;
|
|
num++;
|
|
}
|
|
this.g_iASIndex = (int)((ulong)0L);
|
|
this.g_fVolumeSet = 1f;
|
|
this.g_fPitchSet = 1f;
|
|
this.g_fTimeScale = 1f;
|
|
break;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000BF RID: 191 RVA: 0x0000413C File Offset: 0x0000233C
|
|
[Token(Token = "0x60000BF")]
|
|
[Address(RVA = "0x11F8DD0", Offset = "0x11F7BD0", VA = "0x1811F8DD0")]
|
|
public void InitData()
|
|
{
|
|
string tag = base.gameObject.tag;
|
|
this.InitData(tag);
|
|
}
|
|
|
|
// Token: 0x060000C0 RID: 192 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60000C0")]
|
|
[Address(RVA = "0x11F97E0", Offset = "0x11F85E0", VA = "0x1811F97E0")]
|
|
public void Play(int iIndex, float fVolume = 1f, float fPitch = 1f)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060000C1 RID: 193 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60000C1")]
|
|
[Address(RVA = "0x11F9320", Offset = "0x11F8120", VA = "0x1811F9320")]
|
|
public void PlayRandom(float fVolume = 1f, float fPitch = 1f)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060000C2 RID: 194 RVA: 0x00004164 File Offset: 0x00002364
|
|
[Token(Token = "0x60000C2")]
|
|
[Address(RVA = "0x11FA680", Offset = "0x11F9480", VA = "0x1811FA680")]
|
|
public void Stop()
|
|
{
|
|
AudioSource[] array = this.g_AS;
|
|
if (array != 0)
|
|
{
|
|
int num = 0;
|
|
int num2 = 0;
|
|
if (num2 < array.Length)
|
|
{
|
|
AudioSource audioSource = array[num];
|
|
int num3 = 0;
|
|
if (audioSource != num3 && this.g_AS[num].isPlaying)
|
|
{
|
|
this.g_AS[num].Stop();
|
|
}
|
|
AudioSource[] array2 = this.g_AS;
|
|
num++;
|
|
}
|
|
this.g_iASIndex = (int)((ulong)0L);
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000C3 RID: 195 RVA: 0x000041E4 File Offset: 0x000023E4
|
|
[Token(Token = "0x60000C3")]
|
|
[Address(RVA = "0x11F9290", Offset = "0x11F8090", VA = "0x1811F9290")]
|
|
public void Pause()
|
|
{
|
|
AudioSource[] array = this.g_AS;
|
|
if (array != 0)
|
|
{
|
|
int num = this.g_iASIndex;
|
|
if (array[num].isPlaying)
|
|
{
|
|
AudioSource[] array2 = this.g_AS;
|
|
int num2 = this.g_iASIndex;
|
|
array2[num2].Pause();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000C4 RID: 196 RVA: 0x00004234 File Offset: 0x00002434
|
|
[Token(Token = "0x60000C4")]
|
|
[Address(RVA = "0x11F8CA0", Offset = "0x11F7AA0", VA = "0x1811F8CA0")]
|
|
public void Continue()
|
|
{
|
|
AudioSource[] array = this.g_AS;
|
|
if (array != 0)
|
|
{
|
|
int num = this.g_iASIndex;
|
|
if (!array[num].isPlaying)
|
|
{
|
|
AudioSource[] array2 = this.g_AS;
|
|
int num2 = this.g_iASIndex;
|
|
array2[num2].Play();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000C5 RID: 197 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60000C5")]
|
|
[Address(RVA = "0x11FA160", Offset = "0x11F8F60", VA = "0x1811FA160")]
|
|
public void SetVolume(float fVolume)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060000C6 RID: 198 RVA: 0x00004284 File Offset: 0x00002484
|
|
[Token(Token = "0x60000C6")]
|
|
[Address(RVA = "0x11F8D80", Offset = "0x11F7B80", VA = "0x1811F8D80")]
|
|
public float GetVolume()
|
|
{
|
|
AudioSource[] array = this.g_AS;
|
|
int num = this.g_iASIndex;
|
|
return array[num].volume;
|
|
}
|
|
|
|
// Token: 0x060000C7 RID: 199 RVA: 0x000042B4 File Offset: 0x000024B4
|
|
[Token(Token = "0x60000C7")]
|
|
[Address(RVA = "0x11F9F30", Offset = "0x11F8D30", VA = "0x1811F9F30")]
|
|
public void SetPith(float fPitch)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060000C7)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void SoundEffect::SetPith(System.Single)
|
|
|
|
---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'length')
|
|
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
|
|
at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 51
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 401
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 276
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 112
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x060000C8 RID: 200 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60000C8")]
|
|
[Address(RVA = "0x11FA3A0", Offset = "0x11F91A0", VA = "0x1811FA3A0")]
|
|
public void Set(float fVolume, float fPitch)
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060000C9 RID: 201 RVA: 0x000020D3 File Offset: 0x000002D3
|
|
[Token(Token = "0x60000C9")]
|
|
[Address(RVA = "0x11F8D30", Offset = "0x11F7B30", VA = "0x1811F8D30")]
|
|
public bool GetIsPlaying()
|
|
{
|
|
throw new AnalysisFailedException("CPP2IL failed to recover any usable IL for this method.");
|
|
}
|
|
|
|
// Token: 0x060000CA RID: 202 RVA: 0x00004338 File Offset: 0x00002538
|
|
[Token(Token = "0x60000CA")]
|
|
[Address(RVA = "0x11FA050", Offset = "0x11F8E50", VA = "0x1811FA050")]
|
|
public void SetTimeScale(float fScale)
|
|
{
|
|
/*
|
|
An exception occurred when decompiling this method (060000CA)
|
|
|
|
ICSharpCode.Decompiler.DecompilerException: Error decompiling System.Void SoundEffect::SetTimeScale(System.Single)
|
|
|
|
---> System.ArgumentOutOfRangeException: Non-negative number required. (Parameter 'length')
|
|
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
|
|
at System.Array.Copy(Array sourceArray, Array destinationArray, Int32 length)
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackSlot.ModifyStack(StackSlot[] stack, Int32 popCount, Int32 pushCount, ByteCode pushDefinition) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 51
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.StackAnalysis(MethodDef methodDef) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 401
|
|
at ICSharpCode.Decompiler.ILAst.ILAstBuilder.Build(MethodDef methodDef, Boolean optimize, DecompilerContext context) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\ILAst\ILAstBuilder.cs:line 276
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(IEnumerable`1 parameters, MethodDebugInfoBuilder& builder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 112
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 88
|
|
--- End of inner exception stack trace ---
|
|
at ICSharpCode.Decompiler.Ast.AstMethodBodyBuilder.CreateMethodBody(MethodDef methodDef, DecompilerContext context, AutoPropertyProvider autoPropertyProvider, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, StringBuilder sb, MethodDebugInfoBuilder& stmtsBuilder) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstMethodBodyBuilder.cs:line 92
|
|
at ICSharpCode.Decompiler.Ast.AstBuilder.AddMethodBody(EntityDeclaration methodNode, EntityDeclaration& updatedNode, MethodDef method, IEnumerable`1 parameters, Boolean valueParameterIsKeyword, MethodKind methodKind) in D:\a\dnSpy\dnSpy\Extensions\ILSpy.Decompiler\ICSharpCode.Decompiler\ICSharpCode.Decompiler\Ast\AstBuilder.cs:line 1618
|
|
*/;
|
|
}
|
|
|
|
// Token: 0x060000CB RID: 203 RVA: 0x000043C4 File Offset: 0x000025C4
|
|
[Token(Token = "0x60000CB")]
|
|
[Address(RVA = "0x11F9CF0", Offset = "0x11F8AF0", VA = "0x1811F9CF0")]
|
|
public void ResetVolume()
|
|
{
|
|
AudioSource[] array = this.g_AS;
|
|
if (array != 0)
|
|
{
|
|
int num = 0;
|
|
if (num < array.Length)
|
|
{
|
|
if (array[num].isPlaying)
|
|
{
|
|
string text = this.soundEffectType;
|
|
if (text != 0)
|
|
{
|
|
if (string.Equals(text, "SoundEffect"))
|
|
{
|
|
AudioSource[] array2 = this.g_AS;
|
|
float soundEffectVolume = this.volumeSettings.GetSoundEffectVolume();
|
|
}
|
|
if (string.Equals(text, "Voice"))
|
|
{
|
|
AudioSource[] array3 = this.g_AS;
|
|
float voiceVolume = this.volumeSettings.GetVoiceVolume();
|
|
}
|
|
}
|
|
AudioSource audioSource = this.g_AS[num];
|
|
float num2 = this.g_fVolumeSet;
|
|
float wholeVolume = this.volumeSettings.GetWholeVolume();
|
|
audioSource.volume = num2;
|
|
}
|
|
AudioSource[] array4 = this.g_AS;
|
|
num++;
|
|
}
|
|
}
|
|
}
|
|
|
|
// Token: 0x060000CC RID: 204 RVA: 0x00004490 File Offset: 0x00002690
|
|
[Token(Token = "0x60000CC")]
|
|
[Address(RVA = "0x11FA7D0", Offset = "0x11F95D0", VA = "0x1811FA7D0")]
|
|
public SoundEffect()
|
|
{
|
|
}
|
|
|
|
// Token: 0x04000110 RID: 272
|
|
[FieldOffset(Offset = "0x18")]
|
|
[Token(Token = "0x4000110")]
|
|
public AudioClip[] Sound;
|
|
|
|
// Token: 0x04000111 RID: 273
|
|
[FieldOffset(Offset = "0x20")]
|
|
[Token(Token = "0x4000111")]
|
|
public int AudioSourceNum = (int)((ulong)1L);
|
|
|
|
// Token: 0x04000112 RID: 274
|
|
[FieldOffset(Offset = "0x28")]
|
|
[Token(Token = "0x4000112")]
|
|
public AudioMixerGroup AMG;
|
|
|
|
// Token: 0x04000113 RID: 275
|
|
[FieldOffset(Offset = "0x30")]
|
|
[Token(Token = "0x4000113")]
|
|
public float Volume = 1f;
|
|
|
|
// Token: 0x04000114 RID: 276
|
|
[FieldOffset(Offset = "0x34")]
|
|
[Token(Token = "0x4000114")]
|
|
public float Pitch = 1f;
|
|
|
|
// Token: 0x04000115 RID: 277
|
|
[FieldOffset(Offset = "0x38")]
|
|
[Token(Token = "0x4000115")]
|
|
public bool PitchRandom;
|
|
|
|
// Token: 0x04000116 RID: 278
|
|
[FieldOffset(Offset = "0x3C")]
|
|
[Token(Token = "0x4000116")]
|
|
public float PitchRandomRange;
|
|
|
|
// Token: 0x04000117 RID: 279
|
|
[FieldOffset(Offset = "0x40")]
|
|
[Token(Token = "0x4000117")]
|
|
public bool Loop;
|
|
|
|
// Token: 0x04000118 RID: 280
|
|
[FieldOffset(Offset = "0x44")]
|
|
[Token(Token = "0x4000118")]
|
|
public float SpatialBlend;
|
|
|
|
// Token: 0x04000119 RID: 281
|
|
[FieldOffset(Offset = "0x48")]
|
|
[Token(Token = "0x4000119")]
|
|
public float DistanceMin = 1f;
|
|
|
|
// Token: 0x0400011A RID: 282
|
|
[FieldOffset(Offset = "0x4C")]
|
|
[Token(Token = "0x400011A")]
|
|
public float DistanceMax = 500f;
|
|
|
|
// Token: 0x0400011B RID: 283
|
|
[FieldOffset(Offset = "0x50")]
|
|
[Token(Token = "0x400011B")]
|
|
public bool PlayOnAwake;
|
|
|
|
// Token: 0x0400011C RID: 284
|
|
[FieldOffset(Offset = "0x54")]
|
|
[Token(Token = "0x400011C")]
|
|
public AudioRolloffMode Rolloff;
|
|
|
|
// Token: 0x0400011D RID: 285
|
|
[FieldOffset(Offset = "0x58")]
|
|
[Token(Token = "0x400011D")]
|
|
public int Priority = (int)((ulong)128L);
|
|
|
|
// Token: 0x0400011E RID: 286
|
|
[FieldOffset(Offset = "0x60")]
|
|
[Token(Token = "0x400011E")]
|
|
private AudioSource[] g_AS;
|
|
|
|
// Token: 0x0400011F RID: 287
|
|
[FieldOffset(Offset = "0x68")]
|
|
[Token(Token = "0x400011F")]
|
|
private int g_iASIndex;
|
|
|
|
// Token: 0x04000120 RID: 288
|
|
[FieldOffset(Offset = "0x6C")]
|
|
[Token(Token = "0x4000120")]
|
|
private float g_fVolumeSet = 1f;
|
|
|
|
// Token: 0x04000121 RID: 289
|
|
[FieldOffset(Offset = "0x70")]
|
|
[Token(Token = "0x4000121")]
|
|
private float g_fPitchRandom;
|
|
|
|
// Token: 0x04000122 RID: 290
|
|
[FieldOffset(Offset = "0x74")]
|
|
[Token(Token = "0x4000122")]
|
|
private float g_fPitchSet = 1f;
|
|
|
|
// Token: 0x04000123 RID: 291
|
|
[FieldOffset(Offset = "0x78")]
|
|
[Token(Token = "0x4000123")]
|
|
private float g_fTimeScale = 1f;
|
|
|
|
// Token: 0x04000124 RID: 292
|
|
[FieldOffset(Offset = "0x7C")]
|
|
[Token(Token = "0x4000124")]
|
|
private bool isInitialized;
|
|
|
|
// Token: 0x04000125 RID: 293
|
|
[FieldOffset(Offset = "0x80")]
|
|
[Token(Token = "0x4000125")]
|
|
private string soundEffectType;
|
|
}
|