Exemplo n.º 1
0
    private void Init()
    {
        if (mIsInit)
        {
            return;
        }

        //generate rock items
        float rockPlaceRot = -rockRotateAmount *Mathf.Round(rockPlacementCount / 2);

        mRockItems = new RockSelectItemWidget[rockPlacementCount];
        for (int i = 0; i < mRockItems.Length; i++)
        {
            mRockItems[i] = Instantiate(rockItemTemplate, rockRotate);

            var up = M8.MathUtil.RotateAngle(Vector2.up, rockPlaceRot);

            var t = mRockItems[i].transform;
            t.localPosition = up * rockPlacementRadius;
            t.up            = up;
            t.localScale    = Vector3.one;

            rockPlaceRot += rockRotateAmount;

            mRockItems[i].gameObject.name = i.ToString();
            mRockItems[i].gameObject.SetActive(false);
        }

        rockItemTemplate.gameObject.SetActive(false);
        //

        mRotateTweenFunc = DG.Tweening.Core.Easing.EaseManager.ToEaseFunction(DG.Tweening.Ease.OutSine);

        mIsInit = true;
    }
    static int SetEase(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes <DG.Tweening.Ease>(L, 2))
            {
                DG.Tweening.TweenParams obj  = (DG.Tweening.TweenParams)ToLua.CheckObject <DG.Tweening.TweenParams>(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2);
                DG.Tweening.TweenParams o    = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <UnityEngine.AnimationCurve>(L, 2))
            {
                DG.Tweening.TweenParams    obj  = (DG.Tweening.TweenParams)ToLua.CheckObject <DG.Tweening.TweenParams>(L, 1);
                UnityEngine.AnimationCurve arg0 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2);
                DG.Tweening.TweenParams    o    = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <DG.Tweening.EaseFunction>(L, 2))
            {
                DG.Tweening.TweenParams  obj  = (DG.Tweening.TweenParams)ToLua.CheckObject <DG.Tweening.TweenParams>(L, 1);
                DG.Tweening.EaseFunction arg0 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2);
                DG.Tweening.TweenParams  o    = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 3)
            {
                DG.Tweening.TweenParams obj  = (DG.Tweening.TweenParams)ToLua.CheckObject <DG.Tweening.TweenParams>(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.CheckObject(L, 2, typeof(DG.Tweening.Ease));
                System.Nullable <float> arg1 = ToLua.CheckNullable <float>(L, 3);
                DG.Tweening.TweenParams o    = obj.SetEase(arg0, arg1);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4)
            {
                DG.Tweening.TweenParams obj  = (DG.Tweening.TweenParams)ToLua.CheckObject <DG.Tweening.TweenParams>(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.CheckObject(L, 2, typeof(DG.Tweening.Ease));
                System.Nullable <float> arg1 = ToLua.CheckNullable <float>(L, 3);
                System.Nullable <float> arg2 = ToLua.CheckNullable <float>(L, 4);
                DG.Tweening.TweenParams o    = obj.SetEase(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.TweenParams.SetEase"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 3
0
    void Awake()
    {
        var playerGO = GameObject.FindGameObjectWithTag(tagPlayer);

        mPlayerTrans = playerGO.transform;

        mRockTrans = rockSpriteShape.transform;

        mRockMoveEaseFunc = DG.Tweening.Core.Easing.EaseManager.ToEaseFunction(rockMoveEase);
    }
Exemplo n.º 4
0
    static int SetEase(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.TweenParams), typeof(DG.Tweening.EaseFunction)))
            {
                DG.Tweening.TweenParams  obj  = (DG.Tweening.TweenParams)ToLua.ToObject(L, 1);
                DG.Tweening.EaseFunction arg0 = null;
                LuaTypes funcType2            = LuaDLL.lua_type(L, 2);

                if (funcType2 != LuaTypes.LUA_TFUNCTION)
                {
                    arg0 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 2);
                    arg0 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.EaseFunction), func) as DG.Tweening.EaseFunction;
                }

                DG.Tweening.TweenParams o = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.TweenParams), typeof(UnityEngine.AnimationCurve)))
            {
                DG.Tweening.TweenParams    obj  = (DG.Tweening.TweenParams)ToLua.ToObject(L, 1);
                UnityEngine.AnimationCurve arg0 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2);
                DG.Tweening.TweenParams    o    = obj.SetEase(arg0);
                ToLua.PushObject(L, o);
                return(1);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(DG.Tweening.TweenParams), typeof(DG.Tweening.Ease), typeof(System.Nullable <float>), typeof(System.Nullable <float>)))
            {
                DG.Tweening.TweenParams obj  = (DG.Tweening.TweenParams)ToLua.ToObject(L, 1);
                DG.Tweening.Ease        arg0 = (DG.Tweening.Ease)ToLua.ToObject(L, 2);
                System.Nullable <float> arg1 = (System.Nullable <float>)ToLua.ToObject(L, 3);
                System.Nullable <float> arg2 = (System.Nullable <float>)ToLua.ToObject(L, 4);
                DG.Tweening.TweenParams o    = obj.SetEase(arg0, arg1, arg2);
                ToLua.PushObject(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.TweenParams.SetEase"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 5
0
    public static Delegate DG_Tweening_EaseFunction(LuaFunction func)
    {
        if (func == null)
        {
            DG.Tweening.EaseFunction fn = delegate { return(0); };
            return(fn);
        }

        DG.Tweening.EaseFunction d = (new DG_Tweening_EaseFunction_Event(func)).Call;
        return(d);
    }
Exemplo n.º 6
0
    static int StopMotion(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(DG.Tweening.EaseFunction)))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                DG.Tweening.EaseFunction arg1 = null;
                LuaTypes funcType2            = LuaDLL.lua_type(L, 2);

                if (funcType2 != LuaTypes.LUA_TFUNCTION)
                {
                    arg1 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 2);
                    arg1 = DelegateFactory.CreateDelegate(typeof(DG.Tweening.EaseFunction), func) as DG.Tweening.EaseFunction;
                }

                DG.Tweening.EaseFunction o = DG.Tweening.EaseFactory.StopMotion(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(UnityEngine.AnimationCurve)))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                UnityEngine.AnimationCurve arg1 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2);
                DG.Tweening.EaseFunction   o    = DG.Tweening.EaseFactory.StopMotion(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(System.Nullable <DG.Tweening.Ease>)))
            {
                int arg0 = (int)LuaDLL.lua_tonumber(L, 1);
                System.Nullable <DG.Tweening.Ease> arg1 = (System.Nullable <DG.Tweening.Ease>)ToLua.ToObject(L, 2);
                DG.Tweening.EaseFunction           o    = DG.Tweening.EaseFactory.StopMotion(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.EaseFactory.StopMotion"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int StopMotion(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                DG.Tweening.EaseFunction o = DG.Tweening.EaseFactory.StopMotion(arg0);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <System.Nullable <DG.Tweening.Ease> >(L, 2))
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                System.Nullable <DG.Tweening.Ease> arg1 = ToLua.ToNullable <DG.Tweening.Ease>(L, 2);
                DG.Tweening.EaseFunction           o    = DG.Tweening.EaseFactory.StopMotion(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <UnityEngine.AnimationCurve>(L, 2))
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                UnityEngine.AnimationCurve arg1 = (UnityEngine.AnimationCurve)ToLua.ToObject(L, 2);
                DG.Tweening.EaseFunction   o    = DG.Tweening.EaseFactory.StopMotion(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else if (count == 2 && TypeChecker.CheckTypes <DG.Tweening.EaseFunction>(L, 2))
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                DG.Tweening.EaseFunction arg1 = (DG.Tweening.EaseFunction)ToLua.ToObject(L, 2);
                DG.Tweening.EaseFunction o    = DG.Tweening.EaseFactory.StopMotion(arg0, arg1);
                ToLua.Push(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: DG.Tweening.EaseFactory.StopMotion"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 8
0
        public override void OnEnter()
        {
            if (!mCamera)
            {
                mCamera = Camera.main;
            }

            if (isInstant.Value)
            {
                var targetTrans = target.Value ? target.Value.transform : null;
                if (targetTrans)
                {
                    var camTrans = mCamera.transform;

                    camTrans.position = targetTrans.position;

                    if (applyOrientation.Value)
                    {
                        camTrans.rotation = targetTrans.rotation;
                    }
                }

                Finish();
            }
            else
            {
                if (target.Value)
                {
                    mEaseFunc = DG.Tweening.Core.Easing.EaseManager.ToEaseFunction(easeType);
                    mCurTime  = 0f;

                    mStartPos = mCamera.transform.position;
                    mStartRot = mCamera.transform.rotation;
                }
                else
                {
                    Finish();
                }
            }
        }
Exemplo n.º 9
0
        void Awake()
        {
            if (dragRoot)
            {
                mDragRootDefaultLocalPosition = dragRoot.localPosition;
            }

            if (animator)
            {
                if (!string.IsNullOrEmpty(takeDrag))
                {
                    mTakeDrag = animator.GetTakeIndex(takeDrag);
                }

                if (!string.IsNullOrEmpty(takePointerDown))
                {
                    mTakePointerDown = animator.GetTakeIndex(takePointerDown);
                }
            }

            mDragReturnEaseFunc = DG.Tweening.Core.Easing.EaseManager.ToEaseFunction(dragReturnEase);
        }
Exemplo n.º 10
0
        static int _m_StopMotion_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                int __gen_param_count = LuaAPI.lua_gettop(L);

                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable <System.Nullable <DG.Tweening.Ease> >(L, 2))
                {
                    int motionFps = LuaAPI.xlua_tointeger(L, 1);
                    System.Nullable <DG.Tweening.Ease> ease; translator.Get(L, 2, out ease);

                    DG.Tweening.EaseFunction __cl_gen_ret = DG.Tweening.EaseFactory.StopMotion(motionFps, ease);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 1 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1))
                {
                    int motionFps = LuaAPI.xlua_tointeger(L, 1);

                    DG.Tweening.EaseFunction __cl_gen_ret = DG.Tweening.EaseFactory.StopMotion(motionFps);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable <UnityEngine.AnimationCurve>(L, 2))
                {
                    int motionFps = LuaAPI.xlua_tointeger(L, 1);
                    UnityEngine.AnimationCurve animCurve = (UnityEngine.AnimationCurve)translator.GetObject(L, 2, typeof(UnityEngine.AnimationCurve));

                    DG.Tweening.EaseFunction __cl_gen_ret = DG.Tweening.EaseFactory.StopMotion(motionFps, animCurve);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
                if (__gen_param_count == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 1) && translator.Assignable <DG.Tweening.EaseFunction>(L, 2))
                {
                    int motionFps = LuaAPI.xlua_tointeger(L, 1);
                    DG.Tweening.EaseFunction customEase = translator.GetDelegate <DG.Tweening.EaseFunction>(L, 2);

                    DG.Tweening.EaseFunction __cl_gen_ret = DG.Tweening.EaseFactory.StopMotion(motionFps, customEase);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to DG.Tweening.EaseFactory.StopMotion!"));
        }
        static int _m_SetEase(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                DG.Tweening.TweenParams gen_to_be_invoked = (DG.Tweening.TweenParams)translator.FastGetCSObj(L, 1);


                int gen_param_count = LuaAPI.lua_gettop(L);

                if (gen_param_count == 2 && translator.Assignable <UnityEngine.AnimationCurve>(L, 2))
                {
                    UnityEngine.AnimationCurve _animCurve = (UnityEngine.AnimationCurve)translator.GetObject(L, 2, typeof(UnityEngine.AnimationCurve));

                    var gen_ret = gen_to_be_invoked.SetEase(_animCurve);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <DG.Tweening.EaseFunction>(L, 2))
                {
                    DG.Tweening.EaseFunction _customEase = translator.GetDelegate <DG.Tweening.EaseFunction>(L, 2);

                    var gen_ret = gen_to_be_invoked.SetEase(_customEase);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 4 && translator.Assignable <DG.Tweening.Ease>(L, 2) && translator.Assignable <System.Nullable <float> >(L, 3) && translator.Assignable <System.Nullable <float> >(L, 4))
                {
                    DG.Tweening.Ease        _ease; translator.Get(L, 2, out _ease);
                    System.Nullable <float> _overshootOrAmplitude; translator.Get(L, 3, out _overshootOrAmplitude);
                    System.Nullable <float> _period; translator.Get(L, 4, out _period);

                    var gen_ret = gen_to_be_invoked.SetEase(_ease, _overshootOrAmplitude, _period);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 3 && translator.Assignable <DG.Tweening.Ease>(L, 2) && translator.Assignable <System.Nullable <float> >(L, 3))
                {
                    DG.Tweening.Ease        _ease; translator.Get(L, 2, out _ease);
                    System.Nullable <float> _overshootOrAmplitude; translator.Get(L, 3, out _overshootOrAmplitude);

                    var gen_ret = gen_to_be_invoked.SetEase(_ease, _overshootOrAmplitude);
                    translator.Push(L, gen_ret);



                    return(1);
                }
                if (gen_param_count == 2 && translator.Assignable <DG.Tweening.Ease>(L, 2))
                {
                    DG.Tweening.Ease _ease; translator.Get(L, 2, out _ease);

                    var gen_ret = gen_to_be_invoked.SetEase(_ease);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }

            return(LuaAPI.luaL_error(L, "invalid arguments to DG.Tweening.TweenParams.SetEase!"));
        }
Exemplo n.º 12
0
 public DG.Tweening.Tween SetEase(DG.Tweening.EaseFunction arg1)
 {
     return(default(DG.Tweening.Tween));
 }
Exemplo n.º 13
0
 void Awake()
 {
     mGotoTweenFunc = DG.Tweening.Core.Easing.EaseManager.ToEaseFunction(DG.Tweening.Ease.InOutSine);
 }