lib/mikunyan/asset.rb in mikunyan-3.9.8 vs lib/mikunyan/asset.rb in mikunyan-3.9.9

- old
+ new

@@ -54,11 +54,11 @@ end # Returns object type name string # @return [String,nil] type name def type - klass&.type_tree&.tree&.type || Mikunyan::Constants::CLASS_ID2NAME[class_id] + klass&.type_tree&.tree&.type || Mikunyan::Constants::CLASS_ID2NAME[class_id || klass&.class_id] end end LocalObjectEntry = Struct.new(:file_id, :local_id) @@ -101,10 +101,16 @@ # @return [Enumerator<Mikunyan::Asset::ObjectEntry>,Array<Mikunyan::Asset::ObjectEntry>] def each_object(&block) @objects.each(&block) end + # Returns object with specified path ID + # @return [ObjectEntry,nil] + def path_id(id) + @path_id_table[id] + end + # Returns list of all path IDs # @return [Array<Integer>] list of all path IDs def path_ids @objects.map(&:path_id) end @@ -175,11 +181,11 @@ br.pos = file_size - meta_size @endian = br.bool ? :big : :little end if @format >= 22 - meta_size = br.i32u - file_size = br.i64u + _meta_size = br.i32u + _file_size = br.i64u data_offset = br.i64u br.adv(8) end br.endian = @endian