码迷,mamicode.com
首页 > 编程语言 > 详细

JSBinding + SharpKit / To JavaScript-Only users

时间:2015-08-01 11:18:55      阅读:132      评论:0      收藏:0      [点我收藏+]

标签:

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 little inconvenient.

Examples

C#

GameObject go = new GameObject("Wall");
Debug.Log(go.active);

JavaScript

var go = new UnityEngine.GameObject.ctor$$String("Wall");
UnityEngine.Debug.Log$$Object(go.get_active());

See that? If you write JavaScript by hand:

  1. namespace can not be omited
  2. ‘.ctor‘ to call constructor
  3. suffix appended for overloaded methods ($$Object, $$String)
  4. Property is changed to function with prefix ‘get_‘, ‘set_‘. (get_active())

I don‘t think you will like to write code like this.

 

..

 

Back to JSBinding + SharpKit / Home

JSBinding + SharpKit / To JavaScript-Only users

标签:

原文地址:http://www.cnblogs.com/answerwinner/p/4693748.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!