Ejemplo n.º 1
0
 private void LoadExternalBackgroundOptions()
 {
     if (ExternalBackgroundButtons != null)
     {
         foreach (AdeSkinBackgroundOption option in ExternalBackgroundButtons.Values)
         {
             Destroy(option.gameObject);
         }
     }
     ExternalBackgroundButtons = new Dictionary <string, AdeSkinBackgroundOption>();
     foreach (string bg in AdeSkinHost.Instance.ExternalBackgrounds.Keys)
     {
         AdeSkinBackgroundOption option = Instantiate(BackgroundOptionPrefab, ExternalBackgroundContainer).GetComponent <AdeSkinBackgroundOption>();
         option.Initialize(bg, true, AdeSkinHost.Instance.ExternalBackgrounds[bg].value);
         ExternalBackgroundButtons.Add(bg, option);
     }
     ExternalBackgroundLabel.text = AdeSkinHost.Instance.ExternalBackgrounds.Count > 0 ? "自定义背景" : "没有可用的自定义背景";
 }
Ejemplo n.º 2
0
        private void LoadSkinOptions()
        {
            ThemeDropdown.ClearOptions();
            List <string> themes = new List <string>(AdeSkinHost.Instance.skinData.ThemeDatas.Keys);

            ThemeIds = new Dictionary <string, int>();
            for (int i = 0; i < themes.Count; i++)
            {
                ThemeIds.Add(themes[i], i);
            }
            ThemeDropdown.AddOptions(themes);

            NoteDropdown.ClearOptions();
            List <string> notes = new List <string>(AdeSkinHost.Instance.skinData.NoteDatas.Keys);

            NoteIds = new Dictionary <string, int>();
            for (int i = 0; i < notes.Count; i++)
            {
                NoteIds.Add(notes[i], i);
            }
            NoteDropdown.AddOptions(notes);

            if (InternalBackgroundButtons != null)
            {
                foreach (AdeSkinBackgroundOption option in InternalBackgroundButtons.Values)
                {
                    Destroy(option.gameObject);
                }
            }
            InternalBackgroundButtons = new Dictionary <string, AdeSkinBackgroundOption>();
            foreach (string bg in AdeSkinHost.Instance.skinData.BackgroundDatas.Keys)
            {
                AdeSkinBackgroundOption option = Instantiate(BackgroundOptionPrefab, InternalBackgroundContainer).GetComponent <AdeSkinBackgroundOption>();
                option.Initialize(bg, false, AdeSkinHost.Instance.skinData.BackgroundDatas[bg].background.value);
                InternalBackgroundButtons.Add(bg, option);
            }
        }