public CompiledAssets() { block = new ReadWriteBlock(); fileName = block.Add(new ReadWriteVar(ValueType.STRING, "fileName", "")); assets = new List<AssetData>(); }
public ReferenceAsset() { referenceNum = dataBlock.Add(new ReadWriteVar(ValueType.INT, "referenceNum", -1)); }
public TextureAsset() { width = headerBlock.Add(new ReadWriteVar(ValueType.INT, "width", 0)); height = headerBlock.Add(new ReadWriteVar(ValueType.INT, "height", 0)); r = headerBlock.Add(new ReadWriteVar(ValueType.FLOAT, "r", 1.0f)); g = headerBlock.Add(new ReadWriteVar(ValueType.FLOAT, "g", 1.0f)); b = headerBlock.Add(new ReadWriteVar(ValueType.FLOAT, "b", 1.0f)); a = headerBlock.Add(new ReadWriteVar(ValueType.FLOAT, "a", 1.0f)); alphaBlend = headerBlock.Add(new ReadWriteVar(ValueType.BOOL, "alphaBlend", true)); encodingType = headerBlock.Add(new ReadWriteVar(ValueType.BYTE, "encodingType", (byte)TextureEncoding.NONE)); textureData = dataBlock.Add(new ReadWriteVar(ValueType.BINARY, "textureData", null)); }
public TextAsset() { text = dataBlock.Add(new ReadWriteVar(ValueType.STRING, "text", "")); }
public virtual string AssetNameFromFileName(string fileName) { string ext = Path.GetExtension(fileName); string assetName = new Regex("[^a-zA-Z0-9 -]").Replace(Path.GetFileNameWithoutExtension(fileName), ""); StringBuilder builder = new StringBuilder(assetName); builder[0] = Char.ToUpper(builder[0]); assetName = builder.ToString(); if (ext == ".png" || ext == ".jpg") { return "Texture." + assetName; } else if (ext == ".txt") { return "Text." + assetName; } else { return "Unknown." + assetName; } }
protected AssetData() { headerBlock = new ReadWriteBlock(); dataBlock = new ReadWriteBlock(); dataNum = headerBlock.Add(new ReadWriteVar(ValueType.INT, "dataNum", -1)); num = headerBlock.Add(new ReadWriteVar(ValueType.INT, "num", -1)); assetName = headerBlock.Add(new ReadWriteVar(ValueType.STRING, "assetName", "")); sourceFile = headerBlock.Add(new ReadWriteVar(ValueType.STRING, "sourceFile", "")); preload = headerBlock.Add(new ReadWriteVar(ValueType.BOOL, "preload", false)); }