コード例 #1
0
        public void AddSprite(string image, ColorB color, float scale)
        {
            int resourceId = GameResources.Instance.GetResourceId(image);

            _resourceIds.Add(resourceId);
            _colors.Add(color);
            _scales.Add(scale);
        }
コード例 #2
0
        public void FromByteArray(byte[] data, int index)
        {
            _resourceIds.Clear();
            _colors.Clear();
            _scales.Clear();
            int pos          = index;
            int spritesCount = BitConverter.ToInt32(data, pos);

            pos += sizeof(int);
            for (int i = 0; i < spritesCount; i++)
            {
                int id = BitConverter.ToInt32(data, pos);
                pos += sizeof(int);
                ColorB color = new ColorB();
                color.FromByteArray(data, pos);
                pos += color.ByteLength;
                float scale = BitConverter.ToSingle(data, pos);
                pos += sizeof(float);

                _resourceIds.Add(id);
                _colors.Add(color);
                _scales.Add(scale);
            }
        }
コード例 #3
0
 public void SetColor(int orderIndex, ColorB color) => _colors[orderIndex] = color;