网页资讯视频图片知道文库贴吧地图采购
进入贴吧全吧搜索

 
 
 
日一二三四五六
       
       
       
       
       
       

签到排名:今日本吧第个签到,

本吧因你更精彩,明天继续来努力!

本吧签到人数:0

一键签到
成为超级会员,使用一键签到
一键签到
本月漏签0次!
0
成为超级会员,赠送8张补签卡
如何使用?
点击日历上漏签日期,即可进行补签。
连续签到:天  累计签到:天
0
超级会员单次开通12个月以上,赠送连续签到卡3张
使用连续签到卡
06月08日漏签0天
unity3d吧 关注:116,326贴子:560,420
  • 看贴

  • 图片

  • 吧主推荐

  • 视频

  • 游戏

  • 1回复贴,共1页
<<返回unity3d吧
>0< 加载中...

【提问】unity3d c#调js,js再调c#问题

  • 只看楼主
  • 收藏

  • 回复
  • 逍灵叹
  • Unitor
    1
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
我在做项目的时候由于和其他人的配合问题,出现了要使用(a.cs)c#调用(b.js)js,(b,js)js再调用(c.cs)c#这样的问题(两个cs文件不相同)。
我看了一下编译顺序,只发现"StandardAssets"、 "Pro StandardAssets“和 "Plugins"这三个目录的可以提前编译,这样不能实现这三个文件层次的调用。
请教一下大家,有什么方法可以实现这样的调用呢?先谢谢大家了~~~


  • xigemaqq
  • Animator
    9
该楼层疑似违规已被系统折叠 隐藏此楼查看此楼
脚本编译包含4步:
1. All scripts in "Standard Assets", "Pro Standard Assets" or "Plugins" are compiled first.
所有"Standard Assets", "Pro Standard Assets"或"Plugins"文件夹里的脚本会被首先编译
Scripts in one of these folders can't directly access scripts outside these folders.
这些文件夹里的脚本不能直接访问文件夹之外的脚本。
It is not possible to reference the class or its variables directly, but it is possible to communicate with them using GameObject.SendMessage .
不能直接引用类或它们的变量,但是可以通过使用 GameObject.SendMessage 与他们进行通信。
2.All scripts in "Standard Assets/Editor", "Pro Standard Assets/Editor" or "Plugins/Editor" are compiled next.
所有"Standard Assets/Editor", "Pro Standard Assets/Editor"或"Plugins/Editor"文件夹里的脚本会紧接着编译。
If you want to use the UnityEditor namespace you have to place your scripts in these folders. For example to add menu items or write custom wizards you have to place your scripts in those folders.
如果你想使用UnityEditor命名空间,你必须把你的脚本放到这些文件夹里。例如你想添加菜单项或自定义向导,那么你必须把你的脚本放到那些文件夹里。
These scripts can access scripts from the previous group.
这些脚本可以访问之前第一条里说的那些脚本.
3.All other scripts outside "Editor" are compiled next.
所有在"Editor"外的脚本将紧接着被编译
All scripts that are not in the folders above or in "Editor" are compiled next.
所有脚本不在以上文件夹或Editor中紧接着被编译。
All scripts that are compiled in this step have access to all scripts in the first group ("Standard Assets", "Pro Standard Assets" or "Plugins"). This allows you to let different scripting languages interoperate. For example, if you want to create a Javascript that uses a C# script: place the C# script in the "Standard Assets" folder and the Javascript outside of the "Standard Assets" folder. The Javascript can now reference the C# script directly.
在这步所有脚本被编译,在第一组已访问的所有脚本。这允许你让不同的脚本语言交互操作。例如,如果你想使用C#脚本来创建Javascript脚本:把C#脚本放在Standard Assets文件夹,Javascript文件在Standard Assets文件夹外。现在Javascript可以直接引用C#脚本了。
Scripts that are placed in the first group, will take longer to compile, since when they are compiled the third group needs to be recompiled too. Thus if you want to reduce compile times, put scripts that seldom change into group 1 and scripts that change a lot into group 3.
脚本被放在第一组,将需要更长的时间来编译,因为当它们被编译的第三组也需要重新编译,因此,如果你想减少编译时间,将在第1组的脚本要较少修改,把较多修改的脚本放在第3组。
4. All scripts in "Editor" are compiled last.
所有在Editor文件夹的的脚本最后编译。
If you want to use the UnityEditor namespace you have to place your scripts in these folders. For example to add menu items or write custom wizards you have to place your scripts in those folders.
如果你想使用UnityEditor命名空间,必须把脚本放到这个文件夹中。例如,添加菜单项或写个自定义向导,就比较把脚本放到这个文件夹。
These scripts can access all scripts in all previous groups.
这些脚本可以访问所有以前的组中的所有脚本。
Additionally, any scripts in a folder called WebPlayerTemplates will not be compiled at all.
此外,任意在名为WebPlayerTemplates文件夹将不会被编译。


登录百度账号

扫二维码下载贴吧客户端

下载贴吧APP
看高清直播、视频!
  • 贴吧页面意见反馈
  • 违规贴吧举报反馈通道
  • 贴吧违规信息处理公示
  • 1回复贴,共1页
<<返回unity3d吧
分享到:
©2025 Baidu贴吧协议|隐私政策|吧主制度|意见反馈|网络谣言警示