コード例 #1
0
 private void CheckInitialize(SerializedProperty property, GUIContent label)
 {
     if (_dict == null)
     {
         var target = property.serializedObject.targetObject;
         _dict = fieldInfo.GetValue(target) as SpawnRatios;
         if (_dict == null)
         {
             _dict = new SpawnRatios();
             fieldInfo.SetValue(target, _dict);
         }
         _orderedKeys = new List <GameObject>();
         foreach (var kvp in _dict)
         {
             _orderedKeys.Add(kvp.Key);
             DictionaryIntIntDrawer newDrawer = new DictionaryIntIntDrawer();
             newDrawer._dict = kvp.Value;
             _drawers.Add(kvp.Key, newDrawer);
         }
     }
 }