Example #1
0
        private void BuildSfxSoundSelector()
        {
            Rect fullscreenRect = DebugGuiSkin.GetFullscreenRect();

            GUILayout.BeginVertical(new GUILayoutOption[0]);
            this.soundSelectorScrollPosition = GUILayout.BeginScrollView(this.soundSelectorScrollPosition, new GUILayoutOption[]
            {
                GUILayout.Width(fullscreenRect.width * 2f / 3f),
                GUILayout.Height(fullscreenRect.height * 0.45f)
            });
            if (this.sfxSoundUIState == 0)
            {
                foreach (Int32 num in this.soundViewController.AllSfxGroupSongIndex)
                {
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayout.Label("EFX ID: " + num, new GUILayoutOption[0]);
                    if (GUILayout.Button("Load", new GUILayoutOption[0]))
                    {
                        this.CurrentSpecialEffectID = num;
                        this.sfxSoundUIState        = 1;
                        this.soundViewController.LoadSfxSoundGroup(num);
                    }
                    GUILayout.EndHorizontal();
                }
            }
            else if (this.sfxSoundUIState == 1)
            {
                List <String> sfxSoundPlaylist = this.soundViewController.GetSfxSoundPlaylist(this.CurrentSpecialEffectID);
                GUILayout.BeginVertical(new GUILayoutOption[0]);
                if (GUILayout.Button("Back", new GUILayoutOption[0]))
                {
                    this.sfxSoundUIState = 0;
                }
                for (Int32 i = 0; i < sfxSoundPlaylist.Count; i++)
                {
                    if (i == SoundLib.GetResidentSfxSoundCount())
                    {
                        GUILayout.Label("---- ---- ---- ----", new GUILayoutOption[0]);
                    }
                    String text = sfxSoundPlaylist[i];
                    GUILayout.BeginHorizontal(new GUILayoutOption[0]);
                    GUILayout.Label(text, new GUILayoutOption[0]);
                    if (GUILayout.Button("Play", new GUILayoutOption[0]))
                    {
                        this.soundViewController.SelectSound(i);
                    }
                    GUILayout.EndHorizontal();
                }
                GUILayout.EndVertical();
            }
            else
            {
                SoundLib.LogError("sfxSoundUIState is invalid: " + this.sfxSoundUIState);
            }
            GUILayout.EndScrollView();
            GUILayout.EndVertical();
        }