Classes in JSBindingSettings.classes array will be exported to JavaScript.

There are already many classes (most of them are from UnityEngine.dll) in that array, you have to add your own classes, and maintain this array.

 1     public static Type[] classes = new Type[]
2 {
3 /*
4 * Classes to export for demo
5 * Add classes here to export
6 */
7
8 typeof(UnityEngine.WheelCollider),
9 typeof(UnityEngine.PhysicMaterial),
10 typeof(UnityEngine.Collision),
11 typeof(UnityEngine.ControllerColliderHit),
12 typeof(UnityEngine.CharacterController),
13
14 //....
15 }

Add to JSBindingSetting.enums to export enums:

public static Type[] enums = new Type[]
{
typeof(KeyCode), // add here
};

Click this menu to export those classes:

Assets | JavaScript | Gen Bindings

NOTE: This menu must be executed when swiching to a different platform in Build Settings dialog!

after finished, two parts of code will be generated:

1) C# files in folder Assets/JSBinding/Generated/

2) JavaScript files in folder StreamingAssets/JavaScript/Lib/Gen.javascript (all in one)

back to JSBinding / Home

JSBinding / Gen Bindings的更多相关文章

  1. JSBinding+Bridge.NET:生成绑定(导出)

    将框架代码导出到 JavaScript.就可以在 JavaScript 中调用 框架代码 的功能. 注意,这个功能是在 Js工程中做的,Cs工程没有这回事. 如何导出? 1. 将需要导出的类添加到 J ...

  2. JSBinding+Bridge.Net:框架代码与逻辑代码的关系

    在JSB+Bridge工程中你可以同时维护Cs版本和Js版本的游戏. 框架代码:简称framework,表示那些不进行热更的代码.注意,这包括你自己写的代码,也包括引用的Dll,比如UnityEngi ...

  3. JSBinding+Bridge.NET:Unity游戏热更新方案

    老版本链接如下:http://www.cnblogs.com/answerwinner/p/4469021.html 新用户不要再使用老版本了. 新版本 JSBinding 将抛弃 SharpKit ...

  4. JSBinding / FAQ & Trouble Shooting

    Q: Why javascript file extension is .javascript?A: Because Unity treats .js files as Unity script an ...

  5. JSBinding / Home

    Description JSBinding is a tool enabling you to run actual javascript in Unity3D. It contains Mozill ...

  6. JSBinding / Run Samples

    This document shows you how to run JSBinding 2048 sample in Editor. First of course, create an empty ...

  7. JSBinding+SharpKit / 菜单介绍

  8. JSBinding + SharpKit / 编译 Cs 成 Js

    轻轻一点菜单:[JSB | Compile Cs to Js] 主要产出:StreamingAssets/JavaScript/SharpkitGeneratedFiles.javascript,你的 ...

  9. JSBinding + SharpKit / 实战:转换 Survival Shooter

    从 asset store 下载 Survival Shooter (商店里有2个版本,一种是给Unity5用的,一个是给Unity4.6用的,我们这个实验用的是后者,版本是2.2.如果) 1 删除多 ...

随机推荐

  1. JS constructor

    1.每个对象都有一个constructor,都指向创建该对象的方法. 2.function对象的prototype的constructor也是指向该方法.如果对prototype进行重写,constr ...

  2. android 经典下雨效果

    英文原文地址:https://blog.stylingandroid.com/snowfall/ 中文翻译地址:http://www.open-open.com/lib/view/open145226 ...

  3. 《day09---继承-抽象类-接口》

    //面向对象_继承_概述---单继承_多继承. //描述学生. /* class Student { //属性. String name; int age; //行为: void study() { ...

  4. (转)JS加载顺序

    原文:http://blog.csdn.net/dannywj1371/article/details/7048076 JS加载顺序 做一名合格的前端开发工程师(12篇)——第一篇 Javascrip ...

  5. struts2和servlet同时用(访问servlet时被struts2过滤器拦截问题的解决)

    在同一个项目中间,如果既用到servlet有用了struts2的框架,运行项目时可能无法正常使用servlet,原因是在配置struts2的核心控制器时<url-pattern>/*< ...

  6. 【LeetCode OJ】Max Points on a Line

    Problem: Given n points on a 2D plane, find the maximum number of points that lie on the same straig ...

  7. Swift:函数和闭包

    函数 函数是一个完成独立任务的代码块,Swift中的函数不仅可以像C语言中的函数一样有函数的参数和返回值,而且还支持嵌套,并且有函数参数默认值.可变参数等. //定义一个函数,注意参数和返回值,如果没 ...

  8. iOS数据持久化

    在iOS中,实现数据持久化一般分为4大种: 1.属性列表 2.对象归档 3.SQLite 4.Core Data 一.属性列表 NSUserDefaults类的使用和NSKeyedArchiver有很 ...

  9. Java_oop_继承

    不用多久,就会升职加薪,当上总经理,出任CEO,迎娶白富美,走上人生巅峰.想想还有点小激动呢, OK,睡醒了,我们说到继承就先来学习一下Java中继承的语法. public SubClass exte ...

  10. Cow Exhibition_背包(负数情况)

    Description "Fat and docile, big and dumb, they look so stupid, they aren't much fun..." - ...