private void OnEnable()
 {
     if (itemDatabaseMap == null)
     {
         itemDatabaseMap = new UDictionaryIntTPItemHolder();
     }
     OnValidate();
 }
 private void OnValidate()
 {
     if (itemDatabase != null)
     {
         int length = itemDatabase.Length;
         itemDatabaseMap = new UDictionaryIntTPItemHolder();
         for (int i = 0; i < length; i++)
         {
             if (itemDatabase[i] != null)
             {
                 (itemDatabase[i] as ISerializationCallbackReceiver).OnAfterDeserialize();
                 int key = itemDatabase[i].Item.ID;
                 if (!itemDatabaseMap.ContainsKey(key))
                 {
                     itemDatabaseMap.Add(key, itemDatabase[i]);
                 }
             }
         }
     }
 }