mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 17:38:10 +08:00
29 lines
870 B
C#
29 lines
870 B
C#
// ---------------------------------------------------------------------------------------------
|
|
// Copyright (c) 2021-2022, Jiaqi Liu. All rights reserved.
|
|
// See LICENSE file in the project root for license information.
|
|
// ---------------------------------------------------------------------------------------------
|
|
|
|
namespace Core.DataLoader
|
|
{
|
|
using DataReader.Bmp;
|
|
using UnityEngine;
|
|
|
|
/// <summary>
|
|
/// .bmp file loader and Texture2D converter.
|
|
/// </summary>
|
|
public sealed class BmpTextureLoader : ITextureLoader
|
|
{
|
|
private BMPImage _image;
|
|
|
|
public void Load(byte[] data, out bool hasAlphaChannel)
|
|
{
|
|
hasAlphaChannel = false;
|
|
_image = new BmpLoader().LoadBmp(data);
|
|
}
|
|
|
|
public Texture2D ToTexture2D()
|
|
{
|
|
return _image?.ToTexture2D();
|
|
}
|
|
}
|
|
} |