예제 #1
0
 /**
  * @language zh_CN
  * 添加龙骨数据。
  * @param data 龙骨数据。
  * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
  * @see #parseDragonBonesData()
  * @see #getDragonBonesData()
  * @see #removeDragonBonesData()
  * @see dragonBones.DragonBonesData
  * @version DragonBones 3.0
  */
 public void AddDragonBonesData(DragonBonesData data, string name = null)
 {
     if (data != null)
     {
         name = DragonBones.IsAvailableString(name) ? name : data.name;
         if (DragonBones.IsAvailableString(name))
         {
             if (!_dragonBonesDataMap.ContainsKey(name))
             {
                 _dragonBonesDataMap[name] = data;
             }
             else
             {
                 DragonBones.Warn("Same name data. " + name);
             }
         }
         else
         {
             DragonBones.Warn("Unnamed data.");
         }
     }
     else
     {
         DragonBones.Warn("");
     }
 }
예제 #2
0
        public virtual void Init(Armature armature, AnimationState animationState, TimelineData timelineData)
        {
            this._armature       = armature;
            this._animationState = animationState;
            this._timelineData   = timelineData;
            this._actionTimeline = this._animationState._actionTimeline;

            if (this == this._actionTimeline)
            {
                this._actionTimeline = null; //
            }

            this._frameRate       = this._armature.armatureData.frameRate;
            this._frameRateR      = 1.0f / this._frameRate;
            this._position        = this._animationState._position;
            this._duration        = this._animationState._duration;
            this._dragonBonesData = this._armature.armatureData.parent;
            this._animationData   = this._animationState._animationData;

            if (this._timelineData != null)
            {
                this._frameIntArray   = this._dragonBonesData.frameIntArray;
                this._frameFloatArray = this._dragonBonesData.frameFloatArray;
                this._frameArray      = this._dragonBonesData.frameArray;
                this._timelineArray   = this._dragonBonesData.timelineArray;
                this._frameIndices    = this._dragonBonesData.frameIndices.ToArray();

                this._frameCount       = this._timelineArray[this._timelineData.offset + (int)BinaryOffset.TimelineKeyFrameCount];
                this._frameValueOffset = this._timelineArray[this._timelineData.offset + (int)BinaryOffset.TimelineFrameValueOffset];
                var timelineScale = this._timelineArray[this._timelineData.offset + (int)BinaryOffset.TimelineScale];
                this._timeScale  = 100.0f / (timelineScale == 0 ? 100.0f : timelineScale);
                this._timeOffset = this._timelineArray[this._timelineData.offset + (int)BinaryOffset.TimelineOffset] * 0.01f;
            }
        }
        /// <summary>
        /// - Parse the raw data to a DragonBonesData instance and cache it to the factory.
        /// </summary>
        /// <param name="rawData">- The raw data.</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 all armatures. (Default: 1.0)</param>
        /// <returns>DragonBonesData instance</returns>
        /// <see cref="GetDragonBonesData()"/>
        /// <see cref="AddDragonBonesData()"/>
        /// <see cref="RemoveDragonBonesData()"/>
        /// <see cref="DragonBones.DragonBonesData"/>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// - 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。
        /// </summary>
        /// <param name="rawData">- 原始数据。</param>
        /// <param name="name">- 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称)</param>
        /// <param name="scale">- 为所有的骨架指定一个缩放值。 (默认: 1.0)</param>
        /// <returns>DragonBonesData 实例</returns>
        /// <see cref="GetDragonBonesData()"/>
        /// <see cref="AddDragonBonesData()"/>
        /// <see cref="RemoveDragonBonesData()"/>
        /// <see cref="DragonBones.DragonBonesData"/>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public DragonBonesData ParseDragonBonesData(object rawData, string name = null, float scale = 1.0f)
        {
            var             dataParser      = rawData is byte[] ? BaseFactory._binaryParser : this._dataParser;
            DragonBonesData dragonBonesData = dataParser.ParseDragonBonesData(rawData, scale);

            while (true)
            {
                var textureAtlasData = this._BuildTextureAtlasData(null, null);
                if (dataParser.ParseTextureAtlasData(null, textureAtlasData, scale))
                {
                    this.AddTextureAtlasData(textureAtlasData, name);
                }
                else
                {
                    textureAtlasData.ReturnToPool();
                    break;
                }
            }

            if (dragonBonesData != null)
            {
                this.AddDragonBonesData(dragonBonesData, name);
            }

            return(dragonBonesData);
        }
예제 #4
0
        /**
         * @private
         */
        protected DragonBonesData LoadDragonBonesData(TextAsset dragonBonesJSON, string name = null, float scale = 0.01f)
        {
            if (dragonBonesJSON == null)
            {
                return(null);
            }

            if (!string.IsNullOrEmpty(name))
            {
                var existedData = GetDragonBonesData(name);
                if (existedData != null)
                {
                    return(existedData);
                }
            }

            DragonBonesData data = ParseDragonBonesData((Dictionary <string, object>)MiniJSON.Json.Deserialize(dragonBonesJSON.text), name, scale);            // Unity default Scale Factor.

            name = dragonBonesJSON.name;
            int index = name.LastIndexOf("_ske");

            if (index > 0)
            {
                name      = name.Substring(0, index);
                data.name = name;
            }

            _dragonBonesDataMap[name] = data;
            return(data);
        }
예제 #5
0
        protected override void _OnClear()
        {
            this.playState        = -1;
            this.currentPlayTimes = -1;
            this.currentTime      = -1.0f;

            this._tweenState       = TweenState.None;
            this._frameRate        = 0;
            this._frameValueOffset = 0;
            this._frameCount       = 0;
            this._frameOffset      = 0;
            this._frameIndex       = -1;
            this._frameRateR       = 0.0f;
            this._position         = 0.0f;
            this._duration         = 0.0f;
            this._timeScale        = 1.0f;
            this._timeOffset       = 0.0f;
            this._dragonBonesData  = null; //
            this._animationData    = null; //
            this._timelineData     = null; //
            this._armature         = null; //
            this._animationState   = null; //
            this._actionTimeline   = null; //
            this._frameArray       = null; //
            this._frameIntArray    = null; //
            this._frameFloatArray  = null; //
            this._timelineArray    = null; //
            this._frameIndices     = null; //
        }
예제 #6
0
        /// <summary>
        /// Parse the json data to a DragonBonesData instance and cache it to the factory.
        /// </summary>
        /// <param name="dragonBonesJSON">The jsonData of dragonBones</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 all armatures. (Default does not scale)</param>
        /// <returns>DragonBonesData instance</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将json数据解析为 DragonBonesData 实例,并缓存到工厂中。
        /// </summary>
        /// <param name="dragonBonesJSON">龙骨的json数据。</param>
        /// <param name="name">为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称)</param>
        /// <param name="scale">为所有的骨架指定一个缩放值。 (默认不缩放)</param>
        /// <returns>龙骨数据</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public DragonBonesData LoadDragonBonesData(TextAsset dragonBonesJSON, string name = "", float scale = 0.01f)
        {
            if (dragonBonesJSON == null)
            {
                return(null);
            }

            if (!string.IsNullOrEmpty(name))
            {
                var existedData = GetDragonBonesData(name);
                if (existedData != null)
                {
                    return(existedData);
                }
            }

            DragonBonesData data = null;

            if (dragonBonesJSON.text == "DBDT")
            {
                BinaryDataParser.jsonParseDelegate = MiniJSON.Json.Deserialize;
                data = ParseDragonBonesData(dragonBonesJSON.bytes, name, scale); // Unity default Scale Factor.
            }
            else
            {
                data = ParseDragonBonesData((Dictionary <string, object>)MiniJSON.Json.Deserialize(dragonBonesJSON.text), name, scale); // Unity default Scale Factor.
            }
            //
            name = !string.IsNullOrEmpty(name) ? name : data.name;
            //
            _dragonBonesDataMap[name] = data;
            return(data);
        }
예제 #7
0
    static int AddDragonBonesData(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DragonBones.BaseFactory     obj  = (DragonBones.BaseFactory)ToLua.CheckObject <DragonBones.BaseFactory>(L, 1);
                DragonBones.DragonBonesData arg0 = (DragonBones.DragonBonesData)ToLua.CheckObject <DragonBones.DragonBonesData>(L, 2);
                obj.AddDragonBonesData(arg0);
                return(0);
            }
            else if (count == 3)
            {
                DragonBones.BaseFactory     obj  = (DragonBones.BaseFactory)ToLua.CheckObject <DragonBones.BaseFactory>(L, 1);
                DragonBones.DragonBonesData arg0 = (DragonBones.DragonBonesData)ToLua.CheckObject <DragonBones.DragonBonesData>(L, 2);
                string arg1 = ToLua.CheckString(L, 3);
                obj.AddDragonBonesData(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DragonBones.BaseFactory.AddDragonBonesData"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #8
0
 /**
  * @language zh_CN
  * 添加龙骨数据。
  * @param data 龙骨数据。
  * @param name 为数据指定一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
  * @see #ParseDragonBonesData()
  * @see #GetDragonBonesData()
  * @see #RemoveDragonBonesData()
  * @see DragonBones.DragonBonesData
  * @version DragonBones 3.0
  */
 public void AddDragonBonesData(DragonBonesData data, string name = null)
 {
     if (data != null)
     {
         name = !string.IsNullOrEmpty(name) ? name : data.name;
         if (!string.IsNullOrEmpty(name))
         {
             if (!_dragonBonesDataMap.ContainsKey(name))
             {
                 _dragonBonesDataMap[name] = data;
             }
             else
             {
                 DragonBones.Assert(false, "Same name data. " + name);
             }
         }
         else
         {
             DragonBones.Assert(false, "Unnamed data.");
         }
     }
     else
     {
         DragonBones.Assert(false, DragonBones.ARGUMENT_ERROR);
     }
 }
        /**
         * @language zh_CN
         * 解析龙骨数据。
         * @param data 龙骨数据
         * @param isUGUI 为数据提供一个名称,以便可以通过这个名称获取数据,如果未设置,则使用数据中的名称。
         * @param armatureScale 骨架缩放值
         * @param texScale 贴图缩放值
         * @returns 龙骨数据
         */
        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))
                {
                    data.dataName = dragonBonesData.name;
                }

                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
                    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);
        }
예제 #10
0
        /// <summary>
        /// Parse the raw data to a DragonBonesData instance and cache it to the factory.
        /// </summary>
        /// <param name="dragonBonesJSONPath">The path of dragonBones data in Resources. (other forms of loading can be extended by themselves)</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 all armatures. (Default does not scale)</param>
        /// <returns>DragonBonesData instance</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>en_US</language>

        /// <summary>
        /// 将原始数据解析为 DragonBonesData 实例,并缓存到工厂中。
        /// </summary>
        /// <param name="dragonBonesJSONPath">龙骨数据在 Resources 中的路径。(其他形式的加载可自行扩展)</param>
        /// <param name="name">为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称)</param>
        /// <param name="scale">为所有的骨架指定一个缩放值。 (默认不缩放)</param>
        /// <returns>龙骨数据</returns>
        /// <version>DragonBones 4.5</version>
        /// <language>zh_CN</language>
        public DragonBonesData LoadDragonBonesData(string dragonBonesJSONPath, string name = "", float scale = 0.01f)
        {
            dragonBonesJSONPath = UnityFactoryHelper.CheckResourecdPath(dragonBonesJSONPath);

            TextAsset dragonBonesJSON = Resources.Load <TextAsset>(dragonBonesJSONPath);

            DragonBonesData dragonBonesData = LoadDragonBonesData(dragonBonesJSON, name);

            return(dragonBonesData);
        }
예제 #11
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));
        }
    }
예제 #12
0
        /**
         * @private
         */
        protected override void _onClear()
        {
            foreach (var pair in bones)
            {
                pair.Value.ReturnToPool();
            }

            foreach (var pair in slots)
            {
                pair.Value.ReturnToPool();
            }

            foreach (var pair in skins)
            {
                pair.Value.ReturnToPool();
            }

            foreach (var pair in animations)
            {
                pair.Value.ReturnToPool();
            }

            foreach (var action in actions)
            {
                action.ReturnToPool();
            }

            if (userData != null)
            {
                userData.ReturnToPool();
            }

            frameRate      = 0;
            type           = ArmatureType.None;
            cacheFrameRate = 0;
            scale          = 1.0f;
            name           = null;
            aabb.Clear();
            bones.Clear();
            slots.Clear();
            skins.Clear();
            animations.Clear();
            actions.Clear();
            parent = null;

            _boneDirty = false;
            _slotDirty = false;
            _animationNames.Clear();
            _sortedBones.Clear();
            _sortedSlots.Clear();
            _bonesChildren.Clear();
            _defaultSkin      = null;
            _defaultAnimation = null;
        }
예제 #13
0
        public WeightData weight; // Initial value.

        public void Clear()
        {
            if (!this.isShared && this.weight != null)
            {
                this.weight.ReturnToPool();
            }

            this.isShared      = false;
            this.inheritDeform = false;
            this.offset        = 0;
            this.data          = null;
            this.weight        = null;
        }
예제 #14
0
        /**
         * @private
         */
        protected bool _fillBuildArmaturePackage(BuildArmaturePackage dataPackage, string dragonBonesName, string armatureName, string skinName, string textureAtlasName)
        {
            DragonBonesData dragonBonesData = null;
            ArmatureData    armatureData    = null;

            var isAvailableName = !string.IsNullOrEmpty(dragonBonesName);

            if (isAvailableName)
            {
                if (_dragonBonesDataMap.ContainsKey(dragonBonesName))
                {
                    dragonBonesData = _dragonBonesDataMap[dragonBonesName];
                    armatureData    = dragonBonesData.GetArmature(armatureName);
                }
            }

            if (armatureData == null && (!isAvailableName || autoSearch)) // Will be search all data, if do not give a data name or the autoSearch is true.
            {
                foreach (var pair in _dragonBonesDataMap)
                {
                    dragonBonesData = pair.Value;
                    if (!isAvailableName || dragonBonesData.autoSearch)
                    {
                        armatureData = dragonBonesData.GetArmature(armatureName);
                        if (armatureData != null)
                        {
                            dragonBonesName = dragonBonesData.name;
                            break;
                        }
                    }
                }
            }

            if (armatureData != null)
            {
                dataPackage.dataName         = dragonBonesName;
                dataPackage.textureAtlasName = textureAtlasName;
                dataPackage.data             = dragonBonesData;
                dataPackage.armature         = armatureData;
                dataPackage.skin             = armatureData.GetSkin(skinName);
                if (dataPackage.skin == null)
                {
                    dataPackage.skin = armatureData.defaultSkin;
                }

                return(true);
            }

            return(false);
        }
