Esempio n. 1
0
 public AssetGetter(string uri, string assetId, VrAssetFormat assetType,
                    string reason)
 {
     m_URI            = uri;
     m_Asset          = new PolyRawAsset(assetId, assetType);
     m_JsonSerializer = new JsonSerializer();
     m_JsonSerializer.ContractResolver = new SnakeToCamelPropertyNameContractResolver();
     Reason = reason;
 }
        public ToolkitRawImage LoadAsImage(string uri)
        {
            uri = PolyRawAsset.GetPolySanitizedFilePath(uri);
            string   path     = Path.Combine(m_uriBase, uri);
            RawImage rawImage = ImageUtils.FromImageData(File.ReadAllBytes(path), path);

            return(new ToolkitRawImage {
                format = TextureFormat.RGBA32,
                colorData = rawImage.ColorData,
                colorWidth = rawImage.ColorWidth,
                colorHeight = rawImage.ColorHeight
            });
        }
Esempio n. 3
0
 public IBufferReader Load(string uri)
 {
     // null uri means the binary chunk of a .glb
     uri = (uri == null) ? null : PolyRawAsset.GetPolySanitizedFilePath(uri);
     return(m_delegate.Load(uri));
 }