Script Editors

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Sublime Text (OSX, Windows, Linux): More extensive steps around getting autocompletion to work.)
m (Sublime Text (OSX, Windows, Linux): WikiCode fixes)
Line 257: Line 257:
 
===C# System Type Autocompletion===
 
===C# System Type Autocompletion===
  
Install the ["CompleteSharp" https://github.com/ewilde/CompleteSharp] Sublime Text package by following the instructions on Github README. User "quarnster" was the original author of CompleteSharp, but has discontinued working on it. "ewilde" version is a bit more up to date and includes a already compiled "CompleteSharp.exe" file which the package uses, which otherwise has to be compiled using Mono(gmcs command).
+
Install the [https://github.com/ewilde/CompleteSharp "CompleteSharp"] Sublime Text package by following the instructions on Github README. User "quarnster" was the original author of CompleteSharp, but has discontinued working on it. "ewilde" version is a bit more up to date and includes a already compiled "CompleteSharp.exe" file which the package uses, which otherwise has to be compiled using Mono(gmcs command).
  
 
Add assemblies to the settings either through "Preferences" -> "Settings - User" or "Project" -> "Edit Project"(opens project settings file):
 
Add assemblies to the settings either through "Preferences" -> "Settings - User" or "Project" -> "Edit Project"(opens project settings file):
Line 285: Line 285:
 
===C# Unity API Classes Autocompletion===
 
===C# Unity API Classes Autocompletion===
  
Install [https://github.com/ewilde/CompleteSharp "CompleteSharp"], [https://github.com/oferei/sublime-unity-completions Unity Completions Package] and [https://sublime.wbond.net/packages/Unity3D%20Shader%20Highlighter%20and%20Snippets "Unity3D Snippets and Completes"] Sublime Text packages.
+
Install [https://github.com/ewilde/CompleteSharp "CompleteSharp"], [https://github.com/oferei/sublime-unity-completions "Unity Completions Package"] and [https://sublime.wbond.net/packages/Unity3D%20Shader%20Highlighter%20and%20Snippets "Unity3D Snippets and Completes"] Sublime Text packages.
  
 
Add extra assemblies for CompleteSharp to the settings either through "Preferences" -> "Settings - User" or "Project" -> "Edit Project"(opens project settings file) so that Unity3D Classes are recognized:
 
Add extra assemblies for CompleteSharp to the settings either through "Preferences" -> "Settings - User" or "Project" -> "Edit Project"(opens project settings file) so that Unity3D Classes are recognized:

Revision as of 17:35, 9 April 2014

Contents

Editors

Language Support and Operating System
* Additional bundle required (see above)
** OSX and Windows support still in beta


Unity's bundled script editors

MonoDevelop-Unity (OSX, WIN)

The leading Unity IDE editor for Mac, Windows. MonoDevelop-Unity is a fork of MonoDevelop with added Unity-specific features.

Unitron (OSX)

Unitron was previously the official script editor bundled with Unity; it is no longer in active development, in lieu of MonoDevelop-Unity. Unitron is a derivation of an older version of Smultron with some added Unity-specific features.

UniSciTE (WIN)

Previously leading script editor Unity script editor on Windows. UniSciTE is a derivation of SciTE with added Unity-specific features.


MonoDevelop-Unity (OSX, Windows, Linux)

MonoDevelop-Unity is the Unity-specific implementation of MonoDevelop, an open source IDE tailored for developing in Mono/.Net.

As the leading IDE for Unity, MonoDevelop-Unity tightly integrates with Unity functions includes advanced IDE features like auto completion, debugging, code insight, & custom color scheme editing. It supports .JS / UnityScript, C# and Boo.

Bundled with Unity: Get it with Unity for Mac, Windows

MonoDevelop-Unity source code: GitHub

Non-Unity specific versions: Mac, Windows, Linux


Emacs (OSX, Windows, *nix)

Emacs, one of the most useful editors. it's very extensible with just whatever you want, it can go from a msn client to a Calendar program and all in the same editor! :) More info about the emacs mode for JS can be found at: http://blogs.unity3d.com/2010/01/15/emacs-mode-for-unity-javascript/


TextMate (OSX)

TextMate is a popular general text editor for OSX. It's very extensible with tabs, macros, snippets, code folding and shell inegration. Unity-specific bundles exist for JavaScript, Boo and C#.

Contributor Notes

If you're a bundle author, please edit the below & upload the bundles here, rather than linking to messy forums. Also, please fill out any missing info, including bundle version (use date if you're not tracking versions), which version of the Unity API the bundle supports, iPhone API support, etc.

If you want to make a change to an existing bundle, i.e. include your own formatting, folding etc. please first post in the discussion page before updating the bundle and allow 1 day for feedback. This gives people who follow this page a chance to consider the changes for inclusion (this is intended Wiki usage).

Lastly, feel free to edit the formatting, appearance, etc. of the entries; it's OUR wiki after-all! :)

JavaScript:

CSharp:

Boo:

ShaderLab:

Other ShaderLab


Sublime Text (OSX, Windows, Linux)

Sublime Text is a popular cross-platform text and source code editor. It is extendable and its community has contributed numerous packages(plugins/extensions/addons) for Sublime Text.

Installation

Official Website

Project Setup

Creating a project file has some advantages:

  • Context - specify your script folder(s) for easy search & navigation between your files
  • Settings - filter out irrelevant files (e.g., .meta files)

To create a project use "File" -> "Open Folder" from the header menu and open your Unity3D project's folder(parent of the "Assets" folder). Then use "Tools" -> "Save Project As" to create a my_project.sublime-project file in your project root directory (outside Assets).

For example, this will include only the Assets/Scripts folder and exclude .meta and certain binary files:

{
	"folders":
	[
		{
			"path": "Assets/Scripts",
			"file_exclude_patterns":
			[
				"*.dll",
				"*.meta"
			]
		}
	]
}

Package Control

Sublime Text has a package called "Package Control" that allows to easily search and manage installed packages. Follow the few instructions described by the official maintainer of package: https://sublime.wbond.net/installation

"Package Control" for Sublime Text 3 uses "Git" distributed revision control and source code management (SCM) system to retrieve and update packages, so if you use ST3 install Git for your operating system.

To access "Package Control" functions from within Sublime Text:

  • Open the "Command Palette" through "Tools" -> "Command Palette" from the header menu or use the default Command+Shift+P(OS X) or Ctrl+Shift+P(Windows/Linux) shortcut
  • Write "Package Control"(without quotes) and you will see functions made available by the package including installing and removing packages.

C# and JavaScript Syntax highlighting

Install the "C#" and "Unity3D Syntax Highlighting" package either by using the Package Control or by cloning the package using Git from Github.

'Once installed you can select "View" -> "Syntax" -> "Unity3D" and then either Unity C# or Unity JavaScript. You may also want to select the “Open all with current extension” option so that Sublime Text 2 will always use Unity syntax highlighting when viewing C# or JavaScript Files.' - Jacob Pennock

Do note that Sublime Text's built-in "Open all with current extension" will not differentiate between C# scripts that use Unity API and external ones that do not, since they both have the "cs" file extension. One way to avoid this is to use a package called "ApplySyntax" and add the following to its settings:

"syntaxes": [
...
{
	// Unity 3D C# format detection.
	"name": "Unity3D/UnityC#",
	"match": "all",
	"rules": [
		{"file_name": ".*\\.cs$"},
		{"contains": "using UnityEngine;\n"}
	]
}
...
]

(The Unity3D package might be still lay compressed within Sublime Text's "Installed Packages" folder, which contains "UnityC#.tmLanguage" file that ApplySyntax will be looking for within "Packages/Unity3D" folder)

Unity Shader Syntax highlighting

Install the "Unity3D ShaderLab" Sublime Text package.

C# System Type Autocompletion

Install the "CompleteSharp" Sublime Text package by following the instructions on Github README. User "quarnster" was the original author of CompleteSharp, but has discontinued working on it. "ewilde" version is a bit more up to date and includes a already compiled "CompleteSharp.exe" file which the package uses, which otherwise has to be compiled using Mono(gmcs command).

Add assemblies to the settings either through "Preferences" -> "Settings - User" or "Project" -> "Edit Project"(opens project settings file):

"folders": [
...
], //<- comma required
...
"settings": {
...

	// Uncomment for OS X/Linux - Add the correct path to your Mono command if "mono" does not launch Mono in the Terminal.
	//"completesharp_mono_path": "/Applications/Unity/MonoDevelop.app/Contents/MacOS/bin/MonoDevelop",

	"completesharp_assemblies": [
		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\System.Core.dll",
		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\System.dll"
	],

	"completioncommon_inhibit_sublime_completions": true,

	"completioncommon_shorten_names": true

...
}

C# Unity API Classes Autocompletion

Install "CompleteSharp", "Unity Completions Package" and "Unity3D Snippets and Completes" Sublime Text packages.

Add extra assemblies for CompleteSharp to the settings either through "Preferences" -> "Settings - User" or "Project" -> "Edit Project"(opens project settings file) so that Unity3D Classes are recognized:

"folders": [
...
], //<- comma required
...
"settings": {
...

	// Uncomment for OS X/Linux - Add the correct path to your Mono command if "mono" does not launch Mono in the Terminal.
	//"completesharp_mono_path": "/Applications/Unity/MonoDevelop.app/Contents/MacOS/bin/MonoDevelop",

	"completesharp_assemblies": [
		"<path-to-unity>\\Unity\\Editor\\Data\\Managed\\UnityEngine.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Managed\\UnityEditor.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\UnityScript.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\System.Core.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\System.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Managed\\nunit.framework.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\mscorlib.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\System.Core.dll",

		"<path-to-unity>\\Unity\\Editor\\Data\\Mono\\lib\\mono\\unity\\System.dll",

		"${project_path:Library}\\ScriptAssemblies\\Assembly-CSharp.dll",

		"${project_path:Library}\\ScriptAssemblies\\Assembly-CSharp-Editor.dll",

		"${project_path:Library}\\ScriptAssemblies\\Assembly-UnityScript-Editor.dll",

		"${project_path:Library}\\ScriptAssemblies\\Assembly-CSharp-firstpass.dll"
	],

	"completioncommon_inhibit_sublime_completions": true,

	"completioncommon_shorten_names": true

...
}

Boo, C# and JavaScript

Easy installation: using Package Control => Install Package => Unity Completions

Unity Sync

Tip: setup Sublime Text as Unity's external editor under Preferences => External Tools. You should set the External Script Editor Args field to: "$(File)":$(Line)

Community Support

"Using Unity with Sublime Text" Forum Thread

Coda(OSX)

Contributor Notes

Feel free to edit the mode; however, it would be appreciated if you could donate me from my website JnaniDev.com. I will soon be coming out with modes for Boo and C#. Enjoy!

Unity JavaScript


UnityDevelop (WIN)

UnityDevelop is a modification of FlashDevelop (an excellent ActionScript editor). It understands Unity JavaScript and provides autocomplete for your scripts and built-in Unity stuff. It also provides very basic syntax highlighting for ShaderLab.

UnityDevelop 4 (based on FlashDevelop 4, 2012)

Old version (based on FlashDevelop 2.0, 2009)


UnityScript Editor (WIN)

UnityScript Editor is a specially designed editor for the Unity 3D javascript language. Syntax highlighting for all commands, functions and attributes, makes it easy to see what’s going on in your scripts. UnityScript features Intelliprompt support for all of UnityScripts functions and commands (excludes Editor specific functions), as well as command details when the mouse is hovered over keywords. That's the blurb from the website. Personally, I find it to do pretty much everything I want. Plus the developer seems to really want feedback to make it the perfect script editor and puts out constant updates. Excellent. Oh and it's free to download, but worth a donation.


SubEthaEdit (OSX)

SubEthaEdit is know for its collaborative features over the bonjour network.


BBEdit (OSX)

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox