aboutsummaryrefslogtreecommitdiff
path: root/src/unityfs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/unityfs.rs')
-rw-r--r--src/unityfs.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/unityfs.rs b/src/unityfs.rs
index 0f3cab6..a23114d 100644
--- a/src/unityfs.rs
+++ b/src/unityfs.rs
@@ -142,6 +142,15 @@ impl<T: Read + Seek> UnityFS<T> {
pub fn nodes(&self) -> &[NodeInfo] {
&self.nodes
}
+
+ pub fn find_main_file(&self) -> Option<&NodeInfo> {
+ self.nodes().iter().find(|n| {
+ !n.name.ends_with(".resource")
+ && !n.name.ends_with(".resS")
+ && !n.name.ends_with(".sharedAssets")
+ })
+ }
+
pub fn read<'a>(&'a mut self, node: &NodeInfo) -> std::io::Result<NodeReader<'a, T>> {
self.reader.seek(SeekFrom::Start(node.offset))?;
Ok(NodeReader {