JSBinding + SharpKit / run samples

Import JSBinding package to your project.

on Windows

1) for 32bit editor: copy Assets/Plugins/x86/mozjs-33.dll to UnityInstallDir/Editor folder

2) for 64bit editor: copy Assets/Plugins/x86_64/mozjs-33.dll to UnityInstallDir/Editor folder

  1. open scene JSBinding/Samples/Viewer
  2. click menu JSBinding | Generate JS and CS Bindings
  3. play the scene. There is a scene list, each scene represents a sample. Select one scene to play. Scenes ended with ‘_JS‘ are JavaScript version.

时间: 2024-10-19 15:33:00

JSBinding + SharpKit / run samples的相关文章

JSBinding + SharpKit / Home

Description JSBinding is a great tool enabling you to run actual JavaScript in Unity3D. It contains Mozilla SpiderMonkey JavaScript engine version 33 library. New version is expected to work with SharpKit (sharpkit.net). SharpKit is an open source to

JSBinding+SharpKit / 菜单介绍

[JSB | Generate JS and CS Bindings] 生成绑定,即让 Js 和 Cs 互通.详情请看 JSBinding+SharpKit / 生成 JavaScript 绑定 [JSB | Add SharpKit JsType Attribute for all Structs and Classes] 在所有逻辑代码中,所有类的定义前面加上 [JsType(JsMode.Clr, "~/Assets/StreamingAssets/JavaScript/SharpKitG

JSBinding + SharpKit / 编译 Cs 成 Js

轻轻一点菜单:[JSB | Compile Cs to Js] 主要产出:StreamingAssets/JavaScript/SharpkitGeneratedFiles.javascript,你的所有逻辑代码都在这里 其他产出: Temp/AllInvocations.txt:记录所有逻辑代码对框架代码的调用 (1) Temp/AllInvocationsWithLocation.txt:同上,但同时记录每个调用的文件名和行号 (2) Temp/YieldReturnTypes.txt:记录

JSBinding + SharpKit / Important Notes

Serialization of List<T> is not supported. public List<int> lst; // NOT supported, use int[] instead About menu: JSB | Add SharpKit JsType Attribute for all Structs and Classes. If you execute this menu more than once, only one JsType will be

JSBinding + SharpKit / 初体验:下载代码及运行Demo

QQ群:189738580 git地址:https://github.com/qcwgithub/qjsbunitynew.git插件源码地址(不包含SpiderMonkey源代码):https://github.com/qcwgithub/qjsbmozillajswrap.git 首先用 Unity 打开代码目录下的 proj 工程 由于使用的插件存在依赖,请将 Assets/Plugins/x86/mozjs-28.dll 拷贝于 Unity 安装目录下.如图所示. 如果没有做这个步骤,运

JSBinding+SharpKit / 更新的原理

首先,其实不是热更新,而是更新. 热更新意思是不重启游戏,但只要你脚本里有存储数据,就不可能.所以只能叫更新. 但大家都这么说,所以... 先举个具体的例子: 如果是C#:在 Prefab 的 GameObject 上绑定 C# 脚本,这个 Prefab 会被打包成 AssetBundle,然后通过 AssetBundle.Load 加载到游戏中. 因为C#本身不可能更新,所以就无法修改. JSB的方案是,将这些 C# 的 MonoBehaviour 都替换成 JSComponent_xxx.这

JSBinding + SharpKit / 常见问题

运行时出现: 1 Return a "System.Xml.XmlIteratorNodeList" to JS failed. Did you forget to export that class? 答:将这个类加入到 JSBindingSettings.classes 数组后运行一下菜单 JSB | Generate JS and CS Bindings. 特殊情况1:如果这个类并不存在,或者是被 DLL 隐藏了,导致无法添加,那么请添加他的基类.比如上面的 System.Xml

JSBinding + SharpKit / To JavaScript-Only users

This plugin is mainly desined to work with SharpKit. You are expected to write C# and get JavaScript code with help of SharpKit. If you don't like C# and would like to write JavaScrtipt only, Yes, you can do this, in version 1.5. But it will be a lit

JSBinding + SharpKit / 原理篇:Delegate

以 NGUI 的 UIEventListener 为例: 有一个类: 1 using SharpKit.JavaScript; 2 using UnityEngine; 3 using System.Collections; 4 5 [JsType(JsMode.Clr,"../StreamingAssets/JavaScript/SharpKitGenerated/z_temp/test0610.javascript")] 6 public class test0610 : Mono