Esempio n. 1
0
        public void RefreshOptions()
        {
            var           pickers = App.Instance.GetComponent <CustomColorPaletteStorage>();
            List <Option> options = new List <Option>();

            foreach (var modeAndInfo in pickers.ModeToPickerInfo)
            {
                if (ColorPickerUtils.ModeIsValid(modeAndInfo.mode))
                {
                    options.Add(new Option {
                        m_Description = modeAndInfo.mode.ToString(),
                        m_Texture     = modeAndInfo.info.icon
                    });
                }
            }

            m_Options = options.ToArray();
            if (m_Options.Length < 2)
            {
                gameObject.SetActive(false);
            }
            else
            {
                CreateOptionSides();
                ColorPickerMode initialMode = CustomColorPaletteStorage.m_Instance.Mode;
                if (ColorPickerUtils.ModeIsValid(initialMode))
                {
                    ForceSelectedOption((int)initialMode);
                }
                else
                {
                    ColorPickerUtils.GoToNextMode();
                }
            }
        }
Esempio n. 2
0
 override protected void OnButtonPressed()
 {
     ColorPickerUtils.GoToNextMode();
 }