lookup by asset:// uri
This commit is contained in:
@@ -80,15 +80,17 @@ public class SwiftPolyvoxFilamentPlugin: NSObject, FlutterPlugin, FlutterTexture
|
|||||||
} else {
|
} else {
|
||||||
if(uriString.hasPrefix("file://")) {
|
if(uriString.hasPrefix("file://")) {
|
||||||
path = String(uriString.dropFirst(7))
|
path = String(uriString.dropFirst(7))
|
||||||
} else {
|
} else if(uriString.hasPrefix("asset://")) {
|
||||||
let key = instance.registrar.lookupKey(forAsset:uriString)
|
let key = instance.registrar.lookupKey(forAsset:String(uriString.dropFirst(6)))
|
||||||
path = Bundle.main.path(forResource: key, ofType:nil)
|
path = Bundle.main.path(forResource: key, ofType:nil)
|
||||||
print("Found path \(path) for uri \(uriString)")
|
print("Found path \(path) for uri \(uriString)")
|
||||||
guard path != nil else {
|
guard path != nil else {
|
||||||
print("File not present in bundle : \(uri)")
|
print("File not present in bundle : \(uri)")
|
||||||
return ResourceBuffer()
|
return ResourceBuffer()
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
do {
|
do {
|
||||||
print("Opening data from path \(path)")
|
print("Opening data from path \(path)")
|
||||||
|
|||||||
Reference in New Issue
Block a user