public bool TryGetValue(NpkPath key, out IReadOnlyList <FrameInfo> value)
 {
     if (m_npk.Images.ContainsKey(key))
     {
         m_npk.PreLoadSpriteMetadata(key);
         value = m_npk.m_frames[key];
         return(true);
     }
     else
     {
         value = null;
         return(false);
     }
 }
示例#2
0
 /// <summary>
 /// Preloads frame metadata for the .img file with the given path with a leading sprite/ if present.
 /// If the metadata has already been loaded, does nothing.
 /// Metadata for an .img's frames are loaded on demand otherwise.
 /// </summary>
 /// <param name="spriteFilePath">NPK path of the .img file to preload. Must contain a leading sprite/ if present in the actual path.</param>
 /// <exception cref="System.IO.FileNotFoundException">There is no .img file in the NPK with the given path.</exception>
 /// <exception cref="System.IO.IOException">An I/O error occurred.</exception>
 /// <exception cref="Dfo.Npk.NpkException">The .npk file is corrupt or the format changed.</exception>
 public void PreLoadSpriteMetadata(NpkPath spriteFilePath)
 {
     ThrowIfDisposed();
     ThrowIfNoFileOpen();
     _reader.PreLoadSpriteMetadata(spriteFilePath);
 }