Exemplo n.º 1
0
        public void Setup(ByteBuffer buffer)
        {
            _controller = _owner.parent.GetControllerAt(buffer.ReadShort());
            Init();

            int cnt = buffer.ReadShort();

            if (this is GearDisplay)
            {
                ((GearDisplay)this).pages = buffer.ReadSArray(cnt);
            }
            else if (this is GearDisplay2)
            {
                ((GearDisplay2)this).pages = buffer.ReadSArray(cnt);
            }
            else
            {
                for (int i = 0; i < cnt; i++)
                {
                    string page = buffer.ReadS();
                    if (page == null)
                    {
                        continue;
                    }

                    AddStatus(page, buffer);
                }

                if (buffer.ReadBool())
                {
                    AddStatus(null, buffer);
                }
            }

            if (buffer.ReadBool())
            {
                _tweenConfig          = new GearTweenConfig();
                _tweenConfig.easeType = (EaseType)buffer.ReadByte();
                _tweenConfig.duration = buffer.ReadFloat();
                _tweenConfig.delay    = buffer.ReadFloat();
            }

            if (buffer.version >= 2)
            {
                if (this is GearXY)
                {
                    ((GearXY)this).positionsInPercent = buffer.ReadBool();
                }
                else if (this is GearDisplay2)
                {
                    ((GearDisplay2)this).condition = buffer.ReadByte();
                }
            }
        }
Exemplo n.º 2
0
        public void Setup(ByteBuffer buffer)
        {
            _controller = _owner.parent.GetControllerAt(buffer.ReadShort());
            Init();

            if (this is GearDisplay)
            {
                int      cnt   = buffer.ReadShort();
                string[] pages = new string[cnt];
                for (int i = 0; i < cnt; i++)
                {
                    pages[i] = buffer.ReadS();
                }
                ((GearDisplay)this).pages = pages;
            }
            else
            {
                int cnt = buffer.ReadShort();
                for (int i = 0; i < cnt; i++)
                {
                    string page = buffer.ReadS();
                    if (page == null)
                    {
                        continue;
                    }

                    AddStatus(page, buffer);
                }

                if (buffer.ReadBool())
                {
                    AddStatus(null, buffer);
                }
            }

            if (buffer.ReadBool())
            {
                _tweenConfig          = new GearTweenConfig();
                _tweenConfig.easeType = (EaseType)buffer.ReadByte();
                _tweenConfig.duration = buffer.ReadFloat();
                _tweenConfig.delay    = buffer.ReadFloat();
            }
        }