Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

How to use UnityEngine without ReflectBind Mode? #115

Open
mikejurka opened this issue Apr 14, 2023 · 1 comment
Open

How to use UnityEngine without ReflectBind Mode? #115

mikejurka opened this issue Apr 14, 2023 · 1 comment

Comments

@mikejurka
Copy link

I'm having trouble with my scripts not finding the UnityEngine module when I do a WebGL build.
I have the same issue in-editor when I uncheck the ReflectBind mode.

Repro steps:

  1. JS Bridge > Generate Bindings and Type Definition
  2. Open Assets/Examples/Scenes/SampleScene.unity
  3. For Entry File name, select game_demo or example_monobehaviour
  4. Disable ReflectBind mode
  5. Press play

Expected: the examples run normally
Actual: They don't run and in the console I see:

[JS] undefined:undefined module can not be resolved (UnityEngine)
    at require (native)
    at <anonymous> (assets/js-scripts/components/mikesample_mutate_global.js.bytes:10)
    at require (native)
    at <eval> (/Users/mike/code/unity-jsb/Scripts/src/components/mikesample_mutate_global.ts)

UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
QuickJS.Extra.MiniConsole:LogError (string) (at Assets/jsb-extra/MiniConsole/MiniConsole.cs:87)
QuickJS.Extra.MiniConsole:LogErrorFormat (string,object[]) (at Assets/jsb-extra/MiniConsole/MiniConsole.cs:160)
QuickJS.Extra.MiniConsole:UnityEngine.ILogHandler.LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[]) (at Assets/jsb-extra/MiniConsole/MiniConsole.cs:214)
UnityEngine.Debug:LogError (object)
QuickJS.Unity.JSBehaviour:CreateScriptInstance () (at Packages/cc.starlessnight.unity-jsb/Source/Unity/JSBehaviour.cs:669)
QuickJS.Unity.JSBehaviour:Awake () (at Packages/cc.starlessnight.unity-jsb/Source/Unity/JSBehaviour.cs:545)

@ialex32x
Copy link
Owner

ialex32x commented Apr 19, 2023

I checked on unity2020.3+windows build. It works properly with these steps. Will this issue be reproduced on platform builds other than WebGL on your side?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants