Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

UnityScript 2 CSharp conversion tool

Discussion in 'Experimental Scripting Previews' started by AdrianoVerona_Unity, Aug 11, 2017.

  1. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    [Edited]

    Thanks

    The problem is that the integration code is resolving the Unity installation folder to a wrong path:

    > Found assemblies root folder at '/Applications/Unity/PlaybackEngines/WebGLSupport/Variations/development/Data/Managed'

    but it should not resolve to that path (I've tested locally and the code looks correct). I checked on git and that code indeed had a bug but it was fixed in Aug/2017.

    Which version of the converter are you using? If you are not sure download the latest one and try again)

    As a workaround you may temporarily rename /Applications/Unity/PlaybackEngines/WebGLSupport/Variations/development/Data/Managed to something else (for instance you may add an _ in the name Managed. (you need to do this to all folders that follow the pattern Data/Managed inside the PlaybackEngines).

    [Edited 2]

    Actually there were a bug in the code that would cause that problem. I've fixed and released a new version of the converter (with some other fixes)

    Adriano
     
    Last edited: Jun 5, 2019
  2. lasco

    lasco

    Joined:
    Nov 12, 2009
    Posts:
    101
    Thank you so much Adriano

    Your workaround worked fine !!
     
    AdrianoVerona_Unity likes this.
  3. lasco

    lasco

    Joined:
    Nov 12, 2009
    Posts:
    101
    I'm really impressed. The converter worked pretty well, my js are all replaced by cs and even floating values are kept.

    Very good job !! Thanks !!
     
    AdrianoVerona_Unity likes this.
  4. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    Hi Guys,
    I've just bumped into a project that uses boo, will this converter also support that?

    Cheers,

    Stefan
     
  5. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi, sorry, not without changes.

    That being said, depending on the amount of Boo code you have it may worth giving it a try. Basically you'd need to replace the UnityScript compiler with the Boo compiler. Since UnityScript compiler is based on the Boo compiler it may work with some changes.

    Adriano
     
  6. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    Cool, I was hoping that it would be something along those lines. I'll review the codebase a little further to see if it's reasonably straight forward to do a manual conversion.

    Thanks for your quick reply!

    Stefan
     
  7. powpowbing

    powpowbing

    Joined:
    Mar 15, 2017
    Posts:
    3
    Hi,I have a problem for this tool on here.
    Can anybody help me?

    Thanks!
     
  8. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi @powpowbing

    In your post you sad that "But soon, the problem arose:" ; That is odd.

    Basically that message means the converter was running for more than 1 minute.

    Can you replace UnityScript2CSharp\Editor\UnityScript2CSharpRunner.cs (after importer the converter to your project) with this one?

    Basically it increases the time limit in line 193 (changing it from 60000 to 300000; this represents the amount of time, in ms, that we wait for the converter to finish; after that time we deem the process as being locked and kill it).

    If it still fails please send me your Editor.log

    Adriano
     
  9. powpowbing

    powpowbing

    Joined:
    Mar 15, 2017
    Posts:
    3
    Hi Adriano,
    When I replaced your updated script with the original script and ran it again, the whole transformation process went smoothly and I finally got the C# script I wanted.
    That's great!
    Thank you very much!
    powpowping
     
    AdrianoVerona_Unity likes this.
  10. RHare

    RHare

    Joined:
    Nov 20, 2018
    Posts:
    2
    Hello,
    I've been trying to convert a project with this program. The project seems to work fine and builds successfully, but when I try to convert it, I run into this error. I've tried running it within Unity and via the command line:

    Code (CSharp):
    1. UnityScript2CSharp was not able to convert your project:.
    2.  
    3. UnityScript2CSharp 1.0.7095.26335
    4. Converting 'Runtime' (126 scripts)
    5. Object reference not set to an instance of an object
    6. Consider running converter with '-i' option.
    7.  
    8. UnityEngine.Debug:LogError(Object)
    9. UnityScript2CSharpRunner:ShowConversionResultsInConsole(Int32) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:236)
    10. UnityScript2CSharpRunner:RunConverter(String) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:215)
    11. UnityScript2CSharpRunner:Convert() (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:97)
    This may be an issue within the project itself, as I'm not too familiar with the project. I tried running it in unity 2017.4.30f1 and ran into the same error.

    I've attached the full editor.log file as well as the generated response file.
     

    Attached Files:

  11. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi. Based on your Editor.log the converter is hitting some issue while trying to collect information about the comments in your sources:

    You may try to change the integration code to add an extra command line argument (--SkipComments) to tell the converter to not try to preserve comments.

    Adriano
     
  12. RHare

    RHare

    Joined:
    Nov 20, 2018
    Posts:
    2
    Hi Adriano,

    That seems to have fixed the issue. Thanks!
     
    AdrianoVerona_Unity likes this.
  13. dadyjoon

    dadyjoon

    Joined:
    Jul 14, 2019
    Posts:
    1
    Hi Adriano
    is there any for 2019.1 version of unity?
     
  14. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Unfortunately no. We have removed UnityScript support completely in 2018.2.

    That being said, you may try running it from command line (as explained in the readme file: https://github.com/Unity-Technologies/unityscript2csharp/blob/master/readme.md) and pass the path of Unity 2019 installation, but there's no guarantee it will work.

    Adriano
     
  15. raptgamesstudio

    raptgamesstudio

    Joined:
    Sep 3, 2019
    Posts:
    8
    when i click on convert, following error occur. unity version is 2018.1.0f2.

    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Compilation.Assembly.<get_allReferences>m__0 (UnityEditor.Compilation.Assembly a) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationPipeline.cs:44)
    System.Linq.Enumerable+<CreateSelectIterator>c__Iterator10`2[UnityEditor.Compilation.Assembly,System.String].MoveNext ()
    System.Linq.Enumerable+<CreateConcatIterator>c__Iterator1`1[System.String].MoveNext ()
    System.Collections.Generic.List`1[System.String].AddEnumerable (IEnumerable`1 enumerable) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:128)
    System.Collections.Generic.List`1[System.String]..ctor (IEnumerable`1 collection) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:65)
    System.Linq.Enumerable.ToArray[String] (IEnumerable`1 source)
    UnityEditor.Compilation.Assembly.get_allReferences () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationPipeline.cs:44)
    UnityScript2CSharpRunner.ReferencesFromAssembly (UnityEditor.Compilation.Assembly a) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:294)
    System.Linq.Enumerable+<CreateSelectManyIterator>c__Iterator12`2[UnityEditor.Compilation.Assembly,System.String].MoveNext ()
    System.Linq.Enumerable+<CreateWhereIterator>c__Iterator1D`1[System.String].MoveNext ()
    System.Linq.Enumerable+<CreateDistinctIterator>c__Iterator3`1[System.String].MoveNext ()
    UnityScript2CSharpRunner.ComputeConverterCommandLineArguments (Boolean verboseLogging) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:268)
    UnityScript2CSharpRunner.RunConverter (System.String converterPath) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:180)
    UnityScript2CSharpRunner.Convert () (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:97)
     
  16. Xeledus

    Xeledus

    Joined:
    Jul 30, 2012
    Posts:
    6
    I know I'm pretty late to the party here, but I tried to start up my project after a hiatus and found out unityscipt is dead.

    So when I try to convert using the integrated tool, I'm getting an error.

    NullReferenceException: Object reference not set to an instance of an object.

    ... I tried downloading older versions of it and it tells me:

    UnityScript2CSharp was not able to convert your project:.

    I'm kind of at a loss at where to go from here. I dont really understand how to use the command line .exe.
     
  17. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    I remember seeing one issue related to this but AFAIR I've fixed it (relates to this MR: https://github.com/Unity-Technologies/unityscript2csharp/pull/45/files)

    Can you share your fulll Editor.log ?

    Adriano
     
  18. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi Xeledus. When reporting issues (in any product) try to add as much useful information as possible. In this specific case:

    - Version of Unity
    - Version of the converter
    - Your Editor.log
    - The log file generated by the converter.

    You can either post here or share it directly with me (adriano @ you know the rest) :)

    Best
    Adriano
     
  19. Xeledus

    Xeledus

    Joined:
    Jul 30, 2012
    Posts:
    6
    Thanks for taking the time. I'm using 2018.1.0f2. First I tried UnityScript2CSharp_Conversion_1.0.7095.26335. That got me this in the console:
    I then tried Conversion_1.0.6834.38141, and that got me this in the console:

    I'm attaching the editor logs for both. I really appreciate the help.
     

    Attached Files:

  20. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Thanks for sharing your logs but I am not able to find anything that could point to the problem. If you can share your project I can try to debug to figure out what is the problem.

    Adriano
     
  21. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    @raptgamesstudio,

    I've just published a new version of the converter. Can you try it with Unity 2018.1.9 (newest 2018.1 series) ?

    Best

    Adriano
     
  22. marcusfehse

    marcusfehse

    Joined:
    Sep 19, 2013
    Posts:
    1
    well. totally unexpected running into this. 5.6.6 didn't start properly. 2017.4 loaded my old project (5.4.something) with an empty compelling error. unable to load your unityscript2csharp converter. stuck! after a while I got it: no unity script with catalina! okay. i had to find out how to get and install mojave on a virtual machine. installed 5.6.7 and imported my scene - no fixes needed. installed 2018.1 than and imported my scene saved with 5.6.7 - still no fixes needed. loaded your unityscript2csharp converter - latest version. fine.

    but first I had to fix some permissions like mentioned here. no big deal.

    than I ran into the same "The version of Unity passed as the Unity Editor path is too old." problem lasco described in june last year. even with the actual version of the converter. but ...

    the workaround worked for me too! at the end i'm in 2019.2 on catalina with my old project. there are some smaller fixes to do. but the app is running and i can investigate now how chaotic my scripting was six years ago =;°0 ... and i have to thank you so much for the work you have done, adriano. it took me some time to investigate and find a way that worked but this is nothing compared to rewrite all that code (and understand the crude logic behind what me and my scripting partner at this time have done long time before). could be easier off course. but saved my time at the end. thanx.
     
    AdrianoVerona_Unity and superpig like this.
  23. Eco-Editor

    Eco-Editor

    Joined:
    Jun 29, 2016
    Posts:
    71
    Got this error in my Unity 2018.1.2 project:
    Any idea what might cause it?


    NullReferenceException: Object reference not set to an instance of an object
    UnityEditor.Compilation.Assembly.<get_allReferences>m__0 (UnityEditor.Compilation.Assembly a) (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationPipeline.cs:44)
    System.Linq.Enumerable+SelectArrayIterator`2[TSource,TResult].MoveNext () (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    System.Collections.Generic.EnumerableHelpers.IterativeCopy[T] (System.Collections.Generic.IEnumerable`1[T] source, T[] array, System.Int32 arrayIndex, System.Int32 count) (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    System.Collections.Generic.EnumerableHelpers.Copy[T] (System.Collections.Generic.IEnumerable`1[T] source, T[] array, System.Int32 arrayIndex, System.Int32 count) (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    System.Linq.Enumerable+Concat2Iterator`1[TSource].ToArray () (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    System.Linq.Enumerable.ToArray[TSource] (System.Collections.Generic.IEnumerable`1[T] source) (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    UnityEditor.Compilation.Assembly.get_allReferences () (at C:/buildslave/unity/build/Editor/Mono/Scripting/ScriptCompilation/CompilationPipeline.cs:44)
    UnityScript2CSharpRunner.ReferencesFromAssembly (UnityEditor.Compilation.Assembly a) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:294)
    System.Linq.Enumerable+SelectManySingleSelectorIterator`2[TSource,TResult].MoveNext () (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    System.Linq.Enumerable+WhereEnumerableIterator`1[TSource].MoveNext () (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    System.Linq.Enumerable+DistinctIterator`1[TSource].MoveNext () (at <839a3cb835c04d14aeb58d83bb7bc4bd>:0)
    UnityScript2CSharpRunner.ComputeConverterCommandLineArguments (System.Boolean verboseLogging) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:268)
    UnityScript2CSharpRunner.RunConverter (System.String converterPath) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:180)
    UnityScript2CSharpRunner.Convert () (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:97)
     
  24. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi

    Can you try the latest 2018.1 version? (as of today 2018.1.9) ?
     
  25. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    that is weird. You may have hit some other related issue.

    Thanks for the report; I am sorry for the trouble though.
     
  26. Eco-Editor

    Eco-Editor

    Joined:
    Jun 29, 2016
    Posts:
    71
    Hello Adriano,
    I've tried with the lastest 2018.1.9 and the error disappeared. Now I have another errors: "Ambiguous reference"
    - I've tried to solve it by including at the beginning of the script "import UnityEngine" but it still gives me the error.
    The ambiguous reference include the following:
    Vecotr3,
    Range,
    SpringJoint,
    Camera,
    AudioClip,
    AudioSource,
    Material,
    RigidBody,
    Collider

    basically all UnityEngine related items
    How would you solve that?

    Thank you
     
  27. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi. Looks like we are adding same assembly multiple times.

    Can you run the converter with verbose logging and share your Editor.log ?
     
  28. Eco-Editor

    Eco-Editor

    Joined:
    Jun 29, 2016
    Posts:
    71
    Hi Adriano,
    when I use once script at a time in the 2018.1.9 project the converter is working.
    The issue starts when using multiple scripts at once.
    This is the Editor log after running the converter with verbose logging:

    UnityScript2CSharp was not able to convert your project:.
    [UPDATE] will add a full log file.
     
    Last edited: Jan 26, 2020
  29. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    That is odd.

    Unfortunately the parts of the log you've shared is not enough for me to try to figure out what is happening. Can you share the full Editor.log? (you can upload the file in the forum or send ti direct to me)

    Thanks
     
  30. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi, have you seem my last message? I'll quote it bellow:

     
  31. Eco-Editor

    Eco-Editor

    Joined:
    Jun 29, 2016
    Posts:
    71
    Hi Adriano,
    Yes, I saw this message, currently working on something else. Will send the Editor.Log file when back on that project.
     
    AdrianoVerona_Unity likes this.
  32. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    Hello Adriano, I am attempting to update an old project with many js scripts. I'm on macOS Catalina using 2018.1.9f2.
    Attached is my log file.

    I am receiving this error:
    UnityScript2CSharp was not able to convert your project:.

    Converting 'Runtime' (189 scripts)
    Object reference not set to an instance of an object
    Consider running converter with '-i' option.

    UnityEngine.Debug:LogError(Object)
    UnityScript2CSharpRunner:ShowConversionResultsInConsole(Int32) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:236)
    UnityScript2CSharpRunner:RunConverter(String) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:215)
    UnityScript2CSharpRunner:Convert() (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:97)


    Thank you for any help you may have and stay healthy!
     

    Attached Files:

  33. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi

    Can you try again but this time enabling Verbose Logging?


    you are welcome. I wish you the same!
     
    smetzzz likes this.
  34. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    Thank You!

    Here is the Verbose Logging file. I am using the latest version of the conversion tool.

    How do I select the '-i' option?

    Let me know if you need anything else. Thank You. Glad you are healthy. :)
     

    Attached Files:

    Last edited: Apr 1, 2020
  35. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    Ok, I attempted to run the conversion tool on my Windows machine. Still no luck. Here is the verbose editor log.
     

    Attached Files:

  36. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    The converter is crashing while trying to preserve comments.

    One workaround that may work is to pass --SkipComments to the converter.

    Sadly we never added this option to the Editor integration, so what you can do is:
    1. Backup your project
    2. Install latest converter package
    3. Open file UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs
    4. Change line 279 (method ) and append --SkipComments to the command line arguments.
    The code will looks like:

    Code (CSharp):
    1.  
    2. var args = "--responseFile " +   Quote(responseFilePath)
    3.                     + " -p " + Quote(projectPath)
    4.                     + " -u " + Quote(unityInstallPath)
    5.                     + " --SkipComments"
    6.                     + " --outputFile " + Quote(GetLogFileNameForProject());
    7.  
    Keep in mind that this will cause all comments from your UnityScript code to not be copied over to the new C#.

    If that is not acceptable I can debug to understand what is going on (after you confirm that the converter finishes successfully and share your project with me)

    Wrt your question about -i command line argument, it is only accessibly through the command line tool (but you can use the same trick listed above to pass it).

    Adriano
     
  37. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    I don't need comments.
    I tried the suggestion but the tool still quits right after it begins. Now it doesn't give me an error in the console.
     

    Attached Files:

  38. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    That is weird. Can you confirm that the file specified in the outputFile command line argument (from your log --outputFile "C:\Users\gsmet\AppData\Local\Temp\US2CS_FLEWNCONVERT.log") is empty? If it is not, can you post it here?

    Adriano
     
  39. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    This is what I found.
     

    Attached Files:

  40. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    This is odd. It looks like the converter did not even had a chance to start.

    Can you share your project with me? If so, you can run this bat file to remove all non essential assets
    (of course, before running the bat you should make sure you have made a backup)

    https://gist.github.com/adrianoc/9c94301fe772deea16e844ef4549ce49

    Adriano
     
  41. smetzzz

    smetzzz

    Joined:
    Mar 24, 2014
    Posts:
    145
    Hi Adriano, Thanks for your suggestions. I was finally able to make it work by removing a few lines of offending js code - exporting the entire project as a package, then importing package into a clean new project. I converted it now. Thank you for the help.
    -Smetz
     
    AdrianoVerona_Unity likes this.
  42. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hey, happy to learn you figured it out. Do you mind sharing more details? like which kind of syntax was causing issues? (if possible a small example/piece of your script). This may help others (also I may investigate it later if someone else reports similar issues)

    Best
     
  43. DeXoN

    DeXoN

    Joined:
    Feb 10, 2013
    Posts:
    30
    Hi,

    I tried installing it on a fresh version of Unity 2018.1.9, but I don't see it show up anywhere in the menu. What am I missing?

    I'm running MacOSX 10.13.6 with Unity Hub and the latest Unity 2019 + visual Studio.

    This is needed to upgrade an old game that was created in a perpetual licensed Unity 4.

    Thanks
    Will
     
  44. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    In theory (after installing the unitypackage) you should see a new menu entry under Tools/Convert Project from UnityScript to C#.

    Can you share Editor.log so I can try to spot any potential issues ?
     
  45. DeXoN

    DeXoN

    Joined:
    Feb 10, 2013
    Posts:
    30
    Hi, Adriano

    Nothing showed up in the console when I tried installing the package. (Where is that file? Please tell me where to look for it, because I found nothing relevant when searching for 'Editor.log' in the project folder and in the ~/Library folder.)

    In the meantime I created an empty new project and tried installing the tool. This worked - so Tools showed up. I then tried pushing only some of my .js scripts into that project and tried to convert - this produces errors - so I assume the tool doesn't operate on scripts by themselves?

    Here's the error, which seems to want a dll file:

    UnityScript2CSharp was not able to convert your project:.

    Cannot find referenced assembly: Library/ScriptAssemblies/Assembly-UnityScript.dll

    UnityEngine.Debug:LogError(Object)
    UnityScript2CSharpRunner:ShowConversionResultsInConsole(Int32) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:236)
    UnityScript2CSharpRunner:RunConverter(String) (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:215)
    UnityScript2CSharpRunner:Convert() (at Assets/UnityScript2CSharp/Editor/UnityScript2CSharpRunner.cs:97)​

    Also, I quit Unity 2018 and started it again. The 'Tools' menu item is missing again. Deleting the Package and reimporting it doesn't solve the issue.

    Will
     
    Last edited: May 13, 2020
  46. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    See https://docs.unity3d.com/Manual/LogFiles.html

    Please share the whole file.

    It looks like your project is not compiling? Are you getting compilation errors? That would explain why you are not able to find the menu entry.

    Adriano
     
  47. DeXoN

    DeXoN

    Joined:
    Feb 10, 2013
    Posts:
    30
    Adriano, I started a conversation with you and uploaded the file there.
     
  48. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    I just found this thread, so I'm sorry about the duplicate post elsewhere.

    I just updated some old UnityScript projects to Unity 2018.2.21f1, the last Unity version to support US. I did this in preparation for converting the US projects to C#. I was thinking they should be updated to the latest version that supports US. But when I imported the conversion package, UnityScript2CSharp_Conversion_1.0.7264.28836 (https://blogs.unity3d.com/2019/01/08/unityscript-to-c-conversion-tool/), it tells me I have to be running 2018.1, the last Unity version (it says) that supports US. I tried opening one of the projects in 2018.1, but it doesn't look like that's going to work, the 2018.2 project does not import correctly in 2018.2 (a bit surprising).

    If I run the conversion in 2018.2, it says "UnityScript2CSharp was not able to convert your project," and gives a long list of Unity files. Is there a newer version of the conversion utility that works in 2018.2? Or can the existing scripts be updated?

    One thing I tried is changing a line in the conversion script from 2018_2 to 2018_3, but still got the same result, not able to convert the project, no other errors, just a list of files:
    Code (CSharp):
    1. #if UNITY_2018_3_OR_NEWER
    2.         EditorUtility.DisplayDialog(Title, string.Format("You are using Unity version {0}.\r\n\r\nThis verion of Unity does not support UnityScript. Use versions 2017.3 ~ 2018.1", Application.unityVersion), "Ok");
    3.         return;
    4. #endif
    I can't find any other mention of a 2018 version in the scripts, though there are several checks for UNITY_2017_3_OR_NEWER. I don't know what else in the scripts need to be changed.

    This is kind of a big deal to me, as I just spent months updating 61 projects that have not been updated since Unity 5.x (a few in 2017.x). I got them all up and running in 2018.2, and now I'm stuck. It looks like I can't open 2018.2 projects in 2018.1, and I can't run the conversion tool in 2018.2.

    If there's not an updated version of the conversion tool or a way to make it work, is there a way to downgrade my projects to get them to open in 2018.1? Surely there must be a solution. I've invested way too much time in this effort to hit a dead end at this point.
     
  49. AdrianoVerona_Unity

    AdrianoVerona_Unity

    Unity Technologies

    Joined:
    Apr 11, 2013
    Posts:
    317
    Hi

    Can you run the tool (in 2018.2) with verbose logging enabled and send me both your Editor.log and US2CS_*.log (the latter can be found in your Windows temp folder)?

    AFAICT, officially we dropped US support in 2018.1 (even though you would be able to compile US code in 18.2) but since we do compile US code in 2018.2 it may be possible to run it (depending on what is failing)

    That being said, I'll try to help you but keep in mind that, even if you manage to run the tool successfully, it will not be able to convert 100% of your projects. Mileage will vary depending on the complexity of the code and features used.

    The tool you are referring to is simply a front end for a console program that does the actual conversion.
    In theory, you should be able to use the command-line tool with any project.

    Adriano
     
  50. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    I sent you the Editor.Log contents in a private message. Couldn't find the US2CS_*.log file.
     
    AdrianoVerona_Unity likes this.