unityscript_UnityScript到C#的转换工具

unityscript

Do you have any older projects that use UnityScript? If so, you might be interested in our open source UnityScript to C# conversion tool available to download now.

您有使用UnityScript的旧项目吗? 如果是这样,您可能会对我们的开源UnityScript至C#转换工具感兴趣,该工具可立即下载

Back in August 2017, we have begun the deprecation process for UnityScript, a JavaScript-like scripting language, and started working on a conversion tool from that language to C#. Shortly after that, we moved the menu option used to create new UnityScript scripts under Legacy.

早在2017年8月 ,我们就开始了UnityScript(一种类似于JavaScript的脚本语言)的弃用过程,并开始研究 从该语言到C# 的 转换工具 。 此后不久,我们将用于创建新UnityScript脚本的菜单选项移至 Legacy 下 。

Since then we’ve collected a lot of feedback and fixed a bunch of issues in the conversion tool. To name a few changes motivated by your feedback:

从那时起,我们收集了很多反馈,并修复了转换工具中的许多问题。 列举一些由您的反馈意见引起的变化:

    With Unity 2018.2, we removed the option to create new UnityScript scripts completely. Now we believe that the conversion tool is feature complete and stable enough to help any of you that still have projects using UnityScript.

    使用Unity 2018.2,我们删除了完全创建新UnityScript脚本的选项。 现在,我们相信该转换工具具有完整且稳定的功能,可以帮助仍然有使用UnityScript进行项目的任何人。

    Before starting the conversion process, we suggest that you make sure your project builds cleanly on Unity 2018.1, all of your tests are passing and you understand the limitations listed here.

    在开始转换过程之前,我们建议您确保您的项目在Unity 2018.1上完全构建,所有测试都通过并且您了解 这里 列出的限制 。

    We recommend running the conversion tool through the menu Tools/Convert UnityScript to C#. If you need more control over the parameters used during the conversion you can run the conversion through the command line but keep in mind that the extra flexibility comes with extra complexity.

    我们建议您通过菜单 工具/将UnityScript转换为C# 运行转换工具 。 如果您需要对转换期间使用的参数进行更多控制,则可以通过 命令行 运行转换, 但是请记住,额外的灵活性带来了额外的复杂性。

    As an example, the video below outlines the process of converting an older version of Angry Bots project. The intent of this is only for demonstration purposes whence we simply commented out any code causing compilation errors when first open the project in 2018.1.

    例如,下面的视频概述了转换 较旧版本的Angry Bots 项目的过程。 这样做的目的仅是为了演示,我们在2018.1中首次打开项目时仅注释掉任何导致编译错误的代码。

    演示地址

    To summarize, the basic process should be something like:

    总而言之,基本过程应类似于:

    1. Backup your project

      备份你的项目

    2. Open project in 2018.1

      在2018.1中打开项目

    3. Accept API Updater offer (if any) and fix remaining errors

      接受API更新程序报价(如果有)并修复剩余的错误

    4. Make sure player builds successfully on each target platform

      确保玩家在每个目标平台上都能成功构建

    5. Make sure all related tests are passing (also, run the project on real devices)

      确保所有相关测试都通过了(也请在真实设备上运行项目)

    6. Install the latest Editor Integration Package (see here for instructions on how to install asset packages in the Editor).

      安装最新的 编辑器集成软件包 (请参见 此处 ,了解如何在编辑器中安装资产软件包)。

    7. Clean editor console

      干净的编辑器控制台

    8. Run the conversion tool.

      运行转换工具。

    9. Fix any remaining issues (running related tests)

      解决所有剩余的问题(运行相关测试)

    Note that if your project targets multiple platforms, you may need to repeat step 8 for each target platform by selecting the platform before running the conversion tool, and then manually merge the converted code, wrapping the code with conditional code accordingly.  This is a limitation of the tool. In this case, you’ll probably use a VCS to restore the state of the project after each conversion.
    请注意,如果您的项目针对多个平台,则可能需要在运行转换工具之前为每个目标平台重复步骤8,方法是选择平台,然后手动合并转换后的代码,并用 条件代码 包装相应的代码 。 这是该工具的局限性。 在这种情况下,您可能会在每次转换后使用VCS还原项目的状态。

    Step 9 may or may not be required (it depends on which APIs your project uses), but in the Angry Bots example, we needed to fix some API usages.

    可能需要也可能不需要步骤9(取决于您的项目使用的API),但是在Angry Bots示例中,我们需要修复一些API用法。

    Since the tool is open source, you’re invited to download its source and look around! Please feel free to contribute any fixes/improvements.

    由于该工具是开源的,因此我们邀请您下载它的源代码并四处看看! 请随时贡献任何修复/改进。

    If for any reason this tool does not fit your needs you may want to check other converters available on the Asset Store.

    如果由于某种原因该工具不能满足您的需求,您可能需要检查 Asset Store 上其他可用的转换器 。

    Finally, if you need any help with the tool please ask in this forum thread and we’ll do our best to help you.

    最后,如果您需要有关该工具的任何帮助,请在 此论坛主题中 提问 ,我们将尽最大努力为您提供帮助。

    翻译自: https://blogs.unity3d.com/2019/01/08/unityscript-to-c-conversion-tool/

    unityscript

    评论
    添加红包

    请填写红包祝福语或标题

    红包个数最小为10个

    红包金额最低5元

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

    抵扣说明:

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

    余额充值