예제 #15
0
 static int AddArmature(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.DragonBonesData obj  = (DragonBones.DragonBonesData)ToLua.CheckObject(L, 1, typeof(DragonBones.DragonBonesData));
         DragonBones.ArmatureData    arg0 = (DragonBones.ArmatureData)ToLua.CheckObject(L, 2, typeof(DragonBones.ArmatureData));
         obj.AddArmature(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #16
0
 static int AddDragonBonesData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DragonBones.BaseFactory     obj  = (DragonBones.BaseFactory)ToLua.CheckObject(L, 1, typeof(DragonBones.BaseFactory));
         DragonBones.DragonBonesData arg0 = (DragonBones.DragonBonesData)ToLua.CheckObject(L, 2, typeof(DragonBones.DragonBonesData));
         string arg1 = ToLua.CheckString(L, 3);
         obj.AddDragonBonesData(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #17
0
 static int GetDragonBonesData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DragonBones.BaseFactory obj = (DragonBones.BaseFactory)ToLua.CheckObject(L, 1, typeof(DragonBones.BaseFactory));
         string arg0 = ToLua.CheckString(L, 2);
         DragonBones.DragonBonesData o = obj.GetDragonBonesData(arg0);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #18
0
        /// <summary>
        /// - Cache a DragonBonesData instance to the factory.
        /// </summary>
        /// <param name="data">- The DragonBonesData instance.</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>
        /// <see cref="ParseDragonBonesData()"/>
        /// <see cref="GetDragonBonesData()"/>
        /// <see cref="RemoveDragonBonesData()"/>
        /// <see cref="DragonBones.DragonBonesData"/>
        /// <version>DragonBones 3.0</version>
        /// <language>en_US</language>

        /// <summary>
        /// - 将 DragonBonesData 实例缓存到工厂中。
        /// </summary>
        /// <param name="data">- DragonBonesData 实例。</param>
        /// <param name="name">- 为该实例指定一个缓存名称,以便可以通过此名称获取该实例。 (如果未设置,则使用该实例中的名称)</param>
        /// <see cref="ParseDragonBonesData()"/>
        /// <see cref="GetDragonBonesData()"/>
        /// <see cref="RemoveDragonBonesData()"/>
        /// <see cref="DragonBones.DragonBonesData"/>
        /// <version>DragonBones 3.0</version>
        /// <language>zh_CN</language>
        public void AddDragonBonesData(DragonBonesData data, string name = null)
        {
            name = !string.IsNullOrEmpty(name) ? name : data.name;
            if (this._dragonBonesDataMap.ContainsKey(name))
            {
                if (this._dragonBonesDataMap[name] == data)
                {
                    return;
                }

                Helper.Assert(false, "Can not add same name data: " + name);
                return;
            }

            this._dragonBonesDataMap[name] = data;
        }
예제 #19
0
    static int set_frameRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            uint arg0 = (uint)LuaDLL.luaL_checknumber(L, 2);
            obj.frameRate = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index frameRate on a nil value" : e.Message));
        }
    }
예제 #20
0
 static int LoadData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         DragonBones.UnityArmatureComponent obj        = (DragonBones.UnityArmatureComponent)ToLua.CheckObject <DragonBones.UnityArmatureComponent>(L, 1);
         UnityEngine.TextAsset arg0                    = (UnityEngine.TextAsset)ToLua.CheckObject <UnityEngine.TextAsset>(L, 2);
         System.Collections.Generic.List <string> arg1 = (System.Collections.Generic.List <string>)ToLua.CheckObject(L, 3, typeof(System.Collections.Generic.List <string>));
         DragonBones.DragonBonesData o                 = obj.LoadData(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
예제 #21
0
    static int get_frameRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            uint ret = obj.frameRate;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index frameRate on a nil value" : e.Message));
        }
    }
예제 #22
0
    static int get_name(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            string ret = obj.name;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index name on a nil value" : e.Message));
        }
    }
예제 #23
0
    static int get_userData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            DragonBones.CustomData      ret = obj.userData;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index userData on a nil value" : e.Message));
        }
    }
예제 #24
0
    static int get_armatureNames(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            System.Collections.Generic.List <string> ret = obj.armatureNames;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index armatureNames on a nil value" : e.Message));
        }
    }
예제 #25
0
    static int set_autoSearch(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            bool arg0 = LuaDLL.luaL_checkboolean(L, 2);
            obj.autoSearch = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index autoSearch on a nil value" : e.Message));
        }
    }
예제 #26
0
    static int get_autoSearch(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            bool ret = obj.autoSearch;
            LuaDLL.lua_pushboolean(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index autoSearch on a nil value" : e.Message));
        }
    }
예제 #27
0
    static int set_name(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj = (DragonBones.DragonBonesData)o;
            string arg0 = ToLua.CheckString(L, 2);
            obj.name = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index name on a nil value" : e.Message));
        }
    }
예제 #28
0
    static int set_userData(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            DragonBones.DragonBonesData obj  = (DragonBones.DragonBonesData)o;
            DragonBones.CustomData      arg0 = (DragonBones.CustomData)ToLua.CheckObject(L, 2, typeof(DragonBones.CustomData));
            obj.userData = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index userData on a nil value" : e.Message));
        }
    }
 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));
     }
 }
예제 #30
0
 static int ParseDragonBonesData(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         DragonBones.BaseFactory obj = (DragonBones.BaseFactory)ToLua.CheckObject(L, 1, typeof(DragonBones.BaseFactory));
         System.Collections.Generic.Dictionary <string, object> arg0 = (System.Collections.Generic.Dictionary <string, object>)ToLua.CheckObject(L, 2, typeof(System.Collections.Generic.Dictionary <string, object>));
         string arg1 = ToLua.CheckString(L, 3);
         float  arg2 = (float)LuaDLL.luaL_checknumber(L, 4);
         DragonBones.DragonBonesData o = obj.ParseDragonBonesData(arg0, arg1, arg2);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }