FairyGUI.MovieClip.Update C# (CSharp) Method

Update() public method

public Update ( UpdateContext context ) : void
context UpdateContext
return void
        public override void Update(UpdateContext context)
        {
            if (_playing && frameCount != 0 && _status != 3)
            {
                playState.Update(this, context);
                if (_forceDraw || _currentFrame != playState.currrentFrame)
                {
                    if (_status == 1)
                    {
                        _currentFrame = _start;
                        playState.currrentFrame = _currentFrame;
                        _status = 0;
                    }
                    else if (_status == 2)
                    {
                        _currentFrame = _endAt;
                        playState.currrentFrame = _currentFrame;
                        _status = 3;

                        UpdateContext.OnEnd += _playEndDelegate;
                    }
                    else
                    {
                        _currentFrame = playState.currrentFrame;
                        if (_currentFrame == _end)
                        {
                            if (_times > 0)
                            {
                                _times--;
                                if (_times == 0)
                                    _status = 2;
                                else
                                    _status = 1;
                            }
                        }
                    }
                    DrawFrame();
                }
            }
            else if(_forceDraw)
                DrawFrame();

            base.Update(context);
        }

Usage Example

Example #1
0
 static public int Update(IntPtr l)
 {
     try {
         FairyGUI.MovieClip     self = (FairyGUI.MovieClip)checkSelf(l);
         FairyGUI.UpdateContext a1;
         checkType(l, 2, out a1);
         self.Update(a1);
         pushValue(l, true);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }