Visual Studio and Unity iPhone
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    Unity Community Index // iPhone Development
View previous topic :: View next topic  
Author Message
dawvee



Joined: 12 Nov 2008
Posts: 276
Location: Dublin, Ireland

PostPosted: Sat Aug 01, 2009 2:34 pm    Post subject: Visual Studio and Unity iPhone Reply with quote
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
View user's profile Send private message
Sanjuro



Joined: 01 Mar 2009
Posts: 87
Location: Czech rep.

PostPosted: Sat Aug 01, 2009 3:23 pm    Post subject: Reply with quote
Thank you pal... I was so lazy to port it Wink

I'll try it definitely in my next project...

Sanjuro
Back to top
View user's profile Send private message Send e-mail Visit poster's website
blastone



Joined: 07 Apr 2009
Posts: 111
Location: Sydney

PostPosted: Thu Aug 06, 2009 12:28 am    Post subject: Reply with quote
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 Very Happy

_________________
Cheers Mark Fennell
http://www.blastone.com
Back to top
View user's profile Send private message Visit poster's website
dawvee



Joined: 12 Nov 2008
Posts: 276
Location: Dublin, Ireland

PostPosted: Fri Aug 07, 2009 8:30 pm    Post subject: Reply with quote
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
View user's profile Send private message
TriplePAF



Joined: 19 Aug 2009
Posts: 89
Location: Amsterdam

PostPosted: Tue Aug 25, 2009 12:05 pm    Post subject: Reply with quote
Thanks for this great peace of code Very Happy. 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
View user's profile Send private message MSN Messenger
akasurreal



Joined: 17 Jul 2009
Posts: 57

PostPosted: Tue Aug 25, 2009 11:24 pm    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website AIM Address
dawvee



Joined: 12 Nov 2008
Posts: 276
Location: Dublin, Ireland

PostPosted: Wed Aug 26, 2009 12:09 pm    Post subject: Reply with quote
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
View user's profile Send private message
akasurreal



Joined: 17 Jul 2009
Posts: 57

PostPosted: Wed Aug 26, 2009 5:51 pm    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website AIM Address
jashan



Joined: 09 Mar 2007
Posts: 1555
Location: Munich, Germany

PostPosted: Wed Aug 26, 2009 6:17 pm    Post subject: Reply with quote
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 Wink

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
View user's profile Send private message Visit poster's website
jashan



Joined: 09 Mar 2007
Posts: 1555
Location: Munich, Germany

PostPosted: Wed Aug 26, 2009 6:21 pm    Post subject: Reply with quote
akasurreal wrote:
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?


The DLL-locations on the Mac are also mentioned on the Wiki article I previously posted. Maybe someone would be so kind to extend this with the location of the same DLLs on a Windows Unity install:

Setting up Visual Studio for Unity - The Reference to UnityEngine.dll and UnityEditor.dll

_________________
RaMtiGA 1/3: Traces of Illumination --- Experience the Unexpected!

Jashan's Developer Blog
Back to top
View user's profile Send private message Visit poster's website
kevinr



Joined: 24 Jul 2008
Posts: 263

PostPosted: Thu Aug 27, 2009 1:14 am    Post subject: Reply with quote
maybe I'm doing it wrong, but if you use nested folders, it doesn't find the .cs files.
_________________
Pong - Complete iPhone Game example project: http://forum.unity3d.com/viewtopic.php?t=20643&start=0&postdays=0&postorder=asc&highlight=pong
Back to top
View user's profile Send private message AIM Address
ej2009



Joined: 03 Mar 2009
Posts: 278
Location: Australia

PostPosted: Thu Aug 27, 2009 3:34 am    Post subject: Reply with quote
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
View user's profile Send private message
akasurreal



Joined: 17 Jul 2009
Posts: 57

PostPosted: Thu Aug 27, 2009 3:45 am    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website AIM Address
akasurreal



Joined: 17 Jul 2009
Posts: 57

PostPosted: Thu Aug 27, 2009 3:47 am    Post subject: Reply with quote
jashan wrote:
The DLL-locations on the Mac are also mentioned on the Wiki article I previously posted. Maybe someone would be so kind to extend this with the location of the same DLLs on a Windows Unity install:

Setting up Visual Studio for Unity - The Reference to UnityEngine.dll and UnityEditor.dll


DOH! I feel pretty stupid as I have had to do this before when I first set it up. Thanks Smile

_________________
Michael
FizzPow Games
http://FizzPow.com
Back to top
View user's profile Send private message Visit poster's website AIM Address
jashan



Joined: 09 Mar 2007
Posts: 1555
Location: Munich, Germany

PostPosted: Thu Aug 27, 2009 6:44 am    Post subject: Reply with quote
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
View user's profile Send private message Visit poster's website
Post new topic   Reply to topic    Unity Community Index // iPhone Development All times are GMT + 1 Hour
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum