Exemple #1
0
 void CachePropertiesDrawer(bool clearCurrentCache = false)
 {
     if (selectedType == null)
     {
         return;
     }
     if (clearCurrentCache)
     {
         propertiesDrawerCache.Clear();
     }
     if (!propertiesDrawerCache.ContainsKey(selectedType))
     {
         propertiesDrawerCache.Add(selectedType, new EditablePropertyDrawer[0]);
     }
     EditablePropertyDrawer[] drawers = new EditablePropertyDrawer[0];
     for (int i = 0; i < selectedProperties.Length; i++)
     {
         EditablePropertyDrawer drawer = new EditablePropertyDrawer(selectedType, selectedProperties [i], OnApplyPropertyChanged, OnPropertyDelete);
         ArrayUtility.Add <EditablePropertyDrawer> (ref drawers, drawer);
     }
     propertiesDrawerCache [selectedType] = drawers;
 }
Exemple #2
0
        private void CachePropertiesDrawer(bool clearCurrentCache = false)
        {
            if (_selectedType == null)
            {
                return;
            }
            if (clearCurrentCache)
            {
                _propertiesDrawerCache.Clear();
            }
            if (!_propertiesDrawerCache.ContainsKey(_selectedType))
            {
                _propertiesDrawerCache.Add(_selectedType, new EditablePropertyDrawer[0]);
            }
            var drawers = new EditablePropertyDrawer[0];

            for (var i = 0; i < _selectedProperties.Length; i++)
            {
                var drawer = new EditablePropertyDrawer(_config, _selectedType, _selectedProperties[i], OnApplyPropertyChanged, OnPropertyDelete);
                ArrayUtility.Add(ref drawers, drawer);
            }
            _propertiesDrawerCache[_selectedType] = drawers;
        }