FairyGUI.MovieClip.SetData C# (CSharp) Метод

SetData() публичный Метод

public SetData ( NTexture texture, FairyGUI.Frame frames, Rect boundsRect ) : void
texture NTexture
frames FairyGUI.Frame
boundsRect UnityEngine.Rect
Результат void
        public void SetData(NTexture texture, Frame[] frames, Rect boundsRect)
        {
            this.frames = frames;
            this.frameCount = frames.Length;
            _contentRect = boundsRect;

            if (_end == -1 || _end > frameCount - 1)
                _end = frameCount - 1;
            if (_endAt == -1 || _endAt > frameCount - 1)
                _endAt = frameCount - 1;
            playState.Rewind();

            graphics.texture = texture;
            OnSizeChanged(true, true);
            InvalidateBatchingState();
            _forceDraw = true;
        }

Usage Example

Пример #1
0
        protected void LoadFromPackage(string itemURL)
        {
            _contentItem = UIPackage.GetItemByURL(itemURL);

            if (_contentItem != null)
            {
                _contentItem.Load();
                if (_contentItem.type == PackageItemType.Image)
                {
                    _image.texture     = _contentItem.texture;
                    _image.scale9Grid  = _contentItem.scale9Grid;
                    _image.scaleByTile = _contentItem.scaleByTile;
                    _activeObject      = _image;

                    _contentSourceWidth  = _contentItem.width;
                    _contentSourceHeight = _contentItem.height;
                    UpdateLayout();
                }
                else if (_contentItem.type == PackageItemType.MovieClip)
                {
                    if (_movieClip == null)
                    {
                        _movieClip = new MovieClip();
                        if (grayed)
                        {
                            _movieClip.SetGrayed(true);
                        }
                        _container.AddChild(_movieClip);
                    }

                    _contentSourceWidth  = _contentItem.width;
                    _contentSourceHeight = _contentItem.height;

                    _movieClip.interval = _contentItem.interval;
                    _movieClip.SetData(_contentItem.texture, _contentItem.frames);
                    _movieClip.boundsRect   = new Rect(0, 0, _contentSourceWidth, _contentSourceHeight);
                    _movieClip.playing      = _playing;
                    _movieClip.currentFrame = _frame;
                    _activeObject           = _movieClip;

                    UpdateLayout();
                }
                else
                {
                    SetErrorState();
                }
            }
            else
            {
                SetErrorState();
            }
        }
All Usage Examples Of FairyGUI.MovieClip::SetData