示例#1
0
    static int get_id(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Nova.RotationAnimationProperty obj = (Nova.RotationAnimationProperty)o;
            string ret = obj.id;
            LuaDLL.lua_pushstring(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index id on a nil value"));
        }
    }
示例#2
0
    static int _CreateNova_RotationAnimationProperty(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                UnityEngine.Transform          arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1);
                UnityEngine.Vector3            arg1 = ToLua.ToVector3(L, 2);
                Nova.RotationAnimationProperty obj  = new Nova.RotationAnimationProperty(arg0, arg1);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <Nova.UseRelativeValue>(L, 3))
            {
                UnityEngine.Transform          arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1);
                UnityEngine.Vector3            arg1 = ToLua.ToVector3(L, 2);
                Nova.UseRelativeValue          arg2 = (Nova.UseRelativeValue)ToLua.ToObject(L, 3);
                Nova.RotationAnimationProperty obj  = new Nova.RotationAnimationProperty(arg0, arg1, arg2);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes <UnityEngine.Vector3>(L, 3))
            {
                UnityEngine.Transform          arg0 = (UnityEngine.Transform)ToLua.CheckObject <UnityEngine.Transform>(L, 1);
                UnityEngine.Vector3            arg1 = ToLua.ToVector3(L, 2);
                UnityEngine.Vector3            arg2 = ToLua.ToVector3(L, 3);
                Nova.RotationAnimationProperty obj  = new Nova.RotationAnimationProperty(arg0, arg1, arg2);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Nova.RotationAnimationProperty.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
示例#3
0
        protected override void OnExit(Action onAnimationFinish)
        {
            var  current      = GetBaseAnimationEntry();
            bool hasAnimation = false;

            if (fade)
            {
                current      = current.Then(GetOpacityAnimationProperty(1f, 0f), duration);
                hasAnimation = true;
            }

            if (movementDirection != UIViewMovementDirection.None || scalingDirection != UIViewScalingDirection.None)
            {
                var delta = size0.InverseScale(RealScreen.uiSize) * (UICameraHelper.Active.orthographicSize * 2f);
                delta.Scale(Dir2Vector[(int)movementDirection] * movementPercentage);
                var size = size0 * (1f + Dir2Scale[(int)scalingDirection] * scalingPercentage);
                var prop = new RectTransformAnimationProperty(rt, pos0, pos0 - delta, size0.CloneScale(scale0),
                                                              size.CloneScale(scale0));
                current = hasAnimation ? current.And(prop, duration) : current.Then(prop, duration);
                current.With(exitFunction);
                hasAnimation = true;
            }

            if (rotationDirection != UIViewRotationDirection.None)
            {
                float angle = 360f * rotationPercentage * (int)rotationDirection;
                var   prop  = new RotationAnimationProperty(rt, new Vector3(0f, 0f, angle));
                rt.rotation = Quaternion.identity;
                current     = hasAnimation ? current.And(prop, duration) : current.Then(prop, duration);
                current.With(exitFunction);
            }

            current.Then(new ActionAnimationProperty(() =>
            {
                onAnimationFinish?.Invoke();
                SetToTransitionTarget();
            }));
        }
示例#4
0
        protected override void OnEnter(Action onAnimationFinish)
        {
            AnimationEntry current      = GetBaseAnimationEntry();
            bool           hasAnimation = false;

            if (fade)
            {
                current      = current.Then(GetOpacityAnimationProperty(0, 1), duration);
                hasAnimation = true;
            }

            if (movementDirection != UIViewMovementDirection.None || scalingDirection != UIViewScalingDirection.None)
            {
                var delta = size0.InverseScale(RealScreen.uiSize) * (UICameraHelper.Active.orthographicSize * 2);
                delta.Scale(Dir2Vector[(int)movementDirection] * movementPercentage);
                var size = size0 * (1 + Dir2Scale[(int)scalingDirection] * scalingPercentage);
                var prop = new RectTransformAnimationProperty(rt, pos0 - delta, pos0, size.CloneScale(scale0),
                                                              size0.CloneScale(scale0));
                current = hasAnimation ? current.And(prop, duration) : current.Then(prop, duration);
                current.With(enterFunction);
                hasAnimation = true;
            }

            if (rotationDirection != UIViewRotationDirection.None)
            {
                var   prop  = new RotationAnimationProperty(rt, Vector3.zero);
                float angle = 360 * rotationPercentage * (int)rotationDirection;
                rt.rotation = Quaternion.Euler(new Vector3(0, 0, angle));
                current     = hasAnimation ? current.And(prop, duration) : current.Then(prop, duration);
                current.With(enterFunction);
            }

            if (onAnimationFinish != null)
            {
                current.Then(new ActionAnimationProperty(onAnimationFinish));
            }
        }