Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
4
Question by Thomas Hentschel Lund · Oct 20, 2009 at 05:53 AM · macvisualstudio

Visual Studio alternatives for Mac

I want to use C# but Visual Studio does not exist for Mac. Am I stuck with a text editor?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by jashan · Nov 29, 2009 at 12:15 PM

Personally, I really think the only "alternative" to Visual Studio on the Mac is ... Visual Studio ;-) ... see also the Setting up Visual Studio for Unity (that article was from before there was Unity for Windows, so while it's a little dated in parts it deals with a lot of the issues involved in setting this up in a virtual machine).

There's also a "hack" to make Visual Studio open the file you clicked on in the virtual machine, in Visual Studio (including opening the correct solution file generated by the Unity-Visual Studio integration). This hack is based on the solution provided in Windows version: integrate with Visual C# (which is redundant for Windows since Unity 2.6 but still very relevant for the Mac OS version of Unity). Not sure if this works in Parallels, but in VMWare, it does: You can open Windows-applications directly from Mac OS; so you need to create a build of a modified version of what's posted in that thread and create a symlink from Unitron to that application (yeah, you do replace Unitron that way ... and you'll have to "fix it" each time a Unity update "broke it").

With that, you can open the correct solution in Visual Studio, and jump to the correct file. In my case, I convert the path I'm getting in VMWare from the Mac-side to the local, network-based path I'm using in my virtual machine (this can easily be done in the solution posted by ToreTank). What I'm getting is something like

\.host\Shared Folders\somepath\Assets\somepath\MyScript.cs

which I convert to:

I:\somepath\Assets\somepath\MyScript.cs

What's still missing is jumping to the right line number. Unfortunately, that's far from being trivial and will require some Cocoa/Objective-C coding (that's where I got stuck): There's a protocol used by Unity to "tell" Unitron the line number (according to Benoit Fouletier that is the ODB protocol which is used by any BBEdit-compatible editor, including Smultron which is what Unitron is based on). Basically, what we need is a little Cocoa application that mimics this protocol, gets the line number from Unity, puts it into a file that the "helper application" in VMWare reads when it opens the file in Visual Studio, and finally launches the "helper application" on the VMWare-side (which - from Mac OS - looks like a Mac OS application).

The reason you need to store the line number into a text file is that you can only pass file-paths as parameters from Mac to VMWare (you cannot pass a "line-number argument" - but you can have a "common communications file" into which the Mac application writes and from which the Windows-side wrapper reads).

One solution might be simply hacking Smultron (which is open source) to do what we need. If anyone wants to try this: In the Smultron project, look for the method "shouldOpen" in Classes/Performers/SMLOpenSavePerformer.m. Pretty much at the end of this method, there's this kind of code:

if (appleEventSelectionRangeDescriptor) {

     AppleEventSelectionRange selectionRange;
     [[appleEventSelectionRangeDescriptor data] getBytes:&selectionRange length:sizeof(AppleEventSelectionRange)];
     NSInteger lineNumber = (NSInteger)selectionRange.lineNum;

     if (lineNumber > -1) {
         [[SMLTextMenuController sharedInstance] performGoToLine:lineNumber];
         // here's where we'd have to hook into
         // add magic to store line number to file and open VMWare-wrapper here
     } else {
         // [not relevant for our purposes]
     }
 }

That's about as far as I got with this; not a complete solution - but I'd say "pretty close".

I think it would be really nice to get a full solution which is "as clean as possible" that we could post to the Wiki. I'll be happy to provide the Windows-side wrapper (credit goes mostly to the people who posted in the above mentioned forum posting - I just did some tweaks on it and would be happy to implement the final steps needed). With that, after a little bit of initial setup, you'll be able to use Visual Studio with Unity on the Mac almost exactly as conveniently as you do on Windows.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
6

Answer by Thomas Hentschel Lund · Oct 20, 2009 at 05:57 AM

Besides running Visual Studio in virtualization software (Parallels, VMware etc) you have the choice of using MonoDevelop. With the recent 2.2 beta releases it has reached a level where it is usable for daily production.

It can be found here: http://monodevelop.com/

It is a full featured IDE similar to Visual Studio, features all the nifty things you are used to like intellisense. Best of all it is free, reads visual studio solution/project files etc.

It is not (yet) bug free, but it is already much much better than using a text editor

As a bonus info Unity is actively involved in making MonoDevelop better and usable.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
3

Answer by Ricardo · Oct 20, 2009 at 01:29 PM

MonoDevelop has been steadily improving, and while still significantly clunkier than TextMate, it is now usable and does have some very appealing features:

  • IntelliSense
  • NUnit support
  • Some limited refactoring options
  • Auto-completion of repetitive tasks, like the C# standard for documenting code parameters
  • Code region collapsing and expansion

You can also read this question for details on how to set it up.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

No one has followed this question yet.

Related Questions

Multiple Unity Projects on Mac. Can I have them open to separate VS instances? 3 Answers

In-app purchase "Invalid product" on Mac Store build 0 Answers

How do I create Visual Studio solutions for Mac using Unity iPhone and MonoDevelop? 2 Answers

Problem with setting up Visual Studio in unity 3.0 2 Answers

How to prevent the error "Unable to read the project file ... The attribute "xmlns" in element is unrecognized"? 4 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges