| View previous topic :: View next topic |
dawvee

Joined: 12 Nov 2008 Posts: 276 Location: Dublin, Ireland
|
Posted: Sat Aug 01, 2009 2:34 pm Post subject: Visual Studio and Unity iPhone |
|
|
|
I just had a look at Lucas Meijer's exellent package for creating a Visual Studio project inside Unity (from here) and found to my dismay that it doesn't work in Unity iPhone, mostly due to an overload of DirectoryInfo.GetFile() that isn't available in the version of Mono/.NET that Unity iPhone uses.
It was a simple fix though, and it's all working brilliantly now so I'm attaching it here for all you iPhone devs that are C# inclined.
As an added bonus I put the Unity iPhone classes into the package's UnityEngine.xml file, so they should show up with a proper description in VS.
Enjoy!
Edit: Updated to support proper recursion through all subdirectories
Last edited by dawvee on Thu Aug 27, 2009 10:19 pm; edited 1 time in total |
|
| Back to top |
|
|
Sanjuro

Joined: 01 Mar 2009 Posts: 87 Location: Czech rep.
|
Posted: Sat Aug 01, 2009 3:23 pm Post subject: |
|
|
|
Thank you pal... I was so lazy to port it
I'll try it definitely in my next project...
Sanjuro |
|
| Back to top |
|
|
blastone
Joined: 07 Apr 2009 Posts: 111 Location: Sydney
|
Posted: Thu Aug 06, 2009 12:28 am Post subject: |
|
|
|
many thanks indeed!
Something that I also needed to do was to put the unity dlls from the iphone version (open up the .app package on the mac) then I copied them over to the unity version I have on my VM ware fusion install.
It means the the unity version on the Windows emulator wont work anymore, but that Visual Studio will happily pick up iphone related functions  _________________ Cheers Mark Fennell
http://www.blastone.com |
|
| Back to top |
|
|
dawvee

Joined: 12 Nov 2008 Posts: 276 Location: Dublin, Ireland
|
Posted: Fri Aug 07, 2009 8:30 pm Post subject: |
|
|
|
| The script in the above package should automatically add a copy of the Unity iPhone dlls to the VS project folder it creates, so VS should pick them up without having to copy them or add them to the VS project manually. No need to bork your Windows Unity install, either! |
|
| Back to top |
|
|
TriplePAF

Joined: 19 Aug 2009 Posts: 89 Location: Amsterdam
|
Posted: Tue Aug 25, 2009 12:05 pm Post subject: |
|
|
|
Thanks for this great peace of code . I was already bugging for a few hours with the Unity 2.1 source from Lucas Meijer.
I still have another Question about the xml help files. How are they created or extended. I mean is there some way to build it dynamically from scratch if the Unity iphone Dll's get extended with a newer release.
Peter. |
|
| Back to top |
|
|
akasurreal

Joined: 17 Jul 2009 Posts: 57
|
Posted: Tue Aug 25, 2009 11:24 pm Post subject: |
|
|
|
I have been using VS for iPhone dev for months now. It's so great!
Has anyone been able to make new DLLs for Unity iPhone 1.5 yet? Or can point me to how to do it myself? _________________ Michael
FizzPow Games
http://FizzPow.com |
|
| Back to top |
|
|
dawvee

Joined: 12 Nov 2008 Posts: 276 Location: Dublin, Ireland
|
Posted: Wed Aug 26, 2009 12:09 pm Post subject: |
|
|
|
The above script grabs the .dll files directly from the Editor itself, so if you run the script using 1.5 it will get the 1.5 .dlls automatically. The xml docs won't reflect this, though, as they're included in the asset bundle itself.
I'll have to update the .xml docs at some point and post a new version, but other than that it should work in 1.5.
Edit: Just tested it myself and recreating the project from the script pulls in the new .dlls, so all the new stuff shows up in Visual Studio (just without descriptions). |
|
| Back to top |
|
|
akasurreal

Joined: 17 Jul 2009 Posts: 57
|
Posted: Wed Aug 26, 2009 5:51 pm Post subject: |
|
|
|
| dawvee wrote: | The above script grabs the .dll files directly from the Editor itself, so if you run the script using 1.5 it will get the 1.5 .dlls automatically. The xml docs won't reflect this, though, as they're included in the asset bundle itself.
I'll have to update the .xml docs at some point and post a new version, but other than that it should work in 1.5.
Edit: Just tested it myself and recreating the project from the script pulls in the new .dlls, so all the new stuff shows up in Visual Studio (just without descriptions). |
I manually setup my VS environment and I am afraid if I use your package it may change/break things that are working the way I want. Is there a way to get these DLLs myself manually somehow? Am I overcomplicating this? hehe, Are they just files I need to copy from somehwere? I thought they were generated using some kind of tool. _________________ Michael
FizzPow Games
http://FizzPow.com |
|
| Back to top |
|
|
jashan

Joined: 09 Mar 2007 Posts: 1555 Location: Munich, Germany
|
Posted: Wed Aug 26, 2009 6:17 pm Post subject: |
|
|
|
| TriplePAF wrote: | | I still have another Question about the xml help files. How are they created or extended. I mean is there some way to build it dynamically from scratch if the Unity iphone Dll's get extended with a newer release. |
Usually benblo (he's also on the forums) has created those. I guess he has written some sort of script to create them from the HTML Unity API documentation - very much appreciated
I've just checked the links from the article in the Unifycommunity Wiki and those currently seem to not really work, so it might be best to ask him directly. _________________ RaMtiGA 1/3: Traces of Illumination --- Experience the Unexpected!
Jashan's Developer Blog |
|
| Back to top |
|
|
jashan

Joined: 09 Mar 2007 Posts: 1555 Location: Munich, Germany
|
|
| Back to top |
|
|
kevinr

Joined: 24 Jul 2008 Posts: 263
|
|
| Back to top |
|
|
ej2009

Joined: 03 Mar 2009 Posts: 278 Location: Australia
|
Posted: Thu Aug 27, 2009 3:34 am Post subject: |
|
|
|
sorry for my ignorance, but how do you setup your work flow with iPhone and VS?
Maybe I'm mistaken, but you can only develop for iPhone in Mac OS X and VS is MS Windows only.
Please share the wisdom, would love to use VS as well as I have VS2008 Pro on my laptop. |
|
| Back to top |
|
|
akasurreal

Joined: 17 Jul 2009 Posts: 57
|
Posted: Thu Aug 27, 2009 3:45 am Post subject: |
|
|
|
| ej2009 wrote: | sorry for my ignorance, but how do you setup your work flow with iPhone and VS?
Maybe I'm mistaken, but you can only develop for iPhone in Mac OS X and VS is MS Windows only.
Please share the wisdom, would love to use VS as well as I have VS2008 Pro on my laptop. |
The way I have done it that works quite well is dual monitor on a Mac Mini (4GB/SSD) where I am running VMWare with WindowsXP/VS2008 on my right monitor and Unity on my left. You could also network two different machines like your laptop and a mac. Using the plugin for VS mentioned in the wiki, it will add references to the shared CS files over a network share. _________________ Michael
FizzPow Games
http://FizzPow.com |
|
| Back to top |
|
|
akasurreal

Joined: 17 Jul 2009 Posts: 57
|
Posted: Thu Aug 27, 2009 3:47 am Post subject: |
|
|
|
DOH! I feel pretty stupid as I have had to do this before when I first set it up. Thanks  _________________ Michael
FizzPow Games
http://FizzPow.com |
|
| Back to top |
|
|
jashan

Joined: 09 Mar 2007 Posts: 1555 Location: Munich, Germany
|
Posted: Thu Aug 27, 2009 6:44 am Post subject: |
|
|
|
| ej2009 wrote: | sorry for my ignorance, but how do you setup your work flow with iPhone and VS?
Maybe I'm mistaken, but you can only develop for iPhone in Mac OS X and VS is MS Windows only.
Please share the wisdom, would love to use VS as well as I have VS2008 Pro on my laptop. |
See the link above to the Unifycommunity Wiki (or below at the end of this posting). The way to do this is having Windows run in a virtual machine (VMWare Fusion or Parallels Desktop). That way, you can have both Unity iPhone (on the Mac) and Visual Studio (running on Windows inside the virtual machine). Works pretty much seamlessly - only thing I can't get to work is directly jumping to the line numbers in the files.
So, here's the link again (for your convenience): Setting up Visual Studio for Unity - Basic VMWare (or Parallels) and Visual Studio installation _________________ RaMtiGA 1/3: Traces of Illumination --- Experience the Unexpected!
Jashan's Developer Blog |
|
| Back to top |
|
|