Esempio n. 1
0
        /**
         * @language zh_CN
         * 加载、解析并添加贴图集数据。
         * @param path 贴图集数据在 Resources 中的路径。(其他形式的加载可自行扩展,使用 factory.ParseTextureAtlasData(JSONObject, Material))
         * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param scale 为贴图集设置一个缩放值。
         * @returns 贴图集数据
         * @see #ParseTextureAtlasData()
         * @see #GetTextureAtlasData()
         * @see #AddTextureAtlasData()
         * @see #RemoveTextureAtlasData()
         * @see DragonBones.UnityTextureAtlasData
         */
        public UnityTextureAtlasData LoadTextureAtlasData(string path, string name = null, float scale = 0.0f)
        {
            var index = path.LastIndexOf("Resources");

            if (index > 0)
            {
                path = path.Substring(index + 10);
            }

            index = path.LastIndexOf(".");
            if (index > 0)
            {
                path = path.Substring(0, index);
            }

            UnityTextureAtlasData textureAtlasData = null;

            if (_pathTextureAtlasDataMap.ContainsKey(path))
            {
                textureAtlasData = _pathTextureAtlasDataMap[path] as UnityTextureAtlasData;
                _refreshTextureAtlas(textureAtlasData);
            }
            else
            {
                _textureAtlasPath = path;

                textureAtlasData = LoadTextureAtlasData(Resources.Load <TextAsset>(path), name, scale);
                if (textureAtlasData != null)
                {
                    _pathTextureAtlasDataMap[path] = textureAtlasData;
                }
            }

            return(textureAtlasData);
        }
Esempio n. 2
0
        public UnityTextureAtlasData LoadTextureAtlasData(string path, string name = null, float scale = 0.0f, bool isUGUI = false)
        {
            var index = path.LastIndexOf("Resources");

            if (index > 0)
            {
                path = path.Substring(index + 10);
            }

            index = path.LastIndexOf(".");
            if (index > 0)
            {
                path = path.Substring(0, index);
            }

            UnityTextureAtlasData textureAtlasData = null;

            if (_pathTextureAtlasDataMap.ContainsKey(path))
            {
                textureAtlasData = _pathTextureAtlasDataMap[path] as UnityTextureAtlasData;
                _refreshTextureAtlas(textureAtlasData, isUGUI);
            }
            else
            {
                if (string.IsNullOrEmpty(name))
                {
                    index = path.LastIndexOf("/") + 1;
                    int lastIdx = path.LastIndexOf("_tex");
                    if (lastIdx > -1)
                    {
                        if (lastIdx > index)
                        {
                            name = path.Substring(index, lastIdx - index);
                        }
                        else
                        {
                            name = path.Substring(index);
                        }
                    }
                }

                _textureAtlasPath = path;

                // weizuo begin
                string[] fileName = path.Split('/');
                textureAtlasData = LoadTextureAtlasData(ResourceManager.LoadAny <TextAsset>(fileName[fileName.Length - 1]), name, scale);
                // end
                //textureAtlasData = LoadTextureAtlasData(Resources.Load<TextAsset>(path), name, scale,isUGUI);
                if (textureAtlasData != null)
                {
                    if (!string.IsNullOrEmpty(name))
                    {
                        textureAtlasData.name = name;
                    }
                    _pathTextureAtlasDataMap[path] = textureAtlasData;
                }
            }

            return(textureAtlasData);
        }
Esempio n. 3
0
        /**
         * @language zh_CN
         * 加载、解析并添加贴图集数据。
         * @param path 贴图集数据在 Resources 中的路径。(其他形式的加载可自行扩展,使用 factory.ParseTextureAtlasData(JSONObject, Material))
         * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param scale 为贴图集设置一个缩放值。
         * @returns 贴图集数据
         * @see #ParseTextureAtlasData()
         * @see #GetTextureAtlasData()
         * @see #AddTextureAtlasData()
         * @see #RemoveTextureAtlasData()
         * @see DragonBones.UnityTextureAtlasData
         */
        public UnityTextureAtlasData LoadTextureAtlasData(string path, string name = null, float scale = 0.0f)
        {
            var index = path.LastIndexOf("Assets/");

            if (index > -1)
            {
                path = path.Substring(index + 7);
            }

            //index = path.LastIndexOf(".");
            //if (index > 0)
            //{
            //    path = path.Substring(0, index);
            //}

            UnityTextureAtlasData textureAtlasData = null;

            if (_pathTextureAtlasDataMap.ContainsKey(path))
            {
                textureAtlasData = _pathTextureAtlasDataMap[path] as UnityTextureAtlasData;
                _refreshTextureAtlas(textureAtlasData);
            }
            else
            {
                _textureAtlasPath = path;
                TextAsset ta = CAssetManager.GetAsset(path) as TextAsset;
                textureAtlasData = LoadTextureAtlasData(ta, name, scale);
                if (textureAtlasData != null)
                {
                    _pathTextureAtlasDataMap[path] = textureAtlasData;
                }
            }

            return(textureAtlasData);
        }
Esempio n. 4
0
        /**
         * @private
         */
        protected void _refreshTextureAtlas(UnityTextureAtlasData textureAtlasData)
        {
            if (textureAtlasData.texture == null)
            {
                var textureAtlas = Resources.Load <Texture2D>(textureAtlasData.imagePath);
                var shader       = Shader.Find(defaultShaderName);
                var material     = new Material(shader);
                material.mainTexture = textureAtlas;

                textureAtlasData.texture = material;
            }
        }
        /**
         * @language zh_CN
         * 加载、解析并添加贴图集数据。
         * @param path 贴图集数据在 Resources 中的路径。(其他形式的加载可自行扩展,使用 factory.ParseTextureAtlasData(JSONObject, Material))
         * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param scale 为贴图集设置一个缩放值。
         * @returns 贴图集数据
         * @see #ParseTextureAtlasData()
         * @see #GetTextureAtlasData()
         * @see #AddTextureAtlasData()
         * @see #RemoveTextureAtlasData()
         * @see DragonBones.UnityTextureAtlasData
         */
        public UnityTextureAtlasData LoadTextureAtlasData(string textureAtlasJSONPath, string name = null, float scale = 1.0f, bool isUGUI = false)
        {
            textureAtlasJSONPath = UnityFactoryHelper.CheckResourecdPath(textureAtlasJSONPath);

            UnityTextureAtlasData textureAtlasData = null;

            if (_pathTextureAtlasDataMap.ContainsKey(textureAtlasJSONPath))
            {
                textureAtlasData = _pathTextureAtlasDataMap[textureAtlasJSONPath] as UnityTextureAtlasData;
                _RefreshTextureAtlas(textureAtlasData, isUGUI);
            }
            else
            {
                //if (string.IsNullOrEmpty(name))
                //{
                //    name = UnityFactoryHelper.GetTextureAtlasNameByPath(textureAtlasJSONPath);
                //}

                TextAsset textureAtlasJSON = Resources.Load <TextAsset>(textureAtlasJSONPath);
                if (textureAtlasJSON != null)
                {
                    Dictionary <string, object> textureJSONData = (Dictionary <string, object>)MiniJSON.Json.Deserialize(textureAtlasJSON.text);
                    textureAtlasData = ParseTextureAtlasData(textureJSONData, null, name, scale) as UnityTextureAtlasData;

                    if (textureAtlasData != null)
                    {
                        //if (!string.IsNullOrEmpty(name))
                        //{
                        //    textureAtlasData.name = name;
                        //}

                        textureAtlasData.imagePath = UnityFactoryHelper.GetTextureAtlasImagePath(textureAtlasJSONPath, textureAtlasData.imagePath);

                        _RefreshTextureAtlas(textureAtlasData, isUGUI);

                        _pathTextureAtlasDataMap[textureAtlasJSONPath] = textureAtlasData;
                    }
                }
            }

            return(textureAtlasData);
        }
