Example #1
0
 private void Select(ColorSchemeSlot selection)
 {
     _manager.SetCurrentColorScheme(selection.Scheme);
     _selected?.SetSelected(false);
     _selected = selection;
     _selected.SetSelected(true);
 }
Example #2
0
        private void Initialize()
        {
            _slots = new List <ColorSchemeSlot>();

            foreach (ColorScheme scheme in _manager.ColorSchemes)
            {
                ColorSchemeSlot instance = Instantiate(_slotPrefab, _slotContainer);
                instance.SetScheme(scheme);
                instance.SetCallback(Select);

                if (scheme == _manager.CurrentColorScheme)
                {
                    instance.SetSelected(true);
                    _selected = instance;
                }
                else
                {
                    instance.SetSelected(false);
                }

                _slots.Add(instance);
            }
        }