I’ve set Xamarin up as my default script editor and selected “Synch with MonoDevelop Project” to enable Unity-specific autocompletion. But after doing this, Xamarin starts adding an extra tab to my code. For example:
public class myClass : MonoBehaviour {
public GameObject player;
… instead of:
public class hpUpdate : MonoBehaviour {
public GameObject player;
Everything still seems to runs fine, but it is jarring and makes the code look odd.
UPDATE: This is caused by Unity’s .sln file setting the “text” tab size to 8. There are two ways to fix this:
Use tab size 8 for everything.
Every time you make a change that modifies the SLN, right click the solution in Xamarin, hit “Options”, “Code Formatting”, “Text File”, and set “Indent Width” to 4.
Until Unity fixes this (ie, stop exporting the .sln with indent width overrides) there’s not a great solution.
THIS IS BY FAR THE WORST CODE EDITING PROGRAM I HAVE EVER USED.
I cannot believe the issues that I have with Xamarin Studio.
–commented code being flagged with syntax errors. WTF?
–commented code not greyed out
–intellisense not finding member names until 30 seconds after they have been created
–errors with basic indentations
–hundreds of unnecessary “suggestions” made by the editor:
int x = this.y; //Warning: ‘this’ is redundant, and can be removed safely.
Well, do they not understand the reasons why people use “this”? Its for the intellisense
the program cant handle copy and paste text from external programs
the program starts up in Japanese characters after a crash
I had this problem some time ago but it went away for months.
What I did: review tab settings both in Solution (under Project menu) AND general Mono preferences and set same settings (search under Source Code / Code Formatting / C# source code)