static int OnComplete(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DG.Tweening.TweenParams obj = (DG.Tweening.TweenParams)ToLua.CheckObject(L, 1, typeof(DG.Tweening.TweenParams)); DG.Tweening.TweenCallback arg0 = null; LuaTypes funcType2 = LuaDLL.lua_type(L, 2); if (funcType2 != LuaTypes.LUA_TFUNCTION) { arg0 = (DG.Tweening.TweenCallback)ToLua.CheckObject(L, 2, typeof(DG.Tweening.TweenCallback)); } else { LuaFunction func = ToLua.ToLuaFunction(L, 2); arg0 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.TweenCallback), func) as DG.Tweening.TweenCallback; } DG.Tweening.TweenParams o = obj.OnComplete(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
static public int OnComplete(IntPtr l) { try { DG.Tweening.TweenParams self = (DG.Tweening.TweenParams)checkSelf(l); DG.Tweening.TweenCallback a1; checkDelegate(l, 2, out a1); var ret = self.OnComplete(a1); pushValue(l, true); pushValue(l, ret); return(2); } catch (Exception e) { return(error(l, e)); } }
static int OnComplete(IntPtr L) { try { ToLua.CheckArgsCount(L, 2); DG.Tweening.TweenParams obj = (DG.Tweening.TweenParams)ToLua.CheckObject <DG.Tweening.TweenParams>(L, 1); DG.Tweening.TweenCallback arg0 = (DG.Tweening.TweenCallback)ToLua.CheckDelegate <DG.Tweening.TweenCallback>(L, 2); DG.Tweening.TweenParams o = obj.OnComplete(arg0); ToLua.PushObject(L, o); return(1); } catch (Exception e) { return(LuaDLL.toluaL_exception(L, e)); } }
//creates a new tween with given arguments that moves along the path private void CreateTween() { //prepare DOTween's parameters, you can look them up here //http://dotween.demigiant.com/documentation.php TweenParams parms = new TweenParams(); //differ between speed or time based tweening if (timeValue == TimeValue.speed) parms.SetSpeedBased(); if (loopType == LoopType.yoyo) parms.SetLoops(-1, DG.Tweening.LoopType.Yoyo); //apply ease type or animation curve if (easeType == DG.Tweening.Ease.INTERNAL_Custom) parms.SetEase(animEaseType); else parms.SetEase(easeType); if (moveToPath) parms.OnWaypointChange(OnWaypointReached); else { if (loopType == LoopType.yoyo) parms.OnStepComplete(ReachedEnd); transform.position = wpPos[0]; parms.OnWaypointChange(OnWaypointChange); parms.OnComplete(ReachedEnd); } tween = transform.DOPath(wpPos, originSpeed, pathType, pathMode, 1) .SetAs(parms) .SetOptions(false, lockPosition, lockRotation) .SetLookAt(lookAhead); if (!moveToPath && startPoint > 0) { GoToWaypoint(startPoint); startPoint = 0; } //continue new tween with adjusted speed if it was changed before if (originSpeed != speed) ChangeSpeed(speed); }