PlayReverse() public method

public PlayReverse ( ) : void
return void
 static public int PlayReverse(IntPtr l)
 {
     try {
         int argc = LuaDLL.lua_gettop(l);
         if (argc == 1)
         {
             FairyGUI.Transition self = (FairyGUI.Transition)checkSelf(l);
             self.PlayReverse();
             pushValue(l, true);
             return(1);
         }
         else if (argc == 2)
         {
             FairyGUI.Transition           self = (FairyGUI.Transition)checkSelf(l);
             FairyGUI.PlayCompleteCallback a1;
             LuaDelegation.checkDelegate(l, 2, out a1);
             self.PlayReverse(a1);
             pushValue(l, true);
             return(1);
         }
         else if (argc == 4)
         {
             FairyGUI.Transition self = (FairyGUI.Transition)checkSelf(l);
             System.Int32        a1;
             checkType(l, 2, out a1);
             System.Single a2;
             checkType(l, 3, out a2);
             FairyGUI.PlayCompleteCallback a3;
             LuaDelegation.checkDelegate(l, 4, out a3);
             self.PlayReverse(a1, a2, a3);
             pushValue(l, true);
             return(1);
         }
         pushValue(l, false);
         LuaDLL.lua_pushstring(l, "No matched override function to call");
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
Esempio n. 2
0
    static int PlayReverse(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                FairyGUI.Transition obj = (FairyGUI.Transition)ToLua.CheckObject <FairyGUI.Transition>(L, 1);
                obj.PlayReverse();
                return(0);
            }
            else if (count == 2)
            {
                FairyGUI.Transition           obj  = (FairyGUI.Transition)ToLua.CheckObject <FairyGUI.Transition>(L, 1);
                FairyGUI.PlayCompleteCallback arg0 = (FairyGUI.PlayCompleteCallback)ToLua.CheckDelegate <FairyGUI.PlayCompleteCallback>(L, 2);
                obj.PlayReverse(arg0);
                return(0);
            }
            else if (count == 4)
            {
                FairyGUI.Transition obj = (FairyGUI.Transition)ToLua.CheckObject <FairyGUI.Transition>(L, 1);
                int   arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
                float arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
                FairyGUI.PlayCompleteCallback arg2 = (FairyGUI.PlayCompleteCallback)ToLua.CheckDelegate <FairyGUI.PlayCompleteCallback>(L, 4);
                obj.PlayReverse(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Transition.PlayReverse"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Esempio n. 3
0
        void ApplyValue(TransitionItem item, TransitionValue value)
        {
            item.target._gearLocked = true;

            switch (item.type)
            {
            case TransitionActionType.XY:
                if (item.target == _owner)
                {
                    float f1, f2;
                    if (!value.b1)
                    {
                        f1 = item.target.x;
                    }
                    else
                    {
                        f1 = value.f1 + _ownerBaseX;
                    }
                    if (!value.b2)
                    {
                        f2 = item.target.y;
                    }
                    else
                    {
                        f2 = value.f2 + _ownerBaseY;
                    }
                    item.target.SetXY(f1, f2);
                }
                else
                {
                    if (!value.b1)
                    {
                        value.f1 = item.target.x;
                    }
                    if (!value.b2)
                    {
                        value.f2 = item.target.y;
                    }
                    item.target.SetXY(value.f1, value.f2);
                }
                break;

            case TransitionActionType.Size:
                if (!value.b1)
                {
                    value.f1 = item.target.width;
                }
                if (!value.b2)
                {
                    value.f2 = item.target.height;
                }
                item.target.SetSize(value.f1, value.f2);
                break;

            case TransitionActionType.Pivot:
                item.target.SetPivot(value.f1, value.f2);
                break;

            case TransitionActionType.Alpha:
                item.target.alpha = value.f1;
                break;

            case TransitionActionType.Rotation:
                item.target.rotation = value.i;
                break;

            case TransitionActionType.Scale:
                item.target.SetScale(value.f1, value.f2);
                break;

            case TransitionActionType.Color:
                ((IColorGear)item.target).color = value.c;
                break;

            case TransitionActionType.Animation:
                if (!value.b1)
                {
                    value.i = ((IAnimationGear)item.target).frame;
                }
                ((IAnimationGear)item.target).frame   = value.i;
                ((IAnimationGear)item.target).playing = value.b;
                break;

            case TransitionActionType.Visible:
                item.target.visible = value.b;
                break;

            case TransitionActionType.Controller:
                string[] arr = value.s.Split(',');
                foreach (string str in arr)
                {
                    string[]   arr2 = str.Split('=');
                    Controller cc   = ((GComponent)item.target).GetController(arr2[0]);
                    if (cc != null)
                    {
                        string str2 = arr2[1];
                        if (str2[0] == '$')
                        {
                            str2            = str.Substring(1);
                            cc.selectedPage = str2;
                        }
                        else
                        {
                            cc.selectedIndex = int.Parse(str2);
                        }
                    }
                }
                break;

            case TransitionActionType.Transition:
                Transition trans = ((GComponent)item.target).GetTransition(value.s);
                if (trans != null)
                {
                    if (value.i == 0)
                    {
                        trans.Stop(false, true);
                    }
                    else if (trans.playing)
                    {
                        trans._totalTimes = value.i == -1 ? int.MaxValue : value.i;
                    }
                    else
                    {
                        item.completed = false;
                        _totalTasks++;
                        if (_reversed)
                        {
                            trans.PlayReverse(value.i, 0, () => { __playTransComplete(item); });
                        }
                        else
                        {
                            trans.Play(value.i, 0, () => { __playTransComplete(item); });
                        }
                    }
                }
                break;

            case TransitionActionType.Sound:
                AudioClip sound = UIPackage.GetItemAssetByURL(value.s) as AudioClip;
                if (sound != null)
                {
                    Stage.inst.PlayOneShotSound(sound, value.f1);
                }
                break;

            case TransitionActionType.Shake:
                item.startValue.f1 = 0;                         //offsetX
                item.startValue.f2 = 0;                         //offsetY
                item.startValue.f3 = item.value.f2;             //shakePeriod
                Timers.inst.AddUpdate(item.__Shake, this);
                _totalTasks++;
                item.completed = false;
                break;
            }

            item.target._gearLocked = false;
        }
Esempio n. 4
0
        void ApplyValue(TransitionItem item, TransitionValue value)
        {
            item.target._gearLocked = true;

            switch (item.type)
            {
            case TransitionActionType.XY:
                if (item.target == _owner)
                {
                    float f1, f2;
                    if (!value.b1)
                    {
                        f1 = item.target.x;
                    }
                    else
                    {
                        f1 = value.f1 + _ownerBaseX;
                    }
                    if (!value.b2)
                    {
                        f2 = item.target.y;
                    }
                    else
                    {
                        f2 = value.f2 + _ownerBaseY;
                    }
                    item.target.SetXY(f1, f2);
                }
                else
                {
                    if (!value.b1)
                    {
                        value.f1 = item.target.x;
                    }
                    if (!value.b2)
                    {
                        value.f2 = item.target.y;
                    }
                    item.target.SetXY(value.f1, value.f2);
                }
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState();
                }
                break;

            case TransitionActionType.Size:
                if (!value.b1)
                {
                    value.f1 = item.target.width;
                }
                if (!value.b2)
                {
                    value.f2 = item.target.height;
                }
                item.target.SetSize(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState();
                }
                break;

            case TransitionActionType.Pivot:
                item.target.SetPivot(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState();
                }
                break;

            case TransitionActionType.Alpha:
                item.target.alpha = value.f1;
                break;

            case TransitionActionType.Rotation:
                item.target.rotation = value.f1;
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState();
                }
                break;

            case TransitionActionType.Scale:
                item.target.SetScale(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState();
                }
                break;

            case TransitionActionType.Skew:
                item.target.skew = new Vector2(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState();
                }
                break;

            case TransitionActionType.Color:
                ((IColorGear)item.target).color = value.c;
                break;

            case TransitionActionType.Animation:
                if (!value.b1)
                {
                    value.i = ((IAnimationGear)item.target).frame;
                }
                ((IAnimationGear)item.target).frame   = value.i;
                ((IAnimationGear)item.target).playing = value.b;
                break;

            case TransitionActionType.Visible:
                item.target.visible = value.b;
                break;

            case TransitionActionType.Transition:
                Transition trans = ((GComponent)item.target).GetTransition(value.s);
                if (trans != null)
                {
                    if (value.i == 0)
                    {
                        trans.Stop(false, true);
                    }
                    else if (trans.playing)
                    {
                        trans._totalTimes = value.i == -1 ? int.MaxValue : value.i;
                    }
                    else
                    {
                        item.completed = false;
                        _totalTasks++;
                        if (_reversed)
                        {
                            trans.PlayReverse(value.i, 0, () => { __playTransComplete(item); });
                        }
                        else
                        {
                            trans.Play(value.i, 0, () => { __playTransComplete(item); });
                        }
                        if (_timeScale != 1)
                        {
                            trans.timeScale = _timeScale;
                        }
                    }
                }
                break;

            case TransitionActionType.Sound:
                AudioClip sound = UIPackage.GetItemAssetByURL(value.s) as AudioClip;
                if (sound != null)
                {
                    Stage.inst.PlayOneShotSound(sound, value.f1);
                }
                break;

            case TransitionActionType.Shake:
                item.startValue.f1 = 0;                         //offsetX
                item.startValue.f2 = 0;                         //offsetY
                item.startValue.f3 = item.value.f2;             //shakePeriod
                Timers.inst.AddUpdate(item.__Shake, this);
                _totalTasks++;
                item.completed = false;
                break;

            case TransitionActionType.ColorFilter:
                ColorFilter cf = item.target.filter as ColorFilter;
                if (cf == null)
                {
                    cf = new ColorFilter();
                    item.target.filter = cf;
                    item.filterCreated = true;
                }
                else
                {
                    cf.Reset();
                }
                cf.AdjustBrightness(value.f1);
                cf.AdjustContrast(value.f2);
                cf.AdjustSaturation(value.f3);
                cf.AdjustHue(value.f4);
                break;
            }

            item.target._gearLocked = false;
        }
Esempio n. 5
0
        internal void ApplyValue(TransitionItem item, TransitionValue value)
        {
            item.target._gearLocked = true;

            switch (item.type)
            {
            case TransitionActionType.XY:
                if (item.target == _owner)
                {
                    float f1, f2;
                    if (!value.b1)
                    {
                        f1 = item.target.x;
                    }
                    else
                    {
                        f1 = value.f1 + _ownerBaseX;
                    }
                    if (!value.b2)
                    {
                        f2 = item.target.y;
                    }
                    else
                    {
                        f2 = value.f2 + _ownerBaseY;
                    }
                    item.target.SetXY(f1, f2);
                }
                else
                {
                    if (!value.b1)
                    {
                        value.f1 = item.target.x;
                    }
                    if (!value.b2)
                    {
                        value.f2 = item.target.y;
                    }
                    item.target.SetXY(value.f1, value.f2);
                }
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Size:
                if (!value.b1)
                {
                    value.f1 = item.target.width;
                }
                if (!value.b2)
                {
                    value.f2 = item.target.height;
                }
                item.target.SetSize(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Pivot:
                item.target.SetPivot(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Alpha:
                item.target.alpha = value.f1;
                break;

            case TransitionActionType.Rotation:
                item.target.rotation = value.f1;
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Scale:
                item.target.SetScale(value.f1, value.f2);
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Skew:
                item.target.skew = value.AsVec2;
                if (invalidateBatchingEveryFrame)
                {
                    _owner.InvalidateBatchingState(true);
                }
                break;

            case TransitionActionType.Color:
                ((IColorGear)item.target).color = value.AsColor;
                break;

            case TransitionActionType.Animation:
                if (((TransitionItem_Animation)item).frame >= 0)
                {
                    ((IAnimationGear)item.target).frame = ((TransitionItem_Animation)item).frame;
                }
                ((IAnimationGear)item.target).playing = ((TransitionItem_Animation)item).playing;
                break;

            case TransitionActionType.Visible:
                item.target.visible = ((TransitionItem_Visible)item).visible;
                break;

            case TransitionActionType.Transition:
                Transition trans = ((GComponent)item.target).GetTransition(((TransitionItem_Transition)item).transName);
                if (trans != null)
                {
                    int tranRepeat = ((TransitionItem_Transition)item).transRepeat;
                    if (tranRepeat == 0)
                    {
                        trans.Stop(false, true);
                    }
                    else if (trans.playing)
                    {
                        trans._totalTimes = tranRepeat;
                    }
                    else
                    {
                        item.completed = false;
                        _totalTasks++;
                        if (_reversed)
                        {
                            trans.PlayReverse(tranRepeat, 0, ((TransitionItem_Transition)item).playCompleteDelegate);
                        }
                        else
                        {
                            trans.Play(tranRepeat, 0, ((TransitionItem_Transition)item).playCompleteDelegate);
                        }
                        if (_timeScale != 1)
                        {
                            trans.timeScale = _timeScale;
                        }
                    }
                }
                break;

            case TransitionActionType.Sound:
                ((TransitionItem_Sound)item).Play();
                break;

            case TransitionActionType.Shake:
                ((TransitionItem_Shake)item).Start();
                _totalTasks++;
                item.completed = false;
                break;

            case TransitionActionType.ColorFilter:
                ((TransitionItem_ColorFilter)item).SetFilter();
                break;
            }

            item.target._gearLocked = false;
        }
    static int PlayReverse(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Transition)))
            {
                FairyGUI.Transition obj = (FairyGUI.Transition)ToLua.ToObject(L, 1);
                obj.PlayReverse();
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Transition), typeof(FairyGUI.PlayCompleteCallback)))
            {
                FairyGUI.Transition           obj  = (FairyGUI.Transition)ToLua.ToObject(L, 1);
                FairyGUI.PlayCompleteCallback arg0 = null;
                LuaTypes funcType2 = LuaDLL.lua_type(L, 2);

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

                obj.PlayReverse(arg0);
                return(0);
            }
            else if (count == 4 && TypeChecker.CheckTypes(L, 1, typeof(FairyGUI.Transition), typeof(int), typeof(float), typeof(FairyGUI.PlayCompleteCallback)))
            {
                FairyGUI.Transition obj = (FairyGUI.Transition)ToLua.ToObject(L, 1);
                int   arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                float arg1 = (float)LuaDLL.lua_tonumber(L, 3);
                FairyGUI.PlayCompleteCallback arg2 = null;
                LuaTypes funcType4 = LuaDLL.lua_type(L, 4);

                if (funcType4 != LuaTypes.LUA_TFUNCTION)
                {
                    arg2 = (FairyGUI.PlayCompleteCallback)ToLua.ToObject(L, 4);
                }
                else
                {
                    LuaFunction func = ToLua.ToLuaFunction(L, 4);
                    arg2 = DelegateFactory.CreateDelegate(typeof(FairyGUI.PlayCompleteCallback), func) as FairyGUI.PlayCompleteCallback;
                }

                obj.PlayReverse(arg0, arg1, arg2);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.Transition.PlayReverse"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }