Example #1
0
    static int LoadData(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DragonBones.UnityFactory         obj  = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckObject <DragonBones.UnityDragonBonesData>(L, 2);
                DragonBones.DragonBonesData      o    = obj.LoadData(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                DragonBones.UnityFactory         obj  = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckObject <DragonBones.UnityDragonBonesData>(L, 2);
                bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
                DragonBones.DragonBonesData o = obj.LoadData(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4)
            {
                DragonBones.UnityFactory         obj  = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckObject <DragonBones.UnityDragonBonesData>(L, 2);
                bool  arg1 = LuaDLL.luaL_checkboolean(L, 3);
                float arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
                DragonBones.DragonBonesData o = obj.LoadData(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 5)
            {
                DragonBones.UnityFactory         obj  = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckObject <DragonBones.UnityDragonBonesData>(L, 2);
                bool  arg1 = LuaDLL.luaL_checkboolean(L, 3);
                float arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
                float arg3 = (float)LuaDLL.luaL_checknumber(L, 5);
                DragonBones.DragonBonesData o = obj.LoadData(arg0, arg1, arg2, arg3);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.UnityFactory.LoadData"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Example #2
0
 static int AddCacheUnityDragonBonesData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.UnityFactory         obj  = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
         DragonBones.UnityDragonBonesData arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckObject <DragonBones.UnityDragonBonesData>(L, 2);
         obj.AddCacheUnityDragonBonesData(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #3
0
 static int GetCacheUnityDragonBonesData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
         string arg0 = ToLua.CheckString(L, 2);
         DragonBones.UnityDragonBonesData o = obj.GetCacheUnityDragonBonesData(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int set_unityData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.UnityArmatureComponent obj  = (DragonBones.UnityArmatureComponent)o;
            DragonBones.UnityDragonBonesData   arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckObject <DragonBones.UnityDragonBonesData>(L, 2);
            obj.unityData = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index unityData on a nil value"));
        }
    }
    static int get_unityData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.UnityArmatureComponent obj = (DragonBones.UnityArmatureComponent)o;
            DragonBones.UnityDragonBonesData   ret = obj.unityData;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index unityData on a nil value"));
        }
    }
 static int LoadData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         DragonBones.UnityFactory         obj  = (DragonBones.UnityFactory)ToLua.CheckObject(L, 1, typeof(DragonBones.UnityFactory));
         DragonBones.UnityDragonBonesData arg0 = (DragonBones.UnityDragonBonesData)ToLua.CheckUnityObject(L, 2, typeof(DragonBones.UnityDragonBonesData));
         bool  arg1 = LuaDLL.luaL_checkboolean(L, 3);
         float arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
         DragonBones.DragonBonesData o = obj.LoadData(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Example #7
0
        /// <private/>
        public void DBClear()
        {
            if (this._armature != null)
            {
                this._armature = null;
                if (this._disposeProxy)
                {
                    try
                    {
                        var go = gameObject;
                        UnityFactoryHelper.DestroyUnityObject(gameObject);
                    }
                    catch (System.Exception e)
                    {
                    }
                }
            }

            this.unityData     = null;
            this.armatureName  = null;
            this.animationName = null;
            this.isUGUI        = false;
            this.debugDraw     = false;

            this._disposeProxy = true;
            this._armature     = null;
            this._colorTransform.Identity();
            this._sortingMode      = SortingMode.SortByZ;
            this._sortingLayerName = "Default";
            this._sortingOrder     = 0;
            this._playTimes        = 0;
            this._timeScale        = 1.0f;
            this._zSpace           = 0.0f;
            this._flipX            = false;
            this._flipY            = false;

            this._hasSortingGroup = false;

            this._debugDrawer = null;

            this._armatureZ         = 0;
            this._closeCombineMeshs = false;
        }
        /**
         * @language zh_CN
         * 解析龙骨数据。
         * @param data 龙骨数据
         * @param isUGUI 为数据提供一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param texScale 贴图缩放值
         * @returns 龙骨数据
         */
        public DragonBonesData LoadData(UnityDragonBonesData data, bool isUGUI = false, float texScale = 0)
        {
            DragonBonesData dragonBonesData = null;

            if (data.dragonBonesJSON != null)
            {
                dragonBonesData = LoadDragonBonesData(data.dragonBonesJSON);

                if (!string.IsNullOrEmpty(data.dataName) && dragonBonesData != null && data.textureAtlas != null)
                {
                    for (int i = 0; i < data.textureAtlas.Length; ++i)
                    {
                        LoadTextureAtlasData(data.textureAtlas[i], data.dataName, texScale, isUGUI);
                    }
                }
            }

            return(dragonBonesData);
        }
        private static List <string> _GetDragonBonesSkePaths(bool isCreateUnityData = false)
        {
            var dragonBonesSkePaths = new List <string>();

            foreach (var guid in Selection.assetGUIDs)
            {
                var assetPath = AssetDatabase.GUIDToAssetPath(guid);
                if (assetPath.EndsWith(".json"))
                {
                    var jsonCode = File.ReadAllText(assetPath);
                    if (jsonCode.IndexOf("\"armature\":") > 0)
                    {
                        dragonBonesSkePaths.Add(assetPath);
                    }
                }
                if (assetPath.EndsWith(".bytes"))
                {
                    TextAsset asset = AssetDatabase.LoadAssetAtPath <TextAsset>(assetPath);
                    if (asset && asset.text == "DBDT")
                    {
                        dragonBonesSkePaths.Add(assetPath);
                    }
                }
                else if (!isCreateUnityData && assetPath.EndsWith("_Data.asset"))
                {
                    UnityDragonBonesData data = AssetDatabase.LoadAssetAtPath <UnityDragonBonesData>(assetPath);
                    //if(data.dragonBonesJSON != null)
                    //               {
                    //	dragonBonesSkePaths.Add(AssetDatabase.GetAssetPath(data.dragonBonesJSON));
                    //}
                    //else if(data.dragonBonesBinary != null)
                    //{
                    //	dragonBonesSkePaths.Add(AssetDatabase.GetAssetPath(data.dragonBonesBinary));
                    //}

                    dragonBonesSkePaths.Add(AssetDatabase.GetAssetPath(data.dragonBonesJSON));
                }
            }

            return(dragonBonesSkePaths);
        }
Example #10
0
        /// <private/>
        public void DBClear()
        {
            bonesRoot = null;
            if (this._armature != null)
            {
                this._armature = null;
                if (this._disposeProxy)
                {
                    try
                    {
                        var go = gameObject;
                        UnityFactoryHelper.DestroyUnityObject(gameObject);
                    }
                    catch (System.Exception e)
                    {
                    }
                }
            }

            _disposeProxy = true;
            _armature     = null;
            unityData     = null;
            armatureName  = null;
            animationName = null;
            isUGUI        = false;
            addNormal     = false;
            unityBones    = null;
            boneHierarchy = false;

            _colorTransform.Identity();
            _sortingMode      = SortingMode.SortByZ;
            _sortingLayerName = "Default";
            _sortingOrder     = 0;
            _playTimes        = 0;
            _timeScale        = 1.0f;
            _zSpace           = 0.0f;
            _flipX            = false;
            _flipY            = false;

            _hasSortingGroup = false;
        }
        /**
         * @private
         */
        public void DBClear()
        {
            //Object.Destroy(bonesRoot);
            bonesRoot = null;
            if (_armature != null)
            {
                _armature = null;
                if (_disposeProxy)
                {
#if UNITY_EDITOR
                    Object.DestroyImmediate(gameObject);
#else
                    Object.Destroy(gameObject);
#endif
                }
            }


            _disposeProxy     = true;
            _armature         = null;
            unityData         = null;
            armatureName      = null;
            animationName     = null;
            _sortingLayerName = "Default";
            _sortingOrder     = 0;
            _playTimes        = 0;
            _timeScale        = 1.0f;
            _zSpace           = 0.0f;
            isUGUI            = false;
            zorderIsDirty     = false;
            sortingMode       = SortingMode.SortByZ;
            flipX             = false;
            flipY             = false;
            addNormal         = false;
            unityBones        = null;
            boneHierarchy     = false;
            _sortedSlots      = null;
        }
Example #12
0
        /// <private/>
        public void DBClear()
        {
            bonesRoot = null;
            if (_armature != null)
            {
                _armature = null;
                if (_disposeProxy)
                {
                    UnityFactoryHelper.DestroyUnityObject(gameObject);
                }
            }

            unityData     = null;
            armatureName  = null;
            animationName = null;
            isUGUI        = false;
            addNormal     = false;
            debugDraw     = false;
            unityBones    = null;
            boneHierarchy = false;

            _disposeProxy = true;
            _armature     = null;
            _colorTransform.Identity();
            _sortingMode      = SortingMode.SortByZ;
            _sortingLayerName = "Default";
            _sortingOrder     = 0;
            _playTimes        = 0;
            _timeScale        = 1.0f;
            _zSpace           = 0.0f;
            _flipX            = false;
            _flipY            = false;

            _hasSortingGroup = false;

            _debugDrawer = null;
        }
Example #13
0
        /// <summary>
        /// Parse the UnityDragonBonesData to a DragonBonesData instance and cache it to the factory.
        /// </summary>
        /// <param name="data">The UnityDragonBonesData data</param>
        /// <param name="isUGUI">is UGUI</param>
        /// <param name="armatureScale">The armature scale</param>
        /// <param name="texScale">The texture scale</param>
        /// <returns></returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将UnityDragonBonesData数据解析为 DragonBonesData 实例,并缓存到工厂中。
        /// </summary>
        /// <param name="data">龙骨数据</param>
        /// <param name="isUGUI">是否是UGUI</param>
        /// <param name="armatureScale">骨架缩放值</param>
        /// <param name="texScale">贴图缩放值</param>
        /// <returns></returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public DragonBonesData LoadData(UnityDragonBonesData data, bool isUGUI = false, float armatureScale = 0.01f, float texScale = 1.0f)
        {
            DragonBonesData dragonBonesData = null;

            if (data.dragonBonesJSON != null)
            {
                dragonBonesData = LoadDragonBonesData(data.dragonBonesJSON, data.dataName, armatureScale);

                if (!string.IsNullOrEmpty(data.dataName) && dragonBonesData != null && data.textureAtlas != null)
                {
#if UNITY_EDITOR
                    bool isDirty = false;
                    if (!Application.isPlaying)
                    {
                        for (int i = 0; i < data.textureAtlas.Length; ++i)
                        {
                            if (isUGUI)
                            {
                                if (data.textureAtlas[i].uiMaterial == null)
                                {
                                    isDirty = true;
                                    break;
                                }
                            }
                            else
                            {
                                if (data.textureAtlas[i].material == null)
                                {
                                    isDirty = true;
                                    break;
                                }
                            }
                        }
                    }
#endif

                    var textureAtlasDatas = this.GetTextureAtlasData(data.dataName);
                    if (textureAtlasDatas != null)
                    {
                        for (int i = 0, l = textureAtlasDatas.Count; i < l; ++i)
                        {
                            if (i < data.textureAtlas.Length)
                            {
                                var textureAtlasData = textureAtlasDatas[i] as UnityTextureAtlasData;
                                var textureAtlas     = data.textureAtlas[i];

                                textureAtlasData.uiTexture = textureAtlas.uiMaterial;
                                textureAtlasData.texture   = textureAtlas.material;
#if UNITY_EDITOR
                                if (!Application.isPlaying)
                                {
                                    textureAtlasData.imagePath = AssetDatabase.GetAssetPath(textureAtlas.texture);
                                    textureAtlasData.imagePath = textureAtlasData.imagePath.Substring(0, textureAtlasData.imagePath.Length - 4);
                                    _RefreshTextureAtlas(textureAtlasData, isUGUI, true);
                                    if (isUGUI)
                                    {
                                        textureAtlas.uiMaterial = textureAtlasData.uiTexture;
                                    }
                                    else
                                    {
                                        textureAtlas.material = textureAtlasData.texture;
                                    }
                                }
#endif
                            }
                        }
                    }
                    else
                    {
                        for (int i = 0; i < data.textureAtlas.Length; ++i)
                        {
                            LoadTextureAtlasData(data.textureAtlas[i], data.dataName, texScale, isUGUI);
                        }
                    }

#if UNITY_EDITOR
                    if (isDirty)
                    {
                        AssetDatabase.Refresh();
                        EditorUtility.SetDirty(data);
                        AssetDatabase.SaveAssets();
                    }
#endif
                }
            }

            return(dragonBonesData);
        }
        public static UnityDragonBonesData CreateUnityDragonBonesData(TextAsset dragonBonesAsset, UnityDragonBonesData.TextureAtlas[] textureAtlas)
        {
            if (dragonBonesAsset != null)
            {
                bool   isDirty = false;
                string path    = AssetDatabase.GetAssetPath(dragonBonesAsset);
                path = path.Substring(0, path.Length - 5);
                int index = path.LastIndexOf("_ske");
                if (index > 0)
                {
                    path = path.Substring(0, index);
                }
                string dataPath           = path + "_Data.asset";
                UnityDragonBonesData data = AssetDatabase.LoadAssetAtPath <UnityDragonBonesData>(dataPath);
                if (data == null)
                {
                    data = UnityDragonBonesData.CreateInstance <UnityDragonBonesData>();
                    AssetDatabase.CreateAsset(data, dataPath);
                    isDirty = true;
                }
                string name = path.Substring(path.LastIndexOf("/") + 1);
                if (string.IsNullOrEmpty(data.dataName) || !data.dataName.Equals(name))
                {
                    //data.dataName = name;
                    isDirty = true;
                }

                if (data.dragonBonesJSON != dragonBonesAsset)
                {
                    data.dragonBonesJSON = dragonBonesAsset;
                    isDirty = true;
                }
                //if(dragonBonesAsset.text=="DBDT")
                //{
                //	if(data.dragonBonesBinary!=dragonBonesAsset)
                //                {
                //		data.dragonBonesBinary = dragonBonesAsset;
                //		isDirty = true;
                //	}
                //}
                //else
                //{
                //	if(data.dragonBonesJSON!=dragonBonesAsset)
                //                {
                //		data.dragonBonesJSON = dragonBonesAsset;
                //		isDirty = true;
                //	}
                //}

                if (textureAtlas != null && textureAtlas.Length > 0 && textureAtlas[0] != null && textureAtlas[0].texture != null)
                {
                    if (data.textureAtlas == null || data.textureAtlas.Length != textureAtlas.Length)
                    {
                        isDirty = true;
                    }
                    else
                    {
                        for (int i = 0; i < textureAtlas.Length; ++i)
                        {
                            if (textureAtlas[i].material != data.textureAtlas[i].material ||
                                textureAtlas[i].uiMaterial != data.textureAtlas[i].uiMaterial ||
                                textureAtlas[i].texture != data.textureAtlas[i].texture ||
                                textureAtlas[i].textureAtlasJSON != data.textureAtlas[i].textureAtlasJSON
                                )
                            {
                                isDirty = true;
                                break;
                            }
                        }
                    }
                    data.textureAtlas = textureAtlas;
                }
                if (isDirty)
                {
                    AssetDatabase.Refresh();
                    EditorUtility.SetDirty(data);
                }

                AssetDatabase.SaveAssets();
                return(data);
            }
            return(null);
        }
        public static bool ChangeDragonBonesData(UnityArmatureComponent _armatureComponent, TextAsset dragonBoneJSON)
        {
            if (dragonBoneJSON != null)
            {
                var textureAtlasJSONs = new List <string>();
                UnityEditor.GetTextureAtlasConfigs(textureAtlasJSONs, AssetDatabase.GetAssetPath(dragonBoneJSON.GetInstanceID()));

                /*UnityDragonBonesData.TextureAtlas[] textureAtlas = new UnityDragonBonesData.TextureAtlas[textureAtlasJSONs.Count];
                 *              for(int i = 0;i < textureAtlasJSONs.Count; ++i)
                 * {
                 *                      string path = textureAtlasJSONs[i];
                 *                      //load textureAtlas data
                 *                      UnityDragonBonesData.TextureAtlas ta = new UnityDragonBonesData.TextureAtlas();
                 *                      ta.textureAtlasJSON = AssetDatabase.LoadAssetAtPath<TextAsset>(path);
                 *                      //load texture
                 *                      path = path.Substring(0,path.LastIndexOf(".json"));
                 *                      ta.texture = AssetDatabase.LoadAssetAtPath<Texture2D>(path+".png");
                 *                      //load material
                 *                      ta.material = AssetDatabase.LoadAssetAtPath<Material>(path+"_Mat.mat");
                 *                      ta.uiMaterial = AssetDatabase.LoadAssetAtPath<Material>(path+"_UI_Mat.mat");
                 *                      textureAtlas[i] = ta;
                 *              }*/

                UnityDragonBonesData.TextureAtlas[] textureAtlas = UnityEditor.GetTextureAtlasByJSONs(textureAtlasJSONs);

                UnityDragonBonesData data = UnityEditor.CreateUnityDragonBonesData(dragonBoneJSON, textureAtlas);
                _armatureComponent.unityData = data;

                var dragonBonesData = UnityFactory.factory.LoadData(data, _armatureComponent.isUGUI);
                if (dragonBonesData != null)
                {
                    Undo.RecordObject(_armatureComponent, "Set DragonBones");

                    _armatureComponent.unityData = data;

                    var armatureName = dragonBonesData.armatureNames[0];
                    ChangeArmatureData(_armatureComponent, armatureName, dragonBonesData.name);

                    _armatureComponent.gameObject.name = armatureName;

                    EditorUtility.SetDirty(_armatureComponent);

                    return(true);
                }
                else
                {
                    EditorUtility.DisplayDialog("Error", "Could not load dragonBones data.", "OK", null);

                    return(false);
                }
            }
            else if (_armatureComponent.unityData != null)
            {
                Undo.RecordObject(_armatureComponent, "Set DragonBones");

                _armatureComponent.unityData = null;

                if (_armatureComponent.armature != null)
                {
                    _armatureComponent.Dispose(false);
                }

                EditorUtility.SetDirty(_armatureComponent);

                return(true);
            }

            return(false);
        }
Example #16
0
        public static UnityDragonBonesData CreateUnityDragonBonesData(TextAsset dragonBonesAsset, UnityDragonBonesData.TextureAtlas[] textureAtlas)
        {
            if (dragonBonesAsset != null)
            {
                bool   isDirty = false;
                string path    = AssetDatabase.GetAssetPath(dragonBonesAsset);
                path = path.Substring(0, path.Length - 5);
                int index = path.LastIndexOf("_ske");
                if (index > 0)
                {
                    path = path.Substring(0, index);
                }
                //
                string dataPath = path + "_Data.asset";

                var jsonObject = (Dictionary <string, object>)MiniJSON.Json.Deserialize(dragonBonesAsset.text);
                if (dragonBonesAsset.text == "DBDT")
                {
                    int headerLength = 0;
                    jsonObject = BinaryDataParser.DeserializeBinaryJsonData(dragonBonesAsset.bytes, out headerLength);
                }
                else
                {
                    jsonObject = MiniJSON.Json.Deserialize(dragonBonesAsset.text) as Dictionary <string, object>;
                }

                var dataName = jsonObject.ContainsKey("name") ? jsonObject["name"] as string : "";

                //先从缓存里面取
                UnityDragonBonesData data = UnityFactory.factory.GetCacheUnityDragonBonesData(dataName);

                //缓存中没有,从资源里面取
                if (data == null)
                {
                    data = AssetDatabase.LoadAssetAtPath <UnityDragonBonesData>(dataPath);
                }

                //资源里面也没有,那么重新创建
                if (data == null)
                {
                    data          = UnityDragonBonesData.CreateInstance <UnityDragonBonesData>();
                    data.dataName = dataName;
                    AssetDatabase.CreateAsset(data, dataPath);
                    isDirty = true;
                }

                //
                if (string.IsNullOrEmpty(data.dataName) || !data.dataName.Equals(dataName))
                {
                    //走到这里,说明原先已经创建了,之后手动改了名字,既然又走了创建流程,那么名字也重置下
                    data.dataName = dataName;
                    isDirty       = true;
                }

                if (data.dragonBonesJSON != dragonBonesAsset)
                {
                    data.dragonBonesJSON = dragonBonesAsset;
                    isDirty = true;
                }

                if (textureAtlas != null && textureAtlas.Length > 0 && textureAtlas[0] != null && textureAtlas[0].texture != null)
                {
                    if (data.textureAtlas == null || data.textureAtlas.Length != textureAtlas.Length)
                    {
                        isDirty = true;
                    }
                    else
                    {
                        for (int i = 0; i < textureAtlas.Length; ++i)
                        {
                            if (textureAtlas[i].material != data.textureAtlas[i].material ||
                                textureAtlas[i].uiMaterial != data.textureAtlas[i].uiMaterial ||
                                textureAtlas[i].texture != data.textureAtlas[i].texture ||
                                textureAtlas[i].textureAtlasJSON != data.textureAtlas[i].textureAtlasJSON
                                )
                            {
                                isDirty = true;
                                break;
                            }
                        }
                    }
                    data.textureAtlas = textureAtlas;
                }

                if (isDirty)
                {
                    AssetDatabase.Refresh();
                    EditorUtility.SetDirty(data);
                }

                //
                UnityFactory.factory.AddCacheUnityDragonBonesData(data);

                AssetDatabase.SaveAssets();
                return(data);
            }
            return(null);
        }