Exemplo n.º 1
0
        /// <summary>
        /// Add image to persistent cache providing the uri and idSuffix in which the image can be looked up.
        /// Both ids are used from the GLTFSceneImporter to generate an unique id among many GLTFs.
        /// </summary>
        /// <param name="uri">The relative or local uri of the image</param>
        /// <param name="idSuffix">A global identifier to prevent collisions in case the local uri between different loaded images is the same</param>
        /// <param name="texture">The texture to cached image</param>
        public static RefCountedTextureData AddImage(string uri, string idSuffix, Texture2D texture)
        {
            var key = GetCacheId(uri, idSuffix);

            ImageCacheByUri[key] = new RefCountedTextureData(key, texture);
            return(ImageCacheByUri[key]);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Add image to persistent cache providing the exact id in which the image can be looked up.
 /// </summary>
 /// <param name="fullId">The relative or local uri of the image</param>
 /// <param name="texture">The texture to cached image</param>
 public static RefCountedTextureData AddImage(string fullId, Texture2D texture)
 {
     ImageCacheByUri[fullId] = new RefCountedTextureData(fullId, texture);
     return(ImageCacheByUri[fullId]);
 }