Welcome to Unity Learning,Unity training ,UnityEnterprise TrainingEducation Area, there are manyu3d Resources,u3d Training Video,u3d Tutorials,U3d Frequently Asked questions,u3d Project Source code, the "Dog Planing Learning Network" Unity's Ultimate Academy, dedicated to building the industry unity3d Training , learning the first brand.
With Sublime has been a long time, very comfortable, very intimate, can't stop. Before because is the development page swims, therefore is uses the AS3 development, the recent time, has opened a hand to swim the project, the engine aspect has selected Unity3d, honestly, before had not too many 3D concept, just oneself occasionally will the next AS3 writes 3D engine to play, tossing and tossing, and does not have the actual work to have the related thing , now the project needs to use Unity3d, some excitement, this is not their own toss-up.
There are 3 types of scripts supported by Unity: C #, JS, Boo, we're going to use C #, and there's not much discussion on the use of language, one is efficiency, the other is the success of another team, so I chose C # from the beginning. Unity comes with an IDE called MonoDevelop, the whole very small fresh feeling, but unfortunately, I used a short period of time, found very difficult to adapt to, shortcut keys, efficiency, themes, and the various features of the editor let me use very uncomfortable, change a set of familiar operating habits cost too high, Helpless under, had to Sublime play.
After Google, found to use Sublime to develop Unity or big people, after a toss, loaded with various plug-ins, write a variety of configurations, done. In terms of writing code can completely abandon MonoDevelop, of course, the breakpoint debugging or need it, so now on the Workbench these 3 programs are open, Unity responsible for scene editing, Sublime responsible for scripting, MonoDevelop responsible for breakpoint debugging.
In addition, Sublime is very convenient to modify the plugin, you open the corresponding plug-in directory, and then open the Py file inside, you change, you save, you see the effect.
Here's a look at the various plugins and configurations I've downloaded.
Sublime in C # comment shortcut keys
Sublime Comment Shortcut key is ctrl+/, for different languages according to the file extension will have different annotation type, do not know why this shortcut key in C # seems to be invalid, but also found the solution, because C # comments and JS is the same, so the JS in the comment on the piece of the sour CE type plus CS is good. The following steps are described:
1, open the Sublime package directory, Preference-browse Packages ...
2. Open JavaScript, find comments.tmpreferences and edit
3. Find and edit Stringsource.js, Source.json, source.cs/string
C # Syntax Analysis
This plugin is the most serious, it will parse the relevant class information from the DLL file and other meta-information, and then you edit the CS file, will be in the input. When triggering the completion of the function, according to different contexts, different variables, different classes of files, will show the corresponding variables and method tips list, easy to use to violence! Pull down We install:
1, install the plug-in: Completesharp
2, edit the project file, the project file refers to the file extension *.sublime-project
3, add the following DLL information in the project file
{
"Folders":
[
{
"Path": "/d/documents/unity"
}
],
"Settings":
{
"Completesharp_assemblies": [
"D:/program Files (x86)/unity/editor/data/managed/unityengine.dll",
"D:/program Files (x86)/unity/editor/data/managed/unityeditor.dll",
"D:/program Files (x86)/unity/editor/data/managed/nunit.framework.dll",
"D:/program Files (x86)/unity/editor/data/mono/lib/mono/unity/unityscript.dll",
"D:/program Files (x86)/unity/editor/data/mono/lib/mono/unity/system.core.dll",
"D:/program Files (x86)/unity/editor/data/mono/lib/mono/unity/system.dll",
"D:/documents/unity/*/*/*/*/*.dll",
"D:/documents/unity/*/*/*/*.dll"
]
}
}
Unity.sublime-project
The configuration file diagram is as follows:
Enhanced version of all AutoComplete
Basically all AutoComplete is one of several Sublime plugins that must be installed, but I always feel that all AutoComplete is still a bit flawed. According to the plugin description, all AutoComplete will query all current tabs and will parse the words, and then add the appropriate words to the cue list when editing. I said the flaw is that there are some words for me, it is necessary to add a hint list every time, for example, I have a own code base, there are many of their own writing class, the class of the sentence is my style, but if you want to complete the words need to open the relevant class file, which is quite egg pain, so has been trying Change all AutoComplete to add my own custom words in addition to the words it analyzes.
In fact, this is not a flaw, but my personal needs, I have another way to solve this demand, is to build the corresponding code snippets, how many custom words, it is necessary to build how many pieces of code files, too troublesome.
I tried to change it. All AutoComplete, edit the all_views_completions.py file, in which Allautocomplete adds a __init__ method, This method will read a file in the specified directory when the plug-in is initialized, there will be several files in the specified directory, and the file is a string of words delimited by ' | ', for example: abs| Accelerationevent, and add all the words read to the self.customs, and then in the method of triggering completion, the custom word added, the effect is as follows (Unity.txt this document is actually from unity3d/unityc# . Tmlanguage in the back):
def __init__ (self):
words = []
For root, dirs, files in Os.walk ("D:/program files/sublime Text 2/conf/packages/all autocomplete/custom"):
For name in Files:
With open (Os.path.join (root, name), "R") as file:
Words + = File.read (). Split (' | ')
Words = FILTER_WORDS2 (words)
Self.customs = without_duplicates (words)
__init__
Unity3d Script Reference
In the process of writing code, often need to check the API documentation, so convenient to check the API documentation is an important feature. Sublime itself does not provide similar functionality, but this is difficult to do with the programmer children's shoes, I found a plugin on the Internet: Unity3d Script Reference Search, the role of this plugin is to search the API, you can search the current cursor words, you can also enter the specified content. This plug-in is very simple to do, in fact, is called in the plug-in Webbrowser.open_new_tab (URL), where the URL is to spell a query link. However, this plugin access URL is the official website of the online API, and in fact, there is also a copy of the API document, through the Unity menu help-scripting Reference can be accessed.
I tried to change the plugin, modify the unity3dscriptreference.py file, the URL link to the local file, it does not seem to take effect, the Web this piece I am not familiar with, so I simply point, with Python to open a simple HTTP service, I have introduced the use of Python to create a simple HTTP and FTP service, directly under the Unity directory to open an HTTP service, the end of the following:
2014/5/23 revision: Because there are preconceived ideas, thought can only use WebBrowser to access the Web page, is actually not needed, HTTP service is not necessary to open, the above code as long as you can change the webbrowser.open_new_tab to Subprocess.call is available, as follows:
Browser = "C:/Program Files (x86)/google/chrome/application/chrome.exe"
def searchunityscriptreferencefor (text):
# url = ' http://unity3d.com/support/documentation/ScriptReference/30_search.html?q= ' + text.replace (', '%20 ')
url = ' file:///D:/Program%20Files%20 (x86)/unity/editor/data/documentation/documentation/scriptreference/30_ search.html?q= ' + text.replace (', '%20 ')
# webbrowser.open_new_tab (URL)
Subprocess.call (Browser+url)
def openunityfunctionreference (text):
# url = ' http://unity3d.com/support/documentation/ScriptReference/' + text.replace (', '%20 ')
url = ' file:///D:/Program%20Files%20 (x86)/unity/editor/data/documentation/documentation/scriptreference/' + Text.replace (', '%20 ') + '. html '
# webbrowser.open_new_tab (URL)
Subprocess.call (Browser+url)
Next, you can bind the shortcut key, Ctrl+shift+p-key bindings user, add the following shortcut key:
{"Keys": ["F4"], "command": "Unity_reference_search_selection"}
Unity syntax highlighting and code slices
Unity provides a complete set of game development kits, in the process of writing code, will encounter many classes are Unity, some classes are supported by the C # language itself, for this reason, the Internet has the talent to do a unity C # language highlighting file, which will be the unity of the class with the individual highlighting. But I do not like that highlight color, so I do not use, plug-in name: Unity3d.
Similar to syntax highlighting, also has the talent to do a Unity-tailored code snippet plug-in, download and install the corresponding plug-in: Unity3d Snippets and completes.
There is a magic plugin: Unity completions, why say magic, because the plug-in I installed it took 1 hours, after installation found that the entire directory occupies more than 200 m, file size of more than 20 m, light to see this to scare, other plug-ins can have at most a hundreds of k just, Look at the file, there are probably more than 7W, no wonder that occupy so big, but frankly this plugin I tried a bit after I did not feel good, interested in children's shoes can try.
For more information, please visit the "Dog Planing Learning Network" Unity Ultimate Academy Http://edu.gopedu.com
Statement: This document comes from the "Dog Planing Learning Network" Community-unity Extreme College, is a self-published Unity3d study articles, if anything violates your relevant interests, please communicate with the official, we will deal with the real-time.
Developing Unity3d projects with Sublime Text 2