Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Using Unity with Sublime Text 2 (How to get everything set up)

Discussion in 'Scripting' started by JacobPennock, Mar 19, 2012.

  1. bitomule

    bitomule

    Joined:
    Oct 27, 2008
    Posts:
    173
    Perfect Izitmee, thanks!

    Just one more question. Is it compatible with Sublime Text 3?
     
  2. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    I have no idea: still on Sublime 2 :B
     
  3. petey

    petey

    Joined:
    May 20, 2009
    Posts:
    1,817
    Sublime 3 (beta) is a nice step up. For starters it jumps to the correct line number from unity.
    I haven't been able to get package control running though. Might have another try today.
     
  4. Kaji-Atsushi

    Kaji-Atsushi

    Joined:
    Oct 6, 2012
    Posts:
    234
    Does any of the new features in Sublime Text 3 make it easier to integrate with Unity? I've been holding off on trying to setup Sublime Text for my development till a solid setup solution came along.

    Thanks for any info on this!
     
  5. fgielow

    fgielow

    Joined:
    Jan 3, 2012
    Posts:
    122
    I have been using ST3 with unity3d for a while already, it integrates well.
    ST2 already integrated well, except for jumping for error line, which now works alright with ST3 too.

    ST3 is now on open beta, you can give it a try and check for yourself \o/
     
  6. CoastKid

    CoastKid

    Joined:
    Jan 8, 2013
    Posts:
    64
    Does the integration setup of ST3 goes the same way as ST2?
     
  7. fgielow

    fgielow

    Joined:
    Jan 3, 2012
    Posts:
    122
    Almost! One step which is essential for me involves the completesharp plugin, as I develop with C#, and the main repository for completesharp has been discontinued. I suppose the last version present on the repository does not work for me anymore. But I think I have uploaded the version of completesharp which I use, here on this same thread, some posts ago.

    Apart from that issue (which would relate to ST2 as well), everything remains the same, it really is worth the setup time. =)
     
  8. CoastKid

    CoastKid

    Joined:
    Jan 8, 2013
    Posts:
    64
    Thanks a lot for the info, I really get stuck on setup of the last version of completesharp with ST3.
    Trying to setup your version of CompleteSharp, and I have a Lame question about " $ cd CompleteSharp" and "$ python -m compileall", where I need this to run? I've tried in command prompt and in ST3 console, but it does not run. Do I need some kind of python package or something like that?
     
  9. fgielow

    fgielow

    Joined:
    Jan 3, 2012
    Posts:
    122
    that command is just compiling the .py source codes to .pyc compiled scripts. It was intended to be run on Linux or OSX (I use OSX here), I dunno how it should work on windows though. But on UNIX based systems, you should navigate to the folder of the completesharp extension on the terminal, and run "python -m compileall ." inside that folder to compile everything there. What happened there?
     
  10. CoastKid

    CoastKid

    Joined:
    Jan 8, 2013
    Posts:
    64
    Thanks for the tip fgielow !
    Installed Python and then I've run "python -m compileall" from the "...\Packages\CompleteSharp" folder, and now it works just perfect!
     
  11. aikitect

    aikitect

    Joined:
    Dec 28, 2012
    Posts:
    28
    Are we supposed to modify the CompleteSharp settings file to add the CompleteSharp assemblies, or are we supposed to modify the sublime-project file?
     
  12. fgielow

    fgielow

    Joined:
    Jan 3, 2012
    Posts:
    122
    Just change the sublime-project, as in:


    {
    "folders":
    [
    {
    "path": "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop"
    }
    ],
    "settings":
    {
    "completesharp_assemblies":
    [
    "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/UnityScript.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.Core.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/nunit.framework.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/Library/ScriptAssemblies/Assembly-CSharp.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/Library/ScriptAssemblies/Assembly-UnityScript-Editor.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/./Assets/Rotorz/Tile System/Editor/TileSystem.Editor.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/./Assets/Rotorz/Tile System/TileSystem.Runtime.dll",
    "/Users/fgielow/Dropbox/Anesthetize/Jogos/TCC/Jotun/UNITY3d/jotun-experiments-Drop/./Assets/TK2DROOT/tk2d/Editor/tk2dExternal.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/mscorlib.dll"
    ]
    }
    }
     
  13. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    I'm using Sublime Text 3 and I can't get the build system to work... I get this error on the console:

    Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly '/Users/xxxxx/Library/Application Support/Sublime Text 3/Packages/Unity3D Build System/SublimeLogger.dll' or one of its dependencies. The system cannot find the file specified.
    File name: '/Users/xxxxx/Library/Application Support/Sublime Text 3/Packages/Unity3D Build System/SublimeLogger.dll'
    at (wrapper managed-to-native) System.Reflection.Assembly:LoadFrom (string,bool)
    at System.Reflection.Assembly.LoadFrom (System.String assemblyFile) [0x00000] in <filename unknown>:0
    at Mono.XBuild.CommandLine.MainClass.Execute () [0x00000] in <filename unknown>:0
    at Mono.XBuild.CommandLine.MainClass.Main (System.String[] args) [0x00000] in <filename unknown>:0

    Any idea how to solve this? Can't find anything about that SublimeLogger or how to install it...
     
  14. Imawizrd

    Imawizrd

    Joined:
    Jan 19, 2013
    Posts:
    20
    Hey guys!

    I downloaded and set up ST3 and the package controller today. I installed all of the unity packages and CompleteSharp.

    Is there anything else I need before I start developing with ST3?

    Thanks!

    [edit]
    Hmm ST3 isn't jumping to the correct line when I have an error. I must of done something wrong.
     
    Last edited: Jul 15, 2013
  15. aikitect

    aikitect

    Joined:
    Dec 28, 2012
    Posts:
    28
    Every time I try to auto-complete, I get this error:

    stderr: b'Loading: /Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll'
    stderr: b"Exception: Could not load file or assembly 'UnityEngine, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."

    I also get it for every single other .dll in the settings folder.

    Here is my CompleteSharp settings for reference.

    {
    "folders":
    [
    {
    "path": "/Users/Dennis/Dev/Easy-Eater/iPhone"
    }
    ],

    "settings":
    {
    "completesharp_assemblies":
    [
    "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/UnityScript.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.Core.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/System.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/nunit.framework.dll",
    "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/mscorlib.dll",

    "/Users/Dennis/Dev/Easy-Eater/iPhone/Library/ScriptAssemblies/Assembly-CSharp.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Library/ScriptAssemblies/Assembly-UnityScript-Editor.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll",

    "/Users/Dennis/Dev/Easy-Eater/iPhone/Assets/EasyEater/Libraries/Model.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Assets/TK2DROOT/tk2d/Editor/tk2dExternal.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Assets/HOTween/Plugins/HOTween.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Assets/SiaqodbPackage/Plugins/siaqodb.dll",
    "/Users/Dennis/Dev/Easy-Eater/iPhone/Assets/PlayerIO/PlayerIOUnity3DClient.dll"
    ]
    }
    }

    Any ideas?
     
  16. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    938
    Try to add this to your settings:

    "completesharp_mono_path":"/Applications/Unity/MonoDevelop.app/Contents/Frameworks/Mono.framework/Versions/Current/bin/mono"
     
  17. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    I'm very interested in ST3 for unity and wondering if anyone has managed to get it totally working.

    Thanks.
     
  18. Ben Blaut

    Ben Blaut

    Joined:
    May 15, 2012
    Posts:
    27
    Anyone have breakpoints working with ST2 or ST3?
     
  19. cjow

    cjow

    Joined:
    Feb 29, 2012
    Posts:
    132
    Can't get the build system to work on Windows at all with ST2 and Unity 4.2. Just getting [Decode error - output not utf-8] every time. If I point it to Mono 2.6.5 it fails to compile and says it can't find any of the project source files. If I point it to Mono 2.10.2 it says it compiles but it still says non of the files could be found.

    I'm stumped. Any suggestions?
     
  20. Paul-Schulze

    Paul-Schulze

    Joined:
    Apr 27, 2013
    Posts:
    8
    I am guessing you mean the "Advanced Build System", as that error sounds vaguely familiar to me. The command processor requires input to be encoded using UTF-8, so this may depend on your Windows localization settings or it's just broken in the version you got. I may have fixed that one though, when I made the plugin ST3 compatible last week. The changes are on github now, as well as some other fixes. As I previously stated, I have only extensively used this on Mac. From what a very short test and a few fast and dirty fixes showed me just now, there may be some more issues on windows as well. But since my time is up for fiddling around with this for now, maybe someone else wants to try make it work on windows. Here are the problems, I've discovered:

    - The build solution phase still reports an [Decode error - output not utf-8] in the first line of its output. My first thought was to just disable this completely.
    - The version of XBuild, included with Unity3D is very old. It doesn't seem to handle project dependancies very well. MDTool would be an option, but it wraps lines that are more than 80 characters wide, which would mean quite a bit of extra work piecing the correct ones together again. The original mdtool config is still there, so in case I missed a command-line option to make it work, you can easily add that in AdvancedBuilder.sublime-settings.
    - Jumping to an error does not work correctly. Whether or not it is working depends on the folder setup, but I haven't found the edge cases. This is most likely related to the working_dir variable, supplied to the command processor or the encoding of the paths.
    - The included StyleCop.exe does not seem to be working correctly right now. Even with obvious errors, it does not report anything, so it is probably not finding its files.
    - The copy command seems to be set up wrong.
     
  21. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    @Paul,

    You seem to be quite knowledgeable. Can you help with some info on how to setup ST3 on a Mac for unity.
    Any hints is greatly appreciated because mono-develop slow start-up and constant crashes is really making development very difficult.

    btw, where are the git links to the "Advanced Build System" that you mentioned above.

    Cheers.
     
  22. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    I got ST3 working on the Mac. Actually not so hard at all.

    Basically, the only difference from the Video Tutorial in this post is getting the Package Control for ST3.

    1. Download and install ST3 on your mac.


    2. Get the Package Control from Git.
    Follow the instructions below.
    http://wbond.net/sublime_packages/package_control/installation#ST3


    [h=4]Git Install[/h]Since Sublime Text 3 no longer extracts the contents of .sublime-package files by default, and the fact that Package Control needs to read CA cert files from disk for SSL certificate verification, the only viable install method right now is via Git.Please note, the Packages/ folder listed below refers to the folder that opens when you use the Preferences > Browse Packages…menu.
    cd Packages/
    git clone https://github.com/wbond/sublime_package_control.git "Package Control"
    cd "Package Control"
    git checkout python3



    3. Install the Unity packages from the Video.

    4. Tell Unity to use Sublime as the default Editor.
    Preferences > External Tools > External Script Editor > SublimeText.app

    5. When you click on a unity script in the Editor
    , then ST3 automatically loads the script.

    Thanks for making the unity packages. Thanks god I don't have touch mono-develop anymore.
     
  23. Paul-Schulze

    Paul-Schulze

    Joined:
    Apr 27, 2013
    Posts:
    8
    To be frank, I don't recommend using ST3 to anyone not being able to get this stuff working himself. It can be a really tricky thing, because of the switch from python version 2 to version 3. Some of the really good plugins still aren't adjusted to the changes in syntax and API. This goes especially for Package Control, which does not seem to work properly, making it unnecessarily hard to get some of the good plugins.

    But if you really want to try, do roughly the following:
    1) Install ST2 and Package Control
    2) Install the "C#", "Unity3D", "Unity3D ShaderLab" and "Unity3D Snippets and Completes" packages in ST2 using Package Control. You may be able to get those from GitHub too, but I found it easier using the ST2 versions until Package Control works properly.
    3) Go to "~/Library/Application Support/Sublime Text 2/Packages" in Finder and copy the directories named after the plugins in (2) to"~/Library/Application Support/Sublime Text 3/Packages". You may have to create the "Packages" folder before copying the directories there.
    4) Check out https://github.com/quarnster/CompleteSharp to "~/Library/Application Support/Sublime Text 3/Packages" using the GitHub application.
    5) Install Mono from http://www.go-mono.com/mono-downloads/download.html. You may also be able to use the version of Mono, shipping with Unity, you would need to modify the CompleteSharp.sublime-settings file, but since I had it installed, I can't tell you how.
    6) Add your assembly paths to your project file like this:
    Code (csharp):
    1.  
    2. {
    3.     "folders": [
    4.         {
    5.             "path": "<your project name>/Assets"
    6.         }
    7.     ], // <-- this comma is important!
    8.  
    9.     "settings": {
    10.         "completesharp_assemblies": [
    11.             "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll",
    12.             "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll",
    13.             <absolute path to your "Assembly-CSharp.dll">,
    14.             <absolute path to your "Assembly-UnityScript.dll">,
    15.             <absolute path to your "Assembly-CSharp-Editor.dll">
    16.         ]
    17.     }
    18. }
    19.  
    8) Set Sublime Text 3 as your editor in Unity, if you haven't done so yet.
    9) Double-click a .cs file to open it.
    10) Check code completion. If it doesn't work, open the ST3 console, check for errors and fix them.

    This should give you an editor with jump-to-file, jump-to-line support, syntax highlighting and code completion.

    If you are really brave now, you can try the "Advanced Build System". Note though, that it is not well tested and usually goes beyond the scope of what you need to build a unity project in ST3. I mainly use it for projects that contain multiple solutions, as it lets me add build phases that copy DLLs around and run StyleCop while automatically updating the referenced DLLs. Here is roughly what you need to do to build a simple Unity project:
    11) Clone https://github.com/ranthor/sublime-advanced-builder to "~/Library/Application Support/Sublime Text 3/Packages" using the GitHub application.
    12) Check the "~/Library/Application Support/Sublime Text 3/Packages/Advanced Build System/AdvancedBuilder.sublime-settings" file for adjustments to paths and stuff. The "osx" section should be what you want to look at. It contains aliases to commands, used in all the build phases, including the "command" phase.
    13) Add a unity build phase to the settings, so they look something like this:
    Code (csharp):
    1.  
    2. {
    3.     "folders": [
    4.         {
    5.             "path": "<your project name>/Assets"
    6.         }
    7.     ], // <-- this comma is important!
    8.  
    9.     "settings": {
    10.         "completesharp_assemblies": [
    11.             "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEditor.dll",
    12.             "/Applications/Unity/Unity.app/Contents/Frameworks/Managed/UnityEngine.dll",
    13.             <absolute path to your "Assembly-CSharp.dll">,
    14.             <absolute path to your "Assembly-UnityScript.dll">,
    15.             <absolute path to your "Assembly-CSharp-Editor.dll">
    16.         ], // <-- and again, important comma here!
    17.  
    18.         "advanced_build_phases": [
    19.             {
    20.                 "type": "unity",
    21.                 "name": "<some name for the build phase>",
    22.                 "solution": "${project_path}/<your project name>/<your project name>.sln"
    23.             }
    24.         ]
    25.     }
    26. }
    27.  
    14) Check, that you actually have the specified solution in your Unity project folder. If not, switch your editor to MonoDevelop, in Unity and double-click a .cs file. This will create the solution. You can close MonoDevelop now and switch your editor back to ST3.
    15) In ST3, select "AdvancedBuilder [DEBUG]" from the "Tools/Build Systems" menu.
    16) Select "Tools/Build" and hope for the best.
    17) Check console output for errors, if it doesn't seem to be working correctly.

    The build system still has issues finding the project file though. In ST3, it got a lot more clever about it, but as ST3 still does not directly expose the "project_path" variable, it is still a bit shaky. You can do yourself a big favour by not changing the "working_dir" variable in the build system definition though. I have tested this with my default directory setup, which looks like this:
    Code (csharp):
    1.  
    2. MyProjectFolder
    3.   |- MyProject.sublime-project
    4.   |- MyProject.sublime-workspace
    5.   \- MyCompany.MyProject
    6.        |- Assets
    7.        |- Library
    8.        \- MyCompany.MyProject.sln
    9.  
    Phu, what a novel... Have fun.
     
  24. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Wow, a very complete and extensive answer... Definitely Novel size.

    These are great tips !!

    I didn't know how to use the build system. It seems quite comprehensive and very capable.
    I'll definitely try it out.

    Thanks again for sharing.
     
  25. EmeralLotus

    EmeralLotus

    Joined:
    Aug 10, 2012
    Posts:
    1,459
    Does anyone know how to do the following:

    When I click on a script, a new ST window launches. Is there a way to make it launch into a New Tab instead of creating a new window everytime?



    P.S. ST3 goes straight to the line when clicking one of the trace outputs within the unity console. Very Nice. Also, ST is lightning compared to Mono-Dev. Hurray for ST and for Productivity.

    Thanks.
     
  26. XiaoJi

    XiaoJi

    Joined:
    Jul 5, 2013
    Posts:
    15
    hi
    I have an error "absolute is The assembly mscorlib.dll was not found or could not be loaded",
    but there already has "/Applications/Unity/Unity.app/Contents/Frameworks/Mono/lib/mono/unity/mscorlib.dll" in my project setting.
    does anyone can help me ?
     
  27. cjow

    cjow

    Joined:
    Feb 29, 2012
    Posts:
    132
    Completely given up with trying to make any build system or CompleteSharp work on Windows.

    All I get from CompleteSharp is:

    Code (csharp):
    1. stderr: 'CompleteSharp.exe' is not recognized as an internal or external command,
    2. stderr: operable program or batch file.
    3. stderr:
    4. stderr:
    5. stderr:
    6. stderr:
    7. stderr:
    8. stderr:
    9. stderr:
    10.  
    Have everything working perfectly on OS X though so it's much less effort to just switch between macbook and PC when necessary.
     
  28. Pendrokar

    Pendrokar

    Joined:
    Mar 26, 2011
    Posts:
    95
    @cjow

    I fixed that bug by using ewilde's CompleteSharp, it might occur because of NET 4. (EDIT: actually CompleteSharp.exe simply does not come precompiled in quarnster's version)
    https://github.com/ewilde/CompleteSharp

    Also to get autocomplete working correctly on Unity C# stuff, I put absolute paths to Assembly DLL's(not ${project_path}) with "//" dashes,

    This thread is quite chaotic, since many new Unity related plugins were added. These step by step tutorials should be added to the Unity Community wiki for both Windows and Mac OS.
     
    Last edited: Apr 9, 2014
  29. cjow

    cjow

    Joined:
    Feb 29, 2012
    Posts:
    132
    Thanks for the suggestion but still no joy :( Same error 'CompleteSharp.exe blah blah blah'.

    I tried it in ST2 and 3 and recompiled with python 2.7 and 3.x.
     
  30. cjow

    cjow

    Joined:
    Feb 29, 2012
    Posts:
    132
    So...

    I finally got 10 mins last night to sit down and try figure out what was going on. It turns out that the plugin was simply trying to open "C:\CompleteSharp" instead of "blah/blah/Sublime Text/Packages/CompleteSharp/CompleteSharp.exe". So problem solved; Just alter the path and recompile the python file or if you're lazy, like me, just copy the .exe into C:\ lol.

    I've not tested everything so far but it seems to be reading most assemblies I pass it OK providing that the correct dependencies are included (for example: I forgot to load a custom assembly that I use for extensions and common functionality which made all my classes in the Unity game assembly to fail). The exception so far seems to be anything in the UnityEditor namespace (I'm still have no idea why only that yet).
     
  31. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Hi guys. I wasn't really happy with the snippets provided, so I decided to write my own.

    Included there's a TemplateMonoBerhaviour that I use to replace Unity's default template, you can modify it to include whatever you like, I added some useful coroutine functions, like a coroutine tween and while with yield return null.

    Also included are most of the important Mono Override functions like Update, Start, and OnTriggerEnter. Just nice little snippets to make things faster. Finally, I also added some custom c# ones that are more similar to how I like things to be laid out. Also make sure to check out the random ones like IfGetKeyDown.

    Hope you guys enjoy them. If you have any intersting ones, please upload them too so we can all share.
     

    Attached Files:

  32. mcteapot

    mcteapot

    Joined:
    Aug 26, 2013
    Posts:
    7
    Hi pabu,

    Just going to ask again, any chance of open sourcing your little project. Don't think anything better is going to come anytime soon.
     
  33. aikitect

    aikitect

    Joined:
    Dec 28, 2012
    Posts:
    28
    Anyone else get constant freezes in ST3?
     
  34. Kovenant

    Kovenant

    Joined:
    Sep 18, 2013
    Posts:
    254
    I'm trying to install the Unity3D package.. But when I select Package Control: Install package I get an error message like this: "There are no packages available for installation".

    Can anybody help?
     
  35. Pendrokar

    Pendrokar

    Joined:
    Mar 26, 2011
    Posts:
    95
    @Kovenant,

    I can only get such error when having no channels for the downloader to go through. I did so by going to Preferences -> Package Settings -> Package Control -> Default and commenting out the only channel set on "channels".

    See if you have any channels set there. I have a channel with address "https://sublime.wbond.net/channel.json"
     
  36. Kovenant

    Kovenant

    Joined:
    Sep 18, 2013
    Posts:
    254
    I can't even edit that file at all.. :/
     
  37. Pendrokar

    Pendrokar

    Joined:
    Mar 26, 2011
    Posts:
    95
    Then either it does not exist or the Package Control does not have permissions to read it.
     
  38. Kovenant

    Kovenant

    Joined:
    Sep 18, 2013
    Posts:
    254
    When I click on Install package I get this in the console:

    Code (csharp):
    1. Exception in thread Thread-7:
    2. Traceback (most recent call last):
    3.   File "X/threading.py", line 639, in _bootstrap_inner
    4.   File "package_control.commands.install_package_command in C:\Users\kovenant\AppData\Roaming\Sublime Text 3\Installed Packages\Package Control.sublime-package", line 43, in run
    5.   File "package_control.package_installer in C:\Users\kovenant\AppData\Roaming\Sublime Text 3\Installed Packages\Package Control.sublime-package", line 54, in make_package_list
    6.   File "package_control.package_manager in C:\Users\kovenant\AppData\Roaming\Sublime Text 3\Installed Packages\Package Control.sublime-package", line 260, in list_available_packages
    7.   File "package_control.downloaders.background_downloader in C:\Users\kovenant\AppData\Roaming\Sublime Text 3\Installed Packages\Package Control.sublime-package", line 52, in get_provider
    8. KeyError: 'https://sublime.wbond.net/channel.json'
    I'm using Window 8 if that has anything to do with it.. ?
     
  39. oferei

    oferei

    Joined:
    Dec 1, 2012
    Posts:
    36
    Unity Completions - news

    Hey guys,

    I've updated my Unity Completions library to support Unity v4.3.1. And I've added it to Package Control.

    The package contains the entire API - It depends on nothing.
    And it's full: it auto-completes all classes, functions and variables, supports ST3, and works for all 3 languages. (yes, including Boo.)

    Usage

    Simply start typing any Unity term or press Ctrl+Space. You don't have to be accurate - a few consonants may be enough, preferably in the right order.

    For example, type in gbjact and you will instantly be offered completions with these letters:

    $complete-gbjact.png

    Notice the type on the right side: [var] for variables, [class] for classes or parentheses with parameter names for functions.

    Another example. Type in pscast and you will be offered:

    $complete-pscast.png

    Notice that functions may appear multiple times if they have several definitions. They can be distinguished by the parameter names. (The pop-up is too small to include the types...)

    Once you select a function completion, a full snippet will be inserted, including the parameter types, names and default values:

    $func-spherecast2.png

    You can then use Tab and Shift+Tab to quickly navigate between the parameters.

    Installation

    Using Package Control: install Unity Completions
    Read more about it: https://github.com/oferei/sublime-unity-completions
     
  40. Demigiant

    Demigiant

    Joined:
    Jan 27, 2011
    Posts:
    3,239
    That's great oferei, thanks :)
     
  41. Kristofur

    Kristofur

    Joined:
    Dec 18, 2012
    Posts:
    5
    Oferei, The installation of your package just hangs for me on both ST2 3. Other packages install fine. =(
     
  42. oferei

    oferei

    Joined:
    Dec 1, 2012
    Posts:
    36
    The package is relatively large for a ST package (26 MB). It contains the entire Unity API. Sometimes ST has a problem with that, but try again and it should work.
     
  43. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Hey oferei, thanks for the work!

    Is there anyway we could get a simpler version of the completions? I'm using CompleteSharp so I don't necessarily need the entire API to show up, the completion that would be helpful however would just be for the static classes... so for instance a completion for "GameObject", "Physics", "Mathf". That way, I can use your completions initially and then let CompleteSharp handle the rest.
     
  44. oferei

    oferei

    Joined:
    Dec 1, 2012
    Posts:
    36
    So you want GameObject.Find but you don't want GameObject.AddComponent? Is that right? You want static functions?
    I'm also guessing you'd want static variables, such as Color.black and Camera.main.
     
  45. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Not quite. I would just want "GameObject". Because CompleteSharp gives me Find and AddComponent. The thing that CompleteSharp doesn't do is initially search for all available types, so if I start typing "GameO", it won't show completions for GameObject, but once I do have it all typed out, it shows all available members for GameObject.

    Here are some screenshots to illustrate;

    $screen1-no-completion.png

    $screen2-completion.png
     
  46. oferei

    oferei

    Joined:
    Dec 1, 2012
    Posts:
    36
    I see. What about members of MonoBehaviour? For example, would it complete: Awake, Start, transform, gameObject?
     
  47. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    well, I created those myself, the topmost post I made some snippets that do that, but that might work too.
     
  48. Joseph-Ferano

    Joseph-Ferano

    Joined:
    Jul 18, 2008
    Posts:
    165
    Alright, well, I ran a script that deleted all the extra snippets and only left the objects themselves. So the only thing left to do would be to create snippets for all the important MonoBehaviour members.

    Also, here's a better tmLanguage file, I took ST3's c# file and made improvements to it, adding Unity data types as well as adding a few common .NET types. I also fixed an issue where it wasn't recognizing generic methods, so now your generic methods should appear on the symbols list.

    The current unity tm language file isn't very good, as it does a poor job representing symbols, which are now totally important with the new jump to symbol features.
     

    Attached Files:

    • $CS.zip
      File size:
      132.8 KB
      Views:
      491
  49. oferei

    oferei

    Joined:
    Dec 1, 2012
    Posts:
    36
    So, this is a manual job?
     
  50. stijnvdb88

    stijnvdb88

    Joined:
    Jan 5, 2014
    Posts:
    1
    Hi,

    for those who were struggling to get Sublime to jump to the right line on Windows, it looks like Unity has solved this from their side with the latest update (4.3). I randomly stumbled across this in the docs today and I don't think it's been mentioned here yet:

    http://docs.unity3d.com/Documentation/Manual/Preferences.html

    Notice the "External Script Editor Args" bit. A bit further down they list the right args to use for ST2 (also works with ST3 by the way).

    For people on OS X it should be even easier. According to one of the last posts here: http://sublimetext.userecho.com/top...-on-osx-to-get-unity-3d-working-with-sublime/, upgrading to Sublime Text 3 beta should get jump-to-line working for you. If you don't want to upgrade you can try this: https://github.com/thinkrad/SublimeProxy , but it will probably give errors from time to time.

    Cheers