-
Notifications
You must be signed in to change notification settings - Fork 679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
global object in javascrript #1734
Comments
There is no direct support, you can achieve this by calling js functions from c#. |
Can you show an example for Unity? How can I do this or how can I pass an instance object to javascript by reference |
js function function setGlobal( key, value) {
globalThis[key] = value;
} Assign setGlobal to C# as a Action<string, object> variable, then call this delegate variable in C#. |
Hi! Thank you!
When calling a function it throws an error System.Exception: 👎 TypeError: not a function |
AddDATFile is non public ? |
yes public void AddDatFile(string url, bool isCache = false) Can you post your example please? |
Add testcase to https://github.com/Tencent/puerts/blob/master/unity/test/Src/Cases/CrossLang/CrossLangTest.cs
do test
|
detail | 详细描述
How can I specify a global object from C# so that it is available in JavaScript?
MoonSharp example
_scriptEngine.Globals["Engine"] = this;
The text was updated successfully, but these errors were encountered: