コード例 #1
0
    static int OnComplete(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tweener), typeof(LuaInterface.LuaFunction)))
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.ToObject(L, 1);
                LuaFunction         arg1 = ToLua.ToLuaFunction(L, 2);
                TweenUtils.OnComplete(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tweener), typeof(LuaInterface.LuaFunction), typeof(object)))
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.ToObject(L, 1);
                LuaFunction         arg1 = ToLua.ToLuaFunction(L, 2);
                object arg2 = ToLua.ToVarObject(L, 3);
                TweenUtils.OnComplete(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: TweenUtils.OnComplete"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
    static int SetLoops(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1);
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
                TweenUtils.SetLoops(arg0, arg1);
                return(0);
            }
            else if (count == 3)
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1);
                int  arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
                bool arg2 = LuaDLL.luaL_checkboolean(L, 3);
                TweenUtils.SetLoops(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: TweenUtils.SetLoops"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #3
0
    static int OnComplete(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1);
                LuaFunction         arg1 = ToLua.CheckLuaFunction(L, 2);
                TweenUtils.OnComplete(arg0, arg1);
                return(0);
            }
            else if (count == 3)
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1);
                LuaFunction         arg1 = ToLua.CheckLuaFunction(L, 2);
                object arg2 = ToLua.ToVarObject(L, 3);
                TweenUtils.OnComplete(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: TweenUtils.OnComplete"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #4
0
    static int SetLoops(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tweener), typeof(int)))
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.ToObject(L, 1);
                int arg1 = (int)LuaDLL.lua_tonumber(L, 2);
                TweenUtils.SetLoops(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Tweener), typeof(int), typeof(bool)))
            {
                DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.ToObject(L, 1);
                int  arg1 = (int)LuaDLL.lua_tonumber(L, 2);
                bool arg2 = LuaDLL.lua_toboolean(L, 3);
                TweenUtils.SetLoops(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: TweenUtils.SetLoops"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #5
0
    static int PrependCallback(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Sequence), typeof(LuaInterface.LuaFunction)))
            {
                DG.Tweening.Sequence arg0 = (DG.Tweening.Sequence)ToLua.ToObject(L, 1);
                LuaFunction          arg1 = ToLua.ToLuaFunction(L, 2);
                DG.Tweening.Sequence o    = TweenUtils.PrependCallback(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.Sequence), typeof(LuaInterface.LuaFunction), typeof(object)))
            {
                DG.Tweening.Sequence arg0 = (DG.Tweening.Sequence)ToLua.ToObject(L, 1);
                LuaFunction          arg1 = ToLua.ToLuaFunction(L, 2);
                object arg2            = ToLua.ToVarObject(L, 3);
                DG.Tweening.Sequence o = TweenUtils.PrependCallback(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: TweenUtils.PrependCallback"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #6
0
    void Update()
    {
        // Rotate with the left stick
        if (!IsLeftStickNeutral())
        {
            _lastStickDirection = InputUtils
                                  .LeftStickToWorldSpace(_input.LeftStick)
                                  .normalized;
        }

        var targetRot = Quaternion.LookRotation(_lastStickDirection, Vector3.up);

        transform.rotation = TweenUtils.DecayTowards(
            transform.rotation,
            targetRot,
            TWEEN_HALF_LIFE,
            Time.deltaTime
            );

        // Scale with the left stick
        var targetScale = Vector3.one * _input.LeftStick.magnitude;

        transform.localScale = TweenUtils.DecayTowards(
            transform.localScale,
            targetScale,
            TWEEN_HALF_LIFE,
            Time.deltaTime
            );
    }
コード例 #7
0
ファイル: MessageItem.cs プロジェクト: zloyDemon/UnityChat
 private void DeleteThisMessage()
 {
     TweenUtils.KillAndNull(ref fadeTween);
     fadeTween = canvasGroup.DOFade(0, FadeDuration).OnComplete(() =>
     {
         UChatApp.Instance.CurrentChatRoom.DeleteMessageFromRoom(CurrentMessage);
         fadeTween = null;
     });
 }
コード例 #8
0
 public void Play()
 {
     OnPlay();
     if (_autoDestruct)
     {
         TweenUtils.Timer(_secondsToDestruct, this)
         .Then(() => Destruct());
     }
 }
コード例 #9
0
ファイル: BaseWindow.cs プロジェクト: ShengquGame/LuShu
    /// <summary>
    /// 内部接口 进入动画效果
    /// </summary>
    public void DoShowAnimation()
    {
        if (_contentPane == null)
        {
            return;
        }
        _originPos = _window.xy;
        string ani = animation[0];

        if (ani == null)
        {
            return;
        }
        GTweener tween = null;

        switch (ani)
        {
        case "eject":    //放大
            _window.SetScale(0.9f, 0.9f);
            tween = _window.TweenScale(new Vector2(1f, 1f), 0.3f);
            TweenUtils.SetEase(tween, EaseType.BackOut);
            TweenUtils.OnComplete(tween, CallOnShown);
            break;

        case "fade_in":    //淡入
            _window.alpha = 0;
            tween         = _window.TweenFade(1, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, CallOnShown);
            break;

        case "move_up":    //上滑进入
            _window.y = GRoot.inst.height;
            tween     = _window.TweenMoveY(_originPos.y, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, CallOnShown);
            break;

        case "move_left":    //左滑动进入
            _window.x = GRoot.inst.width;
            tween     = _window.TweenMoveX(_originPos.x, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, CallOnShown);
            break;

        case "move_right":    //右滑进入
            _window.x = -GRoot.inst.width - 30;
            tween     = _window.TweenMoveX(_originPos.x, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, CallOnShown);
            break;

        default:
            CallOnShown();
            break;
        }
    }
コード例 #10
0
    void Update()
    {
        DebugDisplay.PrintLine("Delta time: " + (Time.time / Time.frameCount));
        DebugDisplay.PrintLine("Animation speed: " + _animator.speed);
        _model.rotation = TweenUtils.DecayTowards(
            _model.rotation,
            GetTargetRot(),
            TWEEN_HALF_LIFE,
            Time.deltaTime
        );

        UpdateBones();
    }
コード例 #11
0
ファイル: RoleView.cs プロジェクト: 602147629/GDGJ_Script
 protected override void HandleAfterOpenView()
 {
     TabViewHelp();
     if (RoleModel == null)
     {
         RoleModel = new RoleDisplay();
         RoleModel.CreateRole((int)MeVo.instance.job, LoadCallBack);
     }
     TweenUtils.AdjustTransformToClick(tweenPosition);
     if (AfterOpenViewGuideDelegate != null)
     {
         EventDelegate.Add(tweenPosition.onFinished, AfterOpenViewGuideDelegate);
     }
 }
コード例 #12
0
ファイル: BaseWindow.cs プロジェクト: ShengquGame/LuShu
    /// <summary>
    /// 内部接口 退出动画效果
    /// </summary>
    public void DoHideAnimation()
    {
        _originPos = _window.xy;
        string ani = animation[1];

        if (ani == null)
        {
            return;
        }
        GTweener tween = null;

        switch (ani)
        {
        case "shrink":    //缩小
            _window.SetScale(1, 1);
            tween = _window.TweenScale(new Vector2(0.8f, 0.8f), 0.2f);
            TweenUtils.SetEase(tween, EaseType.ExpoIn);
            TweenUtils.OnComplete(tween, DoHide);
            break;

        case "fade_out":    //淡出
            _window.alpha = 0;
            tween         = _window.TweenFade(1, 0.3f);
            TweenUtils.SetEase(tween, EaseType.BackOut);
            TweenUtils.OnComplete(tween, DoHide);
            break;

        case "move_down":    //下滑退出
            tween = _window.TweenMoveY(GRoot.inst.height + 30, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, DoHide);
            break;

        case "move_left":    //左滑动退出
            tween = _window.TweenMoveX(-_window.width - 30, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, DoHide);
            break;

        case "move_right":    //右滑退出
            tween = _window.TweenMoveX(-_window.width + 30, 0.3f);
            TweenUtils.SetEase(tween, EaseType.QuadOut);
            TweenUtils.OnComplete(tween, DoHide);
            break;

        default:
            DoHide();
            break;
        }
    }
コード例 #13
0
 static int SetDefaultAutoKill(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         bool arg0 = LuaDLL.luaL_checkboolean(L, 1);
         TweenUtils.SetDefaultAutoKill(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #14
0
 static int CreateSequence(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 0);
         DG.Tweening.Sequence o = TweenUtils.CreateSequence();
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #15
0
 static int SetTarget(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject <DG.Tweening.Tweener>(L, 1);
         object arg1 = ToLua.ToVarObject(L, 2);
         TweenUtils.SetTarget(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #16
0
 static int GetTweenerId(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Tweener));
         object o = TweenUtils.GetTweenerId(arg0);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #17
0
 static int Kill(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Tweener));
         bool arg1 = LuaDLL.luaL_checkboolean(L, 2);
         TweenUtils.Kill(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #18
0
 static int SetEase(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Tweener));
         DG.Tweening.Ease    arg1 = (DG.Tweening.Ease)ToLua.CheckObject(L, 2, typeof(DG.Tweening.Ease));
         TweenUtils.SetEase(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #19
0
 static int SetDelay(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Tweener arg0 = (DG.Tweening.Tweener)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Tweener));
         float arg1 = (float)LuaDLL.luaL_checknumber(L, 2);
         TweenUtils.SetDelay(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #20
0
 static int PrependInterval(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Sequence arg0 = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
         float arg1             = (float)LuaDLL.luaL_checknumber(L, 2);
         DG.Tweening.Sequence o = TweenUtils.PrependInterval(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #21
0
 static int Prepend(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         DG.Tweening.Sequence arg0 = (DG.Tweening.Sequence)ToLua.CheckObject(L, 1, typeof(DG.Tweening.Sequence));
         DG.Tweening.Tween    arg1 = (DG.Tweening.Tween)ToLua.CheckObject(L, 2, typeof(DG.Tweening.Tween));
         DG.Tweening.Sequence o    = TweenUtils.Prepend(arg0, arg1);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #22
0
 static int TweenVector3(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         UnityEngine.Vector3 arg0 = ToLua.ToVector3(L, 1);
         UnityEngine.Vector3 arg1 = ToLua.ToVector3(L, 2);
         float               arg2 = (float)LuaDLL.luaL_checknumber(L, 3);
         LuaFunction         arg3 = ToLua.CheckLuaFunction(L, 4);
         DG.Tweening.Tweener o    = TweenUtils.TweenVector3(arg0, arg1, arg2, arg3);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #23
0
 static int DOPunchScale(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.CheckUnityObject(L, 1, typeof(UnityEngine.Transform));
         UnityEngine.Vector3   arg1 = ToLua.ToVector3(L, 2);
         float arg2            = (float)LuaDLL.luaL_checknumber(L, 3);
         int   arg3            = (int)LuaDLL.luaL_checknumber(L, 4);
         float arg4            = (float)LuaDLL.luaL_checknumber(L, 5);
         DG.Tweening.Tweener o = TweenUtils.DOPunchScale(arg0, arg1, arg2, arg3, arg4);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #24
0
 static int TweenSpecialVector2(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 5);
         UnityEngine.Vector2 arg0 = ToLua.ToVector2(L, 1);
         UnityEngine.Vector2 arg1 = ToLua.ToVector2(L, 2);
         float               arg2 = (float)LuaDLL.luaL_checknumber(L, 3);
         DG.Tweening.Ease    arg3 = (DG.Tweening.Ease)ToLua.CheckObject(L, 4, typeof(DG.Tweening.Ease));
         LuaFunction         arg4 = ToLua.CheckLuaFunction(L, 5);
         DG.Tweening.Tweener o    = TweenUtils.TweenSpecialVector2(arg0, arg1, arg2, arg3, arg4);
         ToLua.PushObject(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #25
0
    private void Update()
    {
        if (Game.instance.GetState() != GameState.EndTurn)
        {
            return;
        }

        float tween_time = Game.instance.GetTurnTweenTimeNormalized();

        tween_time = TweenUtils.Smootherstep(tween_time);

        float cell_size = HexGridManager.instance.cell_size;

        Vector3 target_direction = new Vector3(Mathf.Cos(heading * Mathf.Deg2Rad), 0.0f, Mathf.Sin(heading * Mathf.Deg2Rad));
        Vector3 target_position  = HexGrid.CubeToCartesian(cube_coordinates, cell_size);

        turret_head.rotation = Quaternion.Lerp(tween_rotation, Quaternion.LookRotation(target_direction), tween_time);
        transform.position   = Vector3.Lerp(tween_position, target_position, tween_time);
    }
コード例 #26
0
    static int DOShakePosition(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 6 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(float), typeof(UnityEngine.Vector3), typeof(int), typeof(float), typeof(bool)))
            {
                UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.ToObject(L, 1);
                float arg1 = (float)LuaDLL.lua_tonumber(L, 2);
                UnityEngine.Vector3 arg2 = ToLua.ToVector3(L, 3);
                int   arg3            = (int)LuaDLL.lua_tonumber(L, 4);
                float arg4            = (float)LuaDLL.lua_tonumber(L, 5);
                bool  arg5            = LuaDLL.lua_toboolean(L, 6);
                DG.Tweening.Tweener o = TweenUtils.DOShakePosition(arg0, arg1, arg2, arg3, arg4, arg5);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 6 && TypeChecker.CheckTypes(L, 1, typeof(UnityEngine.Transform), typeof(float), typeof(float), typeof(int), typeof(float), typeof(bool)))
            {
                UnityEngine.Transform arg0 = (UnityEngine.Transform)ToLua.ToObject(L, 1);
                float arg1            = (float)LuaDLL.lua_tonumber(L, 2);
                float arg2            = (float)LuaDLL.lua_tonumber(L, 3);
                int   arg3            = (int)LuaDLL.lua_tonumber(L, 4);
                float arg4            = (float)LuaDLL.lua_tonumber(L, 5);
                bool  arg5            = LuaDLL.lua_toboolean(L, 6);
                DG.Tweening.Tweener o = TweenUtils.DOShakePosition(arg0, arg1, arg2, arg3, arg4, arg5);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: TweenUtils.DOShakePosition"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #27
0
        public void Join(ITween tween)
        {
            Tween castedTween = tween as Tween;

            if (castedTween == null)
            {
                throw new ArgumentNullException($"Tried to {nameof(Join)} a null {nameof(Tween)} on {nameof(SequenceTween)}");
            }

            bool canAdd = TweenUtils.CanAddTween(this, tween);

            if (!canAdd)
            {
                return;
            }

            tweenRepository.Join(castedTween);

            castedTween.IsNested = true;

            durationCalculated = false;
        }
コード例 #28
0
 private void PlayHideAnimation(Action callback)
 {
     _currentHideTween             = TweenUtils.DoCanvasGroupColor(_targetCanvasGroup, 0, 1);
     _currentHideTween.onComplete += () => callback();
 }
コード例 #29
0
ファイル: MessageItem.cs プロジェクト: zloyDemon/UnityChat
 private void AnimateAppearanceItem()
 {
     TweenUtils.KillAndNull(ref fadeTween);
     canvasGroup.alpha = 0;
     fadeTween         = canvasGroup.DOFade(1, FadeDuration).OnComplete(() => fadeTween = null);
 }