private void OnDoubleClick(JukeBoxAudioListUI.AudioData data) { Debug.Log((object)"ダブルクリック押された"); if (data == null) { return; } bool isPlayingAudio = this.IsPlayingAudio; if (this._selectedElement == data) { this.DoSetAudio(); } else { if (this._selectedElement != null && this._selectedElement != data) { ((Graphic)this._selectedElement.text).set_color(this._whiteColor); this._selectedElement = (JukeBoxAudioListUI.AudioData)null; this.AudioStop(); } this._selectedElement = data; ((Graphic)data.text).set_color(this._yellowColor); this.DoSetAudio(); } }
private void ChangeSelectedElement(JukeBoxAudioListUI.AudioData data) { if (data == null && this._selectedElement != null) { ((Graphic)this._selectedElement.text).set_color(this._whiteColor); this._selectedElement = (JukeBoxAudioListUI.AudioData)null; this.AudioStop(); } else if (data != null && data == this._selectedElement) { ((Graphic)this._selectedElement.text).set_color(this._whiteColor); this._selectedElement = (JukeBoxAudioListUI.AudioData)null; } else { if (data == null) { return; } if (this._selectedElement != null) { ((Graphic)this._selectedElement.text).set_color(this._whiteColor); } this._selectedElement = data; ((Graphic)data.text).set_color(this._yellowColor); if (!this.IsPlayingAudio) { return; } this.DoPlay(); } }
private void DoPlay() { if (this._lastAudioData != null && this._selectedElement == this._lastAudioData) { return; } this.AudioStop(); if (this._selectedElement == null) { return; } if (this._uAudio != null) { this._uAudio.Dispose(); } bool loadedTarget = false; AudioClip clip = SoundPlayer.LoadAudioClip(this._selectedElement.filePath, ref loadedTarget, this._uAudio); if (Object.op_Inequality((Object)clip, (Object)null)) { this._currentPlayAudio = Illusion.Game.Utils.Sound.Play(Manager.Sound.Type.BGM, clip, 0.0f); this._lastAudioData = this._selectedElement; } if (!Object.op_Inequality((Object)this._currentPlayAudio, (Object)null)) { return; } ((Component)this._playButton).SetActiveSelf(false); ((Component)this._pauseButton).SetActiveSelf(true); }
public void AudioStop() { if (this.IsPlayingAudio) { this._currentPlayAudio.Stop(); } this._currentPlayAudio = (AudioSource)null; ((Component)this._playButton).SetActiveSelf(true); ((Component)this._pauseButton).SetActiveSelf(false); this._lastAudioData = (JukeBoxAudioListUI.AudioData)null; }
private void Release() { foreach (JukeBoxAudioListUI.AudioData element in this._elementList) { if (element != null) { this.ReturnElement(element); } } this._elementList.Clear(); this._noneData = (JukeBoxAudioListUI.AudioData)null; this._selectedElement = (JukeBoxAudioListUI.AudioData)null; }
private void ReturnElement(JukeBoxAudioListUI.AudioData elm) { if (elm == null || this._elementPool.Contains(elm)) { return; } if (Object.op_Inequality((Object)elm.text, (Object)null)) { ((Graphic)elm.text).set_color(this._whiteColor); } elm.Clear(); elm.Deactivate(); this._elementPool.Add(elm); }
private JukeBoxAudioListUI.AudioData GetElement() { JukeBoxAudioListUI.AudioData audioData = this._elementPool.PopFront <JukeBoxAudioListUI.AudioData>(); if (audioData == null) { Button component = (Button)((GameObject)Object.Instantiate <GameObject>((M0)this._elementPrefab, this._elementRoot, false))?.GetComponent <Button>(); Text componentInChildren = (Text)((Component)component)?.GetComponentInChildren <Text>(); if (Object.op_Inequality((Object)component, (Object)null) && Object.op_Inequality((Object)componentInChildren, (Object)null)) { audioData = new JukeBoxAudioListUI.AudioData() { button = component, text = componentInChildren } } ; } return(audioData); }
private void ListSort() { if (((IReadOnlyList <JukeBoxAudioListUI.AudioData>) this._elementList).IsNullOrEmpty <JukeBoxAudioListUI.AudioData>() || this._elementList.Count <= 2) { return; } if (this._noneData != null && this._elementList.Contains(this._noneData)) { this._elementList.Remove(this._noneData); } switch (this._sortUI.SortIndex()) { case 0: if (this._sortToggle.get_isOn()) { this._elementList.Sort((Comparison <JukeBoxAudioListUI.AudioData>)((a, b) => a.dateTime.CompareTo(b.dateTime))); break; } this._elementList.Sort((Comparison <JukeBoxAudioListUI.AudioData>)((a, b) => b.dateTime.CompareTo(a.dateTime))); break; case 1: if (this._sortToggle.get_isOn()) { this._elementList.Sort((Comparison <JukeBoxAudioListUI.AudioData>)((a, b) => a.fileName.CompareTo(b.fileName))); break; } this._elementList.Sort((Comparison <JukeBoxAudioListUI.AudioData>)((a, b) => b.fileName.CompareTo(a.fileName))); break; } if (this._noneData != null) { this._elementList.Insert(0, this._noneData); } for (int index = 0; index < this._elementList.Count; ++index) { JukeBoxAudioListUI.AudioData element = this._elementList[index]; element.index = index; ((Component)element.button).get_transform().SetAsLastSibling(); } }
public void UISetting() { this.Release(); if (this._noneData == null) { this._noneData = this.GetElement(); this._noneData.text.set_text(this._noneData.fileName = this._noneStr); this._noneData.filePath = string.Empty; } ((Component)this._playButton).SetActiveSelf(true); ((Component)this._pauseButton).SetActiveSelf(false); this._filePathList.Clear(); if (!((IReadOnlyList <string>) this._extensionList).IsNullOrEmpty <string>()) { foreach (string extension in this._extensionList) { if (!extension.IsNullOrEmpty()) { string[] files = System.IO.Directory.GetFiles(SoundPlayer.Directory.AudioFile, string.Format("*.{0}", (object)extension)); if (!((IReadOnlyList <string>)files).IsNullOrEmpty <string>()) { this._filePathList.AddRange((IEnumerable <string>)files); } } } } if (!((IReadOnlyList <string>) this._filePathList).IsNullOrEmpty <string>()) { foreach (string filePath in this._filePathList) { if (!filePath.IsNullOrEmpty()) { JukeBoxAudioListUI.AudioData element = this.GetElement(); element.filePath = filePath; element.fileName = Path.GetFileName(filePath); element.text.set_text(Path.GetFileNameWithoutExtension(filePath)); element.dateTime = File.GetLastWriteTime(filePath); this._elementList.Add(element); } } } this._elementList.Insert(0, this._noneData); this.ListSort(); foreach (JukeBoxAudioListUI.AudioData element in this._elementList) { // ISSUE: object of a compiler-generated type is created // ISSUE: variable of a compiler-generated type JukeBoxAudioListUI.\u003CUISetting\u003Ec__AnonStorey5 settingCAnonStorey5 = new JukeBoxAudioListUI.\u003CUISetting\u003Ec__AnonStorey5(); // ISSUE: reference to a compiler-generated field settingCAnonStorey5.elm = element; // ISSUE: reference to a compiler-generated field settingCAnonStorey5.\u0024this = this; // ISSUE: reference to a compiler-generated field ((Component)settingCAnonStorey5.elm.button).SetActiveSelf(true); // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated method settingCAnonStorey5.elm.ClickAction = new Action <JukeBoxAudioListUI.AudioData>(settingCAnonStorey5.\u003C\u003Em__0); // ISSUE: reference to a compiler-generated field // ISSUE: method pointer ((UnityEvent)settingCAnonStorey5.elm.button.get_onClick()).AddListener(new UnityAction((object)settingCAnonStorey5, __methodptr(\u003C\u003Em__1))); // ISSUE: reference to a compiler-generated field settingCAnonStorey5.elm.doubleClickDisposable?.Dispose(); // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated field // ISSUE: reference to a compiler-generated method // ISSUE: reference to a compiler-generated field settingCAnonStorey5.elm.doubleClickDisposable = (IDisposable)DisposableExtensions.AddTo <IDisposable>((M0)ObservableExtensions.Subscribe <IList <double> >((IObservable <M0>)UnityEventExtensions.AsObservable((UnityEvent)settingCAnonStorey5.elm.button.get_onClick()).DoubleInterval <Unit>(250f, false), (Action <M0>) new Action <IList <double> >(settingCAnonStorey5.\u003C\u003Em__2)), (Component)settingCAnonStorey5.elm.button); } }