O
OneJS5mo ago
Singtaa

Ah there's an issue with esbuild not

Ah there's an issue with esbuild not bundling images for standalone player. Will get fixed soon. For now, you can work around by putting your images inside of Resources folders (under Assets) and use Unity's Resources.Load directly. https://docs.unity3d.com/ScriptReference/Resources.Load.html
import { h, render } from "preact"
import { Resources, Texture2D } from "UnityEngine"

const { $typeof } = puer

const tex = Resources.Load("skyrim", $typeof(Texture2D)) as Texture2D // loads skyrim.jpg from the Resources folder

const App = () => {
return <image image={tex} />
}

render(<App />, document.body)
import { h, render } from "preact"
import { Resources, Texture2D } from "UnityEngine"

const { $typeof } = puer

const tex = Resources.Load("skyrim", $typeof(Texture2D)) as Texture2D // loads skyrim.jpg from the Resources folder

const App = () => {
return <image image={tex} />
}

render(<App />, document.body)
5 Replies
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Singtaa
SingtaaOP5mo ago
No worries! I appreciate all feedbacks on testing v2. So for npm run switch <quickjs|v8|nodejs>, it basically does this: 1) Download the tgz for v8/quickjs/nodejs from puerts' github repo 2) Extract the tgz into ./tmp (under App 3) Safe keep the asmdef files from your existing Puerts installation (to prevent reference errors) 4) Replace your existing Puerts installation with the one under ./tmp Do you see any erorr in the Terminal when running npm run switch?
Singtaa
SingtaaOP5mo ago
One thing to check is if your App/package.json contains the correct path for unityPackagePath:
No description
Singtaa
SingtaaOP5mo ago
this field is being automatically written to by the Initializer comp on the ScriptEngine prefab
Unknown User
Unknown User5mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server