Esempio n. 6
0
        /// <summary>
        /// Parse the TextureAtlas to a UnityTextureAtlasData instance and cache it to the factory.
        /// </summary>
        /// <param name="textureAtlasJSONPath">The path of dragonBones data in Resources. (other forms of loading can be extended by themselves. use factory.ParseTextureAtlasData(JSONObject, Material))</param>
        /// <param name="name">Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead)</param>
        /// <param name="scale">Specify a scaling value for textureAtlas. (Default does not scale)</param>
        /// <param name="isUGUI"></param>
        /// <returns></returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将TextureAtlas解析为UnityTextureAtlasData,并缓存到工厂中。
        /// </summary>
        /// <param name="textureAtlas"></param>
        /// <param name="name">为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。</param>
        /// <param name="scale">为贴图集设置一个缩放值。</param>
        /// <param name="isUGUI"></param>
        /// <returns></returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public UnityTextureAtlasData LoadTextureAtlasData(UnityDragonBonesData.TextureAtlas textureAtlas, string name, float scale = 1.0f, bool isUGUI = false)
        {
            Dictionary <string, object> textureJSONData  = (Dictionary <string, object>)MiniJSON.Json.Deserialize(textureAtlas.textureAtlasJSON.text);
            UnityTextureAtlasData       textureAtlasData = ParseTextureAtlasData(textureJSONData, null, name, scale) as UnityTextureAtlasData;

            if (textureJSONData.ContainsKey("width"))
            {
                textureAtlasData.width = uint.Parse(textureJSONData["width"].ToString());
            }

            if (textureJSONData.ContainsKey("height"))
            {
                textureAtlasData.height = uint.Parse(textureJSONData["height"].ToString());
            }

            if (textureAtlasData != null)
            {
                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
            }

            return(textureAtlasData);
        }
Esempio n. 7
0
        /// <summary>
        /// Parse the textureAtlas json data to a UnityTextureAtlasData instance and cache it to the factory.
        /// </summary>
        /// <param name="textureAtlasJSONPath">The path of dragonBones data in Resources. (other forms of loading can be extended by themselves. use factory.ParseTextureAtlasData(JSONObject, Material))</param>
        /// <param name="name">Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead)</param>
        /// <param name="scale">Specify a scaling value for textureAtlas. (Default does not scale)</param>
        /// <param name="isUGUI"></param>
        /// <returns></returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将贴图集json数据解析为UnityTextureAtlasData,并缓存到工厂中。
        /// </summary>
        /// <param name="textureAtlasJSONPath">贴图集数据在 Resources 中的路径。(其他形式的加载可自行扩展,使用 factory.ParseTextureAtlasData(JSONObject, Material))</param>
        /// <param name="name">为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。</param>
        /// <param name="scale">为贴图集设置一个缩放值。</param>
        /// <param name="isUGUI"></param>
        /// <returns>贴图集数据</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public UnityTextureAtlasData LoadTextureAtlasData(string textureAtlasJSONPath, string name = "", float scale = 1.0f, bool isUGUI = false)
        {
            textureAtlasJSONPath = UnityFactoryHelper.CheckResourecdPath(textureAtlasJSONPath);

            TextAsset textureAtlasJSON = Resources.Load <TextAsset>(textureAtlasJSONPath);

            //
            if (textureAtlasJSON != null)
            {
                Dictionary <string, object> textureJSONData  = (Dictionary <string, object>)MiniJSON.Json.Deserialize(textureAtlasJSON.text);
                UnityTextureAtlasData       textureAtlasData = ParseTextureAtlasData(textureJSONData, null, name, scale) as UnityTextureAtlasData;

                if (textureAtlasData != null)
                {
                    textureAtlasData.imagePath = UnityFactoryHelper.GetTextureAtlasImagePath(textureAtlasJSONPath, textureAtlasData.imagePath);

                    _RefreshTextureAtlas(textureAtlasData, isUGUI);
                }

                return(textureAtlasData);
            }

            return(null);
        }
