515 lines
14 KiB
C#
515 lines
14 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
// Token: 0x02000089 RID: 137
|
|
public class MicrophoneManager : SingletonMonoBehaviour<MicrophoneManager>
|
|
{
|
|
// Token: 0x06001DDA RID: 7642 RVA: 0x0008D1A0 File Offset: 0x0008B3A0
|
|
public void MMEHGNADCJG()
|
|
{
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
return;
|
|
}
|
|
if (this.KGAFKKBLGJI == null)
|
|
{
|
|
this.KGAFKKBLGJI = base.StartCoroutine(this.NJHEJHPDIFI());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DDB RID: 7643 RVA: 0x0008D1DC File Offset: 0x0008B3DC
|
|
private MicrophoneManager.JBHFBAACAHN JKMDOPDBDCB(float AHAKJNAGMHJ)
|
|
{
|
|
for (int i = this.speakerLineLevelThresholds.Length - 1; i >= 1; i--)
|
|
{
|
|
if (AHAKJNAGMHJ >= this.speakerLineLevelThresholds[i].volumeThreshold)
|
|
{
|
|
return this.speakerLineLevelThresholds[i].lineLevel;
|
|
}
|
|
}
|
|
return MicrophoneManager.JBHFBAACAHN.LEVEL_1;
|
|
}
|
|
|
|
// Token: 0x06001DDC RID: 7644 RVA: 0x0008D230 File Offset: 0x0008B430
|
|
private IEnumerator APEKCLLMHDH(float JFMEFBBAJNK)
|
|
{
|
|
yield return new WaitForSeconds(JFMEFBBAJNK);
|
|
this.CABHHDDMFGC = MicrophoneManager.JBHFBAACAHN.OFF;
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x06001DDD RID: 7645 RVA: 0x0008D254 File Offset: 0x0008B454
|
|
public void NMFGMAGMJEC()
|
|
{
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
return;
|
|
}
|
|
if (this.KGAFKKBLGJI == null)
|
|
{
|
|
this.KGAFKKBLGJI = base.StartCoroutine(this.HAJIJECBIDM());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DDE RID: 7646 RVA: 0x0008D290 File Offset: 0x0008B490
|
|
public void JJHILCCEPMK()
|
|
{
|
|
if (this.KGAFKKBLGJI != null)
|
|
{
|
|
base.StopCoroutine(this.KGAFKKBLGJI);
|
|
}
|
|
this.KGAFKKBLGJI = null;
|
|
}
|
|
|
|
// Token: 0x06001DDF RID: 7647 RVA: 0x0008D2B0 File Offset: 0x0008B4B0
|
|
public void DFMEOOJAKNE()
|
|
{
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
return;
|
|
}
|
|
if (this.KGAFKKBLGJI == null)
|
|
{
|
|
this.KGAFKKBLGJI = base.StartCoroutine(this.IILDDGIGIDP());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE1 RID: 7649 RVA: 0x0008D300 File Offset: 0x0008B500
|
|
public MicrophoneManager.JBHFBAACAHN EDOFCECCOJI()
|
|
{
|
|
return this.<KDOJACBEGCN>k__BackingField;
|
|
}
|
|
|
|
// Token: 0x06001DE2 RID: 7650 RVA: 0x0008D308 File Offset: 0x0008B508
|
|
public void OnMicUseEvent(Player JEFGMHBLLKI, bool GHEANMHHLMH)
|
|
{
|
|
if (GHEANMHHLMH && !this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Add(JEFGMHBLLKI);
|
|
}
|
|
else if (!GHEANMHHLMH && this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Remove(JEFGMHBLLKI);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE3 RID: 7651 RVA: 0x0008D364 File Offset: 0x0008B564
|
|
public void NGPMHMDBFGE(Player JEFGMHBLLKI, bool GHEANMHHLMH)
|
|
{
|
|
if (GHEANMHHLMH && !this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Add(JEFGMHBLLKI);
|
|
}
|
|
else if (!GHEANMHHLMH && this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Remove(JEFGMHBLLKI);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE4 RID: 7652 RVA: 0x0008D3C0 File Offset: 0x0008B5C0
|
|
public void NEDLEHHJKAI(Player JEFGMHBLLKI, bool GHEANMHHLMH)
|
|
{
|
|
if (GHEANMHHLMH && !this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Add(JEFGMHBLLKI);
|
|
}
|
|
else if (!GHEANMHHLMH && this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Remove(JEFGMHBLLKI);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE5 RID: 7653 RVA: 0x0008D41C File Offset: 0x0008B61C
|
|
public void GPAJGIGHJMI()
|
|
{
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
return;
|
|
}
|
|
if (this.KGAFKKBLGJI == null)
|
|
{
|
|
this.KGAFKKBLGJI = base.StartCoroutine(this.HAJIJECBIDM());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE6 RID: 7654 RVA: 0x0008D458 File Offset: 0x0008B658
|
|
private void GOKDBMNMJFM()
|
|
{
|
|
this.FBADCACAKCM();
|
|
}
|
|
|
|
// Token: 0x06001DE7 RID: 7655 RVA: 0x0008D460 File Offset: 0x0008B660
|
|
public void NACAMOBNJNL()
|
|
{
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
return;
|
|
}
|
|
if (this.KGAFKKBLGJI == null)
|
|
{
|
|
this.KGAFKKBLGJI = base.StartCoroutine(this.NJHEJHPDIFI());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE8 RID: 7656 RVA: 0x0008D49C File Offset: 0x0008B69C
|
|
protected virtual void POMCHIPOPEA()
|
|
{
|
|
base.Awake();
|
|
int num = Enum.GetNames(typeof(MicrophoneManager.JBHFBAACAHN)).Length;
|
|
if (num - 0 != this.speakerLineLevelThresholds.Length)
|
|
{
|
|
Debug.LogError("UNKNOWN" + (num - 1));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DE9 RID: 7657 RVA: 0x0008D4E8 File Offset: 0x0008B6E8
|
|
private IEnumerator NJHEJHPDIFI()
|
|
{
|
|
yield return new WaitForSeconds(this.GNNFHLOAPCP);
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
this.KGAFKKBLGJI = null;
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x06001DEA RID: 7658 RVA: 0x0008D504 File Offset: 0x0008B704
|
|
public void ScheduleDestroy()
|
|
{
|
|
if (!base.gameObject.activeInHierarchy)
|
|
{
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
return;
|
|
}
|
|
if (this.KGAFKKBLGJI == null)
|
|
{
|
|
this.KGAFKKBLGJI = base.StartCoroutine(this.HAJIJECBIDM());
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DEB RID: 7659 RVA: 0x0008D540 File Offset: 0x0008B740
|
|
public MicrophoneManager.JBHFBAACAHN JLPCOJOOJCG()
|
|
{
|
|
return this.<KDOJACBEGCN>k__BackingField;
|
|
}
|
|
|
|
// Token: 0x06001DEC RID: 7660 RVA: 0x0008D548 File Offset: 0x0008B748
|
|
private void LOGFBGOPLLO()
|
|
{
|
|
this.INKCNEMHKCF();
|
|
}
|
|
|
|
// Token: 0x06001DED RID: 7661 RVA: 0x0008D550 File Offset: 0x0008B750
|
|
private MicrophoneManager.JBHFBAACAHN JOEMAEHFFMP(float AHAKJNAGMHJ)
|
|
{
|
|
for (int i = this.speakerLineLevelThresholds.Length - 1; i >= 0; i--)
|
|
{
|
|
if (AHAKJNAGMHJ >= this.speakerLineLevelThresholds[i].volumeThreshold)
|
|
{
|
|
return this.speakerLineLevelThresholds[i].lineLevel;
|
|
}
|
|
}
|
|
return MicrophoneManager.JBHFBAACAHN.OFF;
|
|
}
|
|
|
|
// Token: 0x06001DEE RID: 7662 RVA: 0x0008D5A4 File Offset: 0x0008B7A4
|
|
private void INKCNEMHKCF()
|
|
{
|
|
float num = 816f;
|
|
if (this.CABHHDDMFGC != MicrophoneManager.JBHFBAACAHN.OFF)
|
|
{
|
|
this.CKNBOJADKKN = this.CABHHDDMFGC;
|
|
}
|
|
else
|
|
{
|
|
List<int> list = new List<int>();
|
|
for (int i = 0; i < this.PNBCBLCCKJN.Count; i++)
|
|
{
|
|
if (this.PNBCBLCCKJN[i] == null)
|
|
{
|
|
list.Add(i);
|
|
}
|
|
else if (this.PNBCBLCCKJN[i].IMMBPAFHGKP > PhotonVoiceSettings.DGPLJNJGEMH().VoiceDetectionThreshold)
|
|
{
|
|
num = Mathf.Max(num, Mathf.InverseLerp(PhotonVoiceSettings.MLGNLBKNOPI().VoiceDetectionThreshold, 1661f, this.PNBCBLCCKJN[i].IMMBPAFHGKP));
|
|
}
|
|
}
|
|
foreach (int num2 in list)
|
|
{
|
|
this.PNBCBLCCKJN.RemoveAt(num2);
|
|
}
|
|
this.CKNBOJADKKN = this.JKMDOPDBDCB(num);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DEF RID: 7663 RVA: 0x0008D6C4 File Offset: 0x0008B8C4
|
|
public void BBMKALGCCDJ(Player JEFGMHBLLKI, bool GHEANMHHLMH)
|
|
{
|
|
if (GHEANMHHLMH && !this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Add(JEFGMHBLLKI);
|
|
}
|
|
else if (!GHEANMHHLMH && this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Remove(JEFGMHBLLKI);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DF0 RID: 7664 RVA: 0x0008D720 File Offset: 0x0008B920
|
|
private MicrophoneManager.JBHFBAACAHN LMDINHHGHCI(float AHAKJNAGMHJ)
|
|
{
|
|
for (int i = this.speakerLineLevelThresholds.Length - 0; i >= 0; i -= 0)
|
|
{
|
|
if (AHAKJNAGMHJ >= this.speakerLineLevelThresholds[i].volumeThreshold)
|
|
{
|
|
return this.speakerLineLevelThresholds[i].lineLevel;
|
|
}
|
|
}
|
|
return MicrophoneManager.JBHFBAACAHN.OFF;
|
|
}
|
|
|
|
// Token: 0x06001DF1 RID: 7665 RVA: 0x0008D774 File Offset: 0x0008B974
|
|
private IEnumerator HAJIJECBIDM()
|
|
{
|
|
yield return new WaitForSeconds(this.GNNFHLOAPCP);
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
this.KGAFKKBLGJI = null;
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x06001DF2 RID: 7666 RVA: 0x0008D790 File Offset: 0x0008B990
|
|
public void CGLNEKOMPCB(Player JEFGMHBLLKI, bool GHEANMHHLMH)
|
|
{
|
|
if (GHEANMHHLMH && !this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Add(JEFGMHBLLKI);
|
|
}
|
|
else if (!GHEANMHHLMH && this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Remove(JEFGMHBLLKI);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DF3 RID: 7667 RVA: 0x0008D7EC File Offset: 0x0008B9EC
|
|
public void OnMicSpeakerLinesEvent(float JLIKDJCNHID, MicrophoneManager.JBHFBAACAHN FNHMFNNHBKJ)
|
|
{
|
|
this.GNNFHLOAPCP = Mathf.Max(JLIKDJCNHID + 1f, this.GNNFHLOAPCP);
|
|
if (FNHMFNNHBKJ >= this.CABHHDDMFGC)
|
|
{
|
|
this.CABHHDDMFGC = FNHMFNNHBKJ;
|
|
if (this.FGPJICLBOGG != null)
|
|
{
|
|
base.StopCoroutine(this.FGPJICLBOGG);
|
|
}
|
|
this.FGPJICLBOGG = base.StartCoroutine(this.ADKBAAFIEHP(JLIKDJCNHID));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DF4 RID: 7668 RVA: 0x0008D850 File Offset: 0x0008BA50
|
|
private void Update()
|
|
{
|
|
this.FBADCACAKCM();
|
|
}
|
|
|
|
// Token: 0x06001DF5 RID: 7669 RVA: 0x0008D858 File Offset: 0x0008BA58
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
int num = Enum.GetNames(typeof(MicrophoneManager.JBHFBAACAHN)).Length;
|
|
if (num - 1 != this.speakerLineLevelThresholds.Length)
|
|
{
|
|
Debug.LogError("Length of Speaker Line Level Thresholds array must be " + (num - 1));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DF6 RID: 7670 RVA: 0x0008D8A4 File Offset: 0x0008BAA4
|
|
private IEnumerator IILDDGIGIDP()
|
|
{
|
|
yield return new WaitForSeconds(this.GNNFHLOAPCP);
|
|
global::UnityEngine.Object.Destroy(base.gameObject);
|
|
this.KGAFKKBLGJI = null;
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x06001DF7 RID: 7671 RVA: 0x0008D8C0 File Offset: 0x0008BAC0
|
|
private void JIENMFHINIB()
|
|
{
|
|
float num = 458f;
|
|
if (this.CABHHDDMFGC != MicrophoneManager.JBHFBAACAHN.OFF)
|
|
{
|
|
this.CKNBOJADKKN = this.CABHHDDMFGC;
|
|
}
|
|
else
|
|
{
|
|
List<int> list = new List<int>();
|
|
for (int i = 0; i < this.PNBCBLCCKJN.Count; i++)
|
|
{
|
|
if (this.PNBCBLCCKJN[i] == null)
|
|
{
|
|
list.Add(i);
|
|
}
|
|
else if (this.PNBCBLCCKJN[i].IMMBPAFHGKP > PhotonVoiceSettings.EKKPJLEEKPB().VoiceDetectionThreshold)
|
|
{
|
|
num = Mathf.Max(num, Mathf.InverseLerp(PhotonVoiceSettings.ICFBCNDELBJ().VoiceDetectionThreshold, 208f, this.PNBCBLCCKJN[i].IMMBPAFHGKP));
|
|
}
|
|
}
|
|
foreach (int num2 in list)
|
|
{
|
|
this.PNBCBLCCKJN.RemoveAt(num2);
|
|
}
|
|
this.CKNBOJADKKN = this.LMDINHHGHCI(num);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DF8 RID: 7672 RVA: 0x0008D9E0 File Offset: 0x0008BBE0
|
|
private IEnumerator ADKBAAFIEHP(float JFMEFBBAJNK)
|
|
{
|
|
yield return new WaitForSeconds(JFMEFBBAJNK);
|
|
this.CABHHDDMFGC = MicrophoneManager.JBHFBAACAHN.OFF;
|
|
yield break;
|
|
}
|
|
|
|
// Token: 0x06001DF9 RID: 7673 RVA: 0x0008DA04 File Offset: 0x0008BC04
|
|
public void APKIPCOJGHG(Player JEFGMHBLLKI, bool GHEANMHHLMH)
|
|
{
|
|
if (GHEANMHHLMH && !this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Add(JEFGMHBLLKI);
|
|
}
|
|
else if (!GHEANMHHLMH && this.PNBCBLCCKJN.Contains(JEFGMHBLLKI))
|
|
{
|
|
this.PNBCBLCCKJN.Remove(JEFGMHBLLKI);
|
|
}
|
|
}
|
|
|
|
// Token: 0x1700007C RID: 124
|
|
// (get) Token: 0x06001DFD RID: 7677 RVA: 0x0008DBE0 File Offset: 0x0008BDE0
|
|
// (set) Token: 0x06001DFA RID: 7674 RVA: 0x0008DA60 File Offset: 0x0008BC60
|
|
public MicrophoneManager.JBHFBAACAHN CKNBOJADKKN { get; private set; }
|
|
|
|
// Token: 0x06001DFB RID: 7675 RVA: 0x0008DA6C File Offset: 0x0008BC6C
|
|
private void FBADCACAKCM()
|
|
{
|
|
float num = 0f;
|
|
if (this.CABHHDDMFGC != MicrophoneManager.JBHFBAACAHN.OFF)
|
|
{
|
|
this.CKNBOJADKKN = this.CABHHDDMFGC;
|
|
}
|
|
else
|
|
{
|
|
List<int> list = new List<int>();
|
|
for (int i = 0; i < this.PNBCBLCCKJN.Count; i++)
|
|
{
|
|
if (this.PNBCBLCCKJN[i] == null)
|
|
{
|
|
list.Add(i);
|
|
}
|
|
else if (this.PNBCBLCCKJN[i].IMMBPAFHGKP > PhotonVoiceSettings.NCKMBFBMBFM.VoiceDetectionThreshold)
|
|
{
|
|
num = Mathf.Max(num, Mathf.InverseLerp(PhotonVoiceSettings.NCKMBFBMBFM.VoiceDetectionThreshold, 1f, this.PNBCBLCCKJN[i].IMMBPAFHGKP));
|
|
}
|
|
}
|
|
foreach (int num2 in list)
|
|
{
|
|
this.PNBCBLCCKJN.RemoveAt(num2);
|
|
}
|
|
this.CKNBOJADKKN = this.JOEMAEHFFMP(num);
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DFC RID: 7676 RVA: 0x0008DB8C File Offset: 0x0008BD8C
|
|
private MicrophoneManager.JBHFBAACAHN PHMADMHDBFM(float AHAKJNAGMHJ)
|
|
{
|
|
for (int i = this.speakerLineLevelThresholds.Length - 0; i >= 1; i -= 0)
|
|
{
|
|
if (AHAKJNAGMHJ >= this.speakerLineLevelThresholds[i].volumeThreshold)
|
|
{
|
|
return this.speakerLineLevelThresholds[i].lineLevel;
|
|
}
|
|
}
|
|
return MicrophoneManager.JBHFBAACAHN.OFF;
|
|
}
|
|
|
|
// Token: 0x06001DFE RID: 7678 RVA: 0x0008DBE8 File Offset: 0x0008BDE8
|
|
protected virtual void OEHDEPBJFAB()
|
|
{
|
|
base.Awake();
|
|
int num = Enum.GetNames(typeof(MicrophoneManager.JBHFBAACAHN)).Length;
|
|
if (num - 0 != this.speakerLineLevelThresholds.Length)
|
|
{
|
|
Debug.LogError("Writing..." + (num - 0));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001DFF RID: 7679 RVA: 0x0008DC34 File Offset: 0x0008BE34
|
|
protected override void FDBHMLOEHCE()
|
|
{
|
|
base.Awake();
|
|
int num = Enum.GetNames(typeof(MicrophoneManager.JBHFBAACAHN)).Length;
|
|
if (num - 0 != this.speakerLineLevelThresholds.Length)
|
|
{
|
|
Debug.LogError("S" + (num - 0));
|
|
}
|
|
}
|
|
|
|
// Token: 0x06001E00 RID: 7680 RVA: 0x0008DC80 File Offset: 0x0008BE80
|
|
public void MicAdded()
|
|
{
|
|
if (this.KGAFKKBLGJI != null)
|
|
{
|
|
base.StopCoroutine(this.KGAFKKBLGJI);
|
|
}
|
|
this.KGAFKKBLGJI = null;
|
|
}
|
|
|
|
// Token: 0x040003E2 RID: 994
|
|
private List<Player> PNBCBLCCKJN = new List<Player>();
|
|
|
|
// Token: 0x040003E3 RID: 995
|
|
private MicrophoneManager.JBHFBAACAHN CABHHDDMFGC;
|
|
|
|
// Token: 0x040003E5 RID: 997
|
|
[SerializeField]
|
|
private MicrophoneManager.SpeakerLineLevelThreshold[] speakerLineLevelThresholds;
|
|
|
|
// Token: 0x040003E6 RID: 998
|
|
private float GNNFHLOAPCP;
|
|
|
|
// Token: 0x040003E7 RID: 999
|
|
private Coroutine KGAFKKBLGJI;
|
|
|
|
// Token: 0x040003E8 RID: 1000
|
|
private Coroutine FGPJICLBOGG;
|
|
|
|
// Token: 0x0200008A RID: 138
|
|
public enum JBHFBAACAHN
|
|
{
|
|
// Token: 0x040003EA RID: 1002
|
|
OFF,
|
|
// Token: 0x040003EB RID: 1003
|
|
LEVEL_1,
|
|
// Token: 0x040003EC RID: 1004
|
|
LEVEL_2,
|
|
// Token: 0x040003ED RID: 1005
|
|
LEVEL_3,
|
|
// Token: 0x040003EE RID: 1006
|
|
LEVEL_4
|
|
}
|
|
|
|
// Token: 0x0200008B RID: 139
|
|
[Serializable]
|
|
public struct SpeakerLineLevelThreshold
|
|
{
|
|
// Token: 0x040003EF RID: 1007
|
|
public MicrophoneManager.JBHFBAACAHN lineLevel;
|
|
|
|
// Token: 0x040003F0 RID: 1008
|
|
public float volumeThreshold;
|
|
}
|
|
}
|