void ChangedData(ScriptableObjectParent data)
 {
     for (int i = 0; i < data.subAssets.Count; i++)
     {
         data.indent[i]          = data.GetIndent(data.subAssets[i]);
         data.warnings[i]        = data.GetWarning(data.subAssets[i]);
         data.warningMessages[i] = data.GetWarningMessage(data.subAssets[i]);
     }
 }
        protected void AddChild(ScriptableObjectParent data, ScriptableObject newChild)
        {
            //string path = GetAssetPath();
            //string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath(path + "/New " + newChild.GetType().ToString() + ".asset");
            newChild.name = newChild.GetType().ToString();

            AssetDatabase.AddObjectToAsset(newChild, data);
            data.subAssets.Add(newChild);
            data.hides.Add(false);
            data.indent.Add(data.GetIndent(newChild));
            data.warnings.Add(data.GetWarning(newChild));
            data.warningMessages.Add(data.GetWarningMessage(newChild));

            data.hideFlags     = HideFlags.None;
            newChild.hideFlags = HideFlags.None;
            Undo.RecordObject(newChild, "AddSubAsset");
            Undo.RecordObject(data, "AddSubAsset");
            AssetDatabase.SaveAssets();
            ChangedData(data);
        }