Closed KurtGokhan closed 2 years ago
7 - Added another commit. This one adds JSB_RUNTIME_REFLECT_BINDING
which will include jsb.editor.binding
and jsb.editor.unity
assemblies in the build. Because of heavy coupling with UnityEditor
in those assemblies, JSB_UNITYLESS
must also be defined for building without a problem.
The parentType
still has a few issues which can't meet all cases. Because which types are exported are in a more static way for now for better type management (and d.ts generating). Some classes could be deliberately skipped for the binding process. For example, class A -> class B -> class C in C# could be exported as class A -> class C in typescript.
And another case is that types could be exported with StaticBind
(because DynamicType
is still available at runtime with StaticBind
mode). A more flexible way is needed to implement parentType
access in the future to cover these cases.
Summary of changes:
1 - WSA and WebGL native binaries were causing issue in build. Had to change their meta. 2 - Some fixes when
JSB_UNITYLESS
is defined even when we are insideUNITY_EDITOR
3 - Codegen & NetStandard issues (Probably we should unify define variables which are used across the project.NET_STANDARD_2_0
is correct but there is alsoNET_STANDARD_2_1
andNET_STANDARD
, but they may not be available in all Unity versions) 4 - ~AddedJSB_NEWTONSOFT_JSON
flag. When usingJSB_UNITYLESS
inside Unity,System.Text.Json
namespace isn't available by default. This is not a nice solution, so I am open to suggestions.~ Edit: Modified code to use Unity's own serializer if inside Unity, even ifJSB_UNITYLESS
is defined. 5 - Enabled back DynamicType prototype inheritance. This time without GC leaks. 6 - ImprovedExecutePendingJob
to check if there are pending jobs remaining. This is a weird one, because you would expect QuickJS to do this automatically. But some cases did not work. For example:When this code executes, it shows the following in browser:
But in unity-jsb, it shows only up to "P3". It shows the rest in the next updates.