File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -189,6 +189,10 @@ export class AudioClip extends AssetBase {
189189 this . format = recognizeFile ( this . data , magicNumbers ) || 'fsb' ;
190190 }
191191
192+ get size ( ) {
193+ return this . __info . bytesSize + Number ( this . audioSize ) ;
194+ }
195+
192196 getAudio ( ) : AudioClipGetResult {
193197 return {
194198 format : this . format ,
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export class Texture2D extends AssetBase implements GetImage {
3030 readonly height : number ;
3131 readonly textureFormat : number ;
3232 readonly streamData ?: StreamInfo ;
33+ readonly dataSize : number ;
3334 private readonly image : TextureDecoder ;
3435
3536 constructor ( info : ObjectInfo , r : ArrayBufferReader ) {
@@ -71,9 +72,14 @@ export class Texture2D extends AssetBase implements GetImage {
7172 ? this . readStreamInfo ( r )
7273 : undefined ;
7374 const data = this . streamData ?. path ? this . readData ( this . streamData ) : r . readBuffer ( dataSize ) ;
75+ this . dataSize = this . streamData ?. size ?? dataSize ;
7476 this . image = new TextureDecoder ( this , new Uint8Array ( data ) ) ;
7577 }
7678
79+ get size ( ) {
80+ return this . __info . bytesSize + this . dataSize ;
81+ }
82+
7783 getImage ( ) {
7884 return getJimpPNG ( this . getImageJimp ( ) ) ;
7985 }
You can’t perform that action at this time.
0 commit comments