C#与js之间的相互调用


C#与js之间的相互调用:

1、UnityScript and C# scripts are compiled into different assemblies. You need to put the C# in a folder called Plugins or Standard Assets and it will be accessible from the JS file

1

Note that the scripts pu into Plugins or Standar Assets cannot use or reference scripts that are outside those folders.

Sep 19 '12 at 11:50 AM Kryptos

Just to expand on the above : it is possible to use both languages, but they need to be organized into a specific folder that gets compiled before the other scripts. See point 3 in the first link regarding these folders : All scripts in "Standard Assets", "Pro Standard Assets" or "Plugins" are compiled first. i.e. If C# files are placed in one of the above mentioned folders, C# gets compiled before JS, JS can see C# but C# cannot see JS :

http://docs.unity3d.com/Documentation/ScriptReference/index.Script_compilation_28Advanced29.html => point 3

http://answers.unity3d.com/questions/208383/referencing-a-c-component-script-from-js-script.html

http://answers.unity3d.com/questions/243112/calling-c-classes-from-js.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值