/** * @private */ public void AddBoneTimeline(BoneTimelineData value) { if (value != null && value.bone != null && !boneTimelines.ContainsKey(value.bone.name)) { boneTimelines[value.bone.name] = value; } else { DragonBones.Assert(false, DragonBones.ARGUMENT_ERROR); } }
/** * @private */ public void AddBoneTimeline(BoneTimelineData value) { if (value != null && value.bone != null && !boneTimelines.ContainsKey(value.bone.name)) { boneTimelines[value.bone.name] = value; } else { DragonBones.Warn(""); } }
static int AddBoneTimeline(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData)); DragonBones.BoneTimelineData arg0 = (DragonBones.BoneTimelineData)ToLua.CheckObject(L, 2, typeof(DragonBones.BoneTimelineData)); obj.AddBoneTimeline(arg0); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int GetBoneTimeline(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DragonBones.AnimationData obj = (DragonBones.AnimationData)ToLua.CheckObject(L, 1, typeof(DragonBones.AnimationData)); string arg0 = ToLua.CheckString(L, 2); DragonBones.BoneTimelineData o = obj.GetBoneTimeline(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
private void _getTimelineFrameMatrix(AnimationData animation,BoneTimelineData timeline,float position,Transform transform) // Support 2.x ~ 3.x data. { var frameIndex = (int)Math.Floor(position * animation.frameCount / animation.duration); if (timeline.frames.Count == 1 || frameIndex >= timeline.frames.Count) { transform.CopyFrom(timeline.frames[0].transform); } else { var frame = timeline.frames[frameIndex]; float tweenProgress = 0.0f; if (frame.tweenEasing != DragonBones.NO_TWEEN) { tweenProgress = (position - frame.position) / frame.duration; if (frame.tweenEasing != 0.0f) { tweenProgress = TweenTimelineState <BoneFrameData,BoneTimelineData> ._getEasingValue(tweenProgress,frame.tweenEasing); } } else if (frame.curve != null) { tweenProgress = (position - frame.position) / frame.duration; tweenProgress = TweenTimelineState <BoneFrameData,BoneTimelineData> ._getCurveEasingValue(tweenProgress,frame.curve); } var nextFrame = frame.next; transform.x = nextFrame.transform.x - frame.transform.x; transform.y = nextFrame.transform.y - frame.transform.y; transform.skewX = Transform.NormalizeRadian(nextFrame.transform.skewX - frame.transform.skewX); transform.skewY = Transform.NormalizeRadian(nextFrame.transform.skewY - frame.transform.skewY); transform.scaleX = nextFrame.transform.scaleX - frame.transform.scaleX; transform.scaleY = nextFrame.transform.scaleY - frame.transform.scaleY; transform.x = frame.transform.x + transform.x * tweenProgress; transform.y = frame.transform.y + transform.y * tweenProgress; transform.skewX = frame.transform.skewX + transform.skewX * tweenProgress; transform.skewY = frame.transform.skewY + transform.skewY * tweenProgress; transform.scaleX = frame.transform.scaleX + transform.scaleX * tweenProgress; transform.scaleY = frame.transform.scaleY + transform.scaleY * tweenProgress; } transform.Add(timeline.originTransform); }
static int set_bone(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DragonBones.BoneTimelineData obj = (DragonBones.BoneTimelineData)o; DragonBones.BoneData arg0 = (DragonBones.BoneData)ToLua.CheckObject(L, 2, typeof(DragonBones.BoneData)); obj.bone = arg0; return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index bone on a nil value" : e.Message)); } }
static int get_originTransform(IntPtr L) { object o = null; try { o = ToLua.ToObject(L, 1); DragonBones.BoneTimelineData obj = (DragonBones.BoneTimelineData)o; DragonBones.Transform ret = obj.originTransform; ToLua.PushObject(L, ret); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index originTransform on a nil value" : e.Message)); } }
static int _init(IntPtr L) { try { ToLua.CheckArgsCount(L, 4); DragonBones.BoneTimelineState obj = (DragonBones.BoneTimelineState)ToLua.CheckObject(L, 1, typeof(DragonBones.BoneTimelineState)); DragonBones.Armature arg0 = (DragonBones.Armature)ToLua.CheckObject(L, 2, typeof(DragonBones.Armature)); DragonBones.AnimationState arg1 = (DragonBones.AnimationState)ToLua.CheckObject(L, 3, typeof(DragonBones.AnimationState)); DragonBones.BoneTimelineData arg2 = (DragonBones.BoneTimelineData)ToLua.CheckObject(L, 4, typeof(DragonBones.BoneTimelineData)); obj._init(arg0, arg1, arg2); return(0); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static int _CreateDragonBones_BoneTimelineData(IntPtr L) { try { int count = LuaDLL.lua_gettop(L); if (count == 0) { DragonBones.BoneTimelineData obj = new DragonBones.BoneTimelineData(); ToLua.PushObject(L, obj); return(1); } else { return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: DragonBones.BoneTimelineData.New")); } } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }