Example #1
0
            public CompiledAssets()
            {
                block = new ReadWriteBlock();
                fileName = block.Add(new ReadWriteVar(ValueType.STRING, "fileName", ""));

                assets = new List<AssetData>();
            }
Example #2
0
 public ReferenceAsset()
 {
     referenceNum = dataBlock.Add(new ReadWriteVar(ValueType.INT, "referenceNum", -1));
 }
Example #3
0
 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));
 }
Example #4
0
 public TextAsset()
 {
     text = dataBlock.Add(new ReadWriteVar(ValueType.STRING, "text", ""));
 }
Example #5
0
            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;
                }
            }
Example #6
0
 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));
 }