Esempio n. 8
0
        /// <private/>
        protected void _RefreshTextureAtlas(UnityTextureAtlasData textureAtlasData, bool isUGUI, bool isEditor = false)
        {
            Material material = null;

            if (isUGUI && textureAtlasData.uiTexture == null)
            {
                if (isEditor)
                {
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        material = AssetDatabase.LoadAssetAtPath <Material>(textureAtlasData.imagePath + "_UI_Mat.mat");
                    }
#endif
                }
                else
                {
                    material = Resources.Load <Material>(textureAtlasData.imagePath + "_UI_Mat");
                }

                if (material == null)
                {
                    Texture2D textureAtlas = null;

                    if (isEditor)
                    {
#if UNITY_EDITOR
                        if (!Application.isPlaying)
                        {
                            textureAtlas = AssetDatabase.LoadAssetAtPath <Texture2D>(textureAtlasData.imagePath + ".png");
                        }
#endif
                    }
                    else
                    {
                        textureAtlas = Resources.Load <Texture2D>(textureAtlasData.imagePath);
                    }

                    material = UnityFactoryHelper.GenerateMaterial(defaultUIShaderName, textureAtlas.name + "_UI_Mat", textureAtlas);
                    if (textureAtlasData.width < 2)
                    {
                        textureAtlasData.width = (uint)textureAtlas.width;
                    }

                    if (textureAtlasData.height < 2)
                    {
                        textureAtlasData.height = (uint)textureAtlas.height;
                    }

                    textureAtlasData._disposeEnabled = true;
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        string path = AssetDatabase.GetAssetPath(textureAtlas);
                        path = path.Substring(0, path.Length - 4);
                        AssetDatabase.CreateAsset(material, path + "_UI_Mat.mat");
                        AssetDatabase.SaveAssets();
                    }
#endif
                }

                //
                textureAtlasData.uiTexture = material;
            }
            else if (!isUGUI && textureAtlasData.texture == null)
            {
                if (isEditor)
                {
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        material = AssetDatabase.LoadAssetAtPath <Material>(textureAtlasData.imagePath + "_Mat.mat");
                    }
#endif
                }
                else
                {
                    material = Resources.Load <Material>(textureAtlasData.imagePath + "_Mat");
                }

                if (material == null)
                {
                    Texture2D textureAtlas = null;
                    if (isEditor)
                    {
#if UNITY_EDITOR
                        if (!Application.isPlaying)
                        {
                            textureAtlas = AssetDatabase.LoadAssetAtPath <Texture2D>(textureAtlasData.imagePath + ".png");
                        }
#endif
                    }
                    else
                    {
                        textureAtlas = Resources.Load <Texture2D>(textureAtlasData.imagePath);
                    }

                    material = UnityFactoryHelper.GenerateMaterial(defaultShaderName, textureAtlas.name + "_Mat", textureAtlas);
                    if (textureAtlasData.width < 2)
                    {
                        textureAtlasData.width = (uint)textureAtlas.width;
                    }

                    if (textureAtlasData.height < 2)
                    {
                        textureAtlasData.height = (uint)textureAtlas.height;
                    }

                    textureAtlasData._disposeEnabled = true;
#if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        string path = AssetDatabase.GetAssetPath(textureAtlas);
                        path = path.Substring(0, path.Length - 4);
                        AssetDatabase.CreateAsset(material, path + "_Mat.mat");
                        AssetDatabase.SaveAssets();
                    }
#endif
                }

                textureAtlasData.texture = material;
            }
        }
Esempio n. 9
0
        /**
         * @private
         */
        protected void _refreshTextureAtlas(UnityTextureAtlasData textureAtlasData, bool isUGUI, bool isEditor = false)
        {
            Material material = null;

            if (isUGUI && textureAtlasData.uiTexture == null)
            {
                if (isEditor)
                {
                                        #if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        material = AssetDatabase.LoadAssetAtPath <Material>(textureAtlasData.imagePath + "_UI_Mat.mat");
                    }
                                        #endif
                }
                else
                {
                    // weizuo begin
                    string[] fileName = textureAtlasData.imagePath.Split('/');
                    material = ResourceManager.LoadAny <Material>(fileName[fileName.Length - 1] + "_UI_Mat");
                    // weizuo end
                    //material = Resources.Load<Material>(textureAtlasData.imagePath+"_UI_Mat");
                }
                if (material == null)
                {
                    Texture2D textureAtlas = null;
                    if (isEditor)
                    {
                                                #if UNITY_EDITOR
                        if (!Application.isPlaying)
                        {
                            textureAtlas = AssetDatabase.LoadAssetAtPath <Texture2D>(textureAtlasData.imagePath + ".png");
                        }
                                                #endif
                    }
                    else
                    {
                        // weizuo begin
                        string[] fileName = textureAtlasData.imagePath.Split('/');
                        textureAtlas = ResourceManager.LoadAny <Texture2D>(fileName[fileName.Length - 1]);
                        // weizuo end
                        //textureAtlas = Resources.Load<Texture2D>(textureAtlasData.imagePath);
                    }
                    Shader shader = Shader.Find(defaultUIShaderName);
                    material             = new Material(shader);
                    material.name        = textureAtlas.name + "_UI_Mat";
                    material.mainTexture = textureAtlas;
                    if (textureAtlasData.width < 2)
                    {
                        textureAtlasData.width = textureAtlas.width;
                    }
                    if (textureAtlasData.height < 2)
                    {
                        textureAtlasData.height = textureAtlas.height;
                    }
                    textureAtlasData._disposeTexture = true;
                                        #if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        string path = AssetDatabase.GetAssetPath(textureAtlas);
                        path = path.Substring(0, path.Length - 4);
                        AssetDatabase.CreateAsset(material, path + "_UI_Mat.mat");
                        AssetDatabase.SaveAssets();
                    }
                                        #endif
                }
                textureAtlasData.uiTexture = material;
            }
            else if (!isUGUI && textureAtlasData.texture == null)
            {
                if (isEditor)
                {
                                        #if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        material = AssetDatabase.LoadAssetAtPath <Material>(textureAtlasData.imagePath + "_Mat.mat");
                    }
                                        #endif
                }
                else
                {
                    // weizuo begin
                    string[] fileName = textureAtlasData.imagePath.Split('/');
                    material = ResourceManager.LoadAny <Material>(fileName[fileName.Length - 1] + "_Mat");
                    // weizuo end
                    //material = Resources.Load<Material>(textureAtlasData.imagePath+"_Mat");
                }
                if (material == null)
                {
                    Texture2D textureAtlas = null;
                    if (isEditor)
                    {
                                                #if UNITY_EDITOR
                        if (!Application.isPlaying)
                        {
                            textureAtlas = AssetDatabase.LoadAssetAtPath <Texture2D>(textureAtlasData.imagePath + ".png");
                        }
                                                #endif
                    }
                    else
                    {
                        // weizuo begin
                        string[] fileName = textureAtlasData.imagePath.Split('/');
                        textureAtlas = ResourceManager.LoadAny <Texture2D>(fileName[fileName.Length - 1]);
                        // weizuo end
                        //textureAtlas = Resources.Load<Texture2D>(textureAtlasData.imagePath);
                    }
                    Shader shader = Shader.Find(defaultShaderName);
                    material             = new Material(shader);
                    material.name        = textureAtlas.name + "_Mat";
                    material.mainTexture = textureAtlas;
                    if (textureAtlasData.width < 2)
                    {
                        textureAtlasData.width = textureAtlas.width;
                    }
                    if (textureAtlasData.height < 2)
                    {
                        textureAtlasData.height = textureAtlas.height;
                    }
                    textureAtlasData._disposeTexture = true;
                                        #if UNITY_EDITOR
                    if (!Application.isPlaying)
                    {
                        string path = AssetDatabase.GetAssetPath(textureAtlas);
                        path = path.Substring(0, path.Length - 4);
                        AssetDatabase.CreateAsset(material, path + "_Mat.mat");
                        AssetDatabase.SaveAssets();
                    }
                                        #endif
                }
                textureAtlasData.texture = material;
            }
        }
Esempio n. 10
0
    static int LoadTextureAtlasData(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                string arg0 = ToLua.CheckString(L, 2);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <string, string>(L, 2))
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <DragonBones.UnityDragonBonesData.TextureAtlas, string>(L, 2))
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData.TextureAtlas arg0 = (DragonBones.UnityDragonBonesData.TextureAtlas)ToLua.ToObject(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes <string, string, float>(L, 2))
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                float  arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes <DragonBones.UnityDragonBonesData.TextureAtlas, string, float>(L, 2))
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData.TextureAtlas arg0 = (DragonBones.UnityDragonBonesData.TextureAtlas)ToLua.ToObject(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                float  arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 5 && TypeChecker.CheckTypes <string, string, float, bool>(L, 2))
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                string arg0 = ToLua.ToString(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                float  arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                bool   arg3 = LuaDLL.lua_toboolean(L, 5);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0, arg1, arg2, arg3);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 5 && TypeChecker.CheckTypes <DragonBones.UnityDragonBonesData.TextureAtlas, string, float, bool>(L, 2))
            {
                DragonBones.UnityFactory obj = (DragonBones.UnityFactory)ToLua.CheckObject <DragonBones.UnityFactory>(L, 1);
                DragonBones.UnityDragonBonesData.TextureAtlas arg0 = (DragonBones.UnityDragonBonesData.TextureAtlas)ToLua.ToObject(L, 2);
                string arg1 = ToLua.ToString(L, 3);
                float  arg2 = (float)LuaDLL.lua_tonumber(L, 4);
                bool   arg3 = LuaDLL.lua_toboolean(L, 5);
                DragonBones.UnityTextureAtlasData o = obj.LoadTextureAtlasData(arg0, arg1, arg2, arg3);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.UnityFactory.LoadTextureAtlasData"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }