mirror of
https://github.com/storytold/spark.git
synced 2026-10-17 00:12:59 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
export async function getAssetFileURL(assetFile) {
|
||||
try {
|
||||
const response = await fetch("/examples/assets.json");
|
||||
const assetsDirectory = "/examples/assets/";
|
||||
const assetsInfo = await response.json();
|
||||
let url = assetsInfo[assetFile].url;
|
||||
if (window.forgeLocalAssets) {
|
||||
url = `${assetsDirectory}${assetsInfo[assetFile].directory}/${assetFile}`;
|
||||
}
|
||||
return url;
|
||||
} catch (error) {
|
||||
console.error("Failed to load asset file URL:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user