Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Texture2DAssetData : AssetData
- {
- public const int ClassID = 28;
- public string name;
- public int forcedFallbackFormat;
- public int downscaleFallback;
- public int width;
- public int height;
- public int completeImageSize;
- public int textureFormat;
- public int mipCount;
- public bool isReadable;
- public bool streamingMips;
- public int streamingMipsPriority;
- public int imageCount;
- public int textureDimension;
- public int filterMode;
- public int anisotropic;
- public float mipBias;
- public int wrapU;
- public int wrapV;
- public int wrapW;
- public int lightmapFormat;
- public int colorSpace;
- public byte[] imageData;
- public int offset;
- public int size;
- public string path;
- private const int CoverPowerOfTwo = 8;
- public static Texture2DAssetData CoverFromImageFile(string filePath, string levelID) {
- int coverDim = 1 << CoverPowerOfTwo;
- byte[] imageData = Utils.ImageFileToMipData(filePath, coverDim);
- return new Texture2DAssetData() {
- name = levelID + "Cover",
- forcedFallbackFormat = 4,
- downscaleFallback = 0,
- width = coverDim,
- height = coverDim,
- completeImageSize = imageData.Length,
- textureFormat = 3,
- mipCount = CoverPowerOfTwo+1,
- isReadable = false,
- streamingMips = false,
- streamingMipsPriority = 0,
- imageCount = 1,
- textureDimension = 2,
- filterMode = 2,
- anisotropic = 1,
- mipBias = -1,
- wrapU = 1,
- wrapV = 1,
- wrapW = 0,
- lightmapFormat = 6,
- colorSpace = 1,
- imageData = imageData,
- offset = 0,
- size = 0,
- path = "",
- };
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement