예제 #1
0
        public void OnEnable()
        {
            _bundleDep  = target as BundleDependencies;
            asIGetNames = _bundleDep;
            var allProps = new List <string>();

            _dictionaryProperties = null;
            Dictionary <string, SerializedProperty> allProperties = new Dictionary <string, SerializedProperty>();
            var myObj = _bundleDep;

            if (myObj != null)
            {
                allProps.AddRange
                    (myObj.GetType()
                    .GetFields(BindingFlags.NonPublic | BindingFlags.Instance)
                    .Select(fieldInfo => fieldInfo.Name));
            }
            foreach (var item in allProps)
            {
                var something = serializedObject.FindProperty(item);
                if (!allProperties.ContainsKey(item) && something != null)
                {
                    allProperties.Add(item, something);
                }
                if (something != null && item.Contains(asIGetNames.GetBundleDepPropName()))
                {
                    _bundleDependenciesSerialized = something;
                }
            }
            _dictionaryProperties = allProperties;
            _listOfDependencies   = new ReorderableList(serializedObject, _bundleDependenciesSerialized.FindPropertyRelative("dictionaryitem"), true, true, true, true);
            _listOfDependencies.drawElementCallback   = DrawProductsElement;
            _listOfDependencies.drawHeaderCallback    = DrawProductsHeader;
            _listOfDependencies.elementHeightCallback = CalculateHeight;
        }
예제 #2
0
 private void DisplayOwnMapping()
 {
     foreach (var item in _dictionaryProperties.Keys)
     {
         if (item.Equals(asIGetNames.GetBundleDepPropName()))
         {
             continue;
         }
         else
         {
             DrawDefaultProps(_dictionaryProperties[item]);
         }
     }
 }