Thursday, November 27, 2014

Unity touch debugging

I mentioned this in an earlier post, but thought I would go into more detail. I think this is  a great solution for testing touch input with Unity.

http://docs.unity3d.com/ScriptReference/Input.GetTouch.html

I'm using Visual Studio Pro 2013 to do this and I don't see a way to do it with Mono.  The only other way I've found is to use an actual device and connect a debugger to the device. This way I've found allows me to simply run a Visual Studio project directly on my touch device/development environment and test my touch code.

The first thing is to Build the project using File/Build and Run

 

 Select Windows Store app and then click Build or Build and Run.

 
The default location is to use the winout directory in the current Unity project. This worked well for me so I just used the default.
 
 
This creates a .sln file in that winout directory with all the necessary Visual Studio project files. Simply double click on the .sln file to launch Visual Studio Pro 2013.
 
 
 
I tested the project and one really nice thing is that the .cs files associated with behaviors in my project are actually linked back to the same files in my Unity project. So after making changes, they are already in my Unity project and I don't have to copy them back.
 
 
 
One thing to note is that this is only for script debugging. If I want to make changes to my layout or the models I've laid out in my Scene I will have to close Visual Studio, return to Unity to make the changes, then rebuild the winout project to work on my scripts again.  It's a small thing and this is still a much easier way to debug touch input than anything I've had to do before.

 

 

 

Wednesday, November 26, 2014

Surface Pro3 Print Screen Button

I usually use SnagIt to great effect and it is a primary tool for me.  I haven't installed it on my Surface yet and I was trying to figure out how to do a screen capture without it.  There isn't a Print Screen button.  The trick is pretty easy though. Press Fn-Space bar to capture the screen and Fn-Alt-Space to capture the active window.

http://answers.microsoft.com/en-us/surface/forum/surfpro-surfusingpro/print-screen/1aa98224-dacb-4770-863e-7e1fc77f9ac1

Tuesday, November 25, 2014

Blender UV Mapping

I have a love hate relationship with Blender.  Love that it's free and super powerful. Hate that I have to relearn how to do simple stuff every time I step away from it for a few months.  I will say that this time, the tenth that I've created a UV map on a mesh has been the easiest.

This site documentation really helped and even though I'm using 2.72b, and the documentation is for 2.6 it didn't seem to matter.

http://wiki.blender.org/index.php/Doc:2.6/Manual/Textures/Mapping/UV/Unwrapping

It might not seem like a lot, but this will be a good test model for the game mechanic I'm building.

 
This is the actual texture.

Friday, November 21, 2014

Surface Pro 3 and Unity for Windows Store

Recently received a Surface Pro 3 as a gift and really love it.  Was using a 5 year old Toshiba that was limping along even with the 128GB SSD. The SSD made it viable for quite a while, but it was really getting behind. Enjoying the new Surface. First loaded Unity and Visual Studio Express 2013.  It seems like I can finally develop on an airplane even if the seat in front of me is reclined and I'm next to a 300 pounded.  The laptop was just too bulky to use when someone was sitting next to me.

So far I spent a lot of time getting Unity and Visual Studio connected together using UnityVS. Not that I don't think Mono Develop isn't good enough, I do like that, but for some reason I'm drawn to Windows Store app development and need to use VS to build Unity apps for Windows Store.

It isn't well documented, but don't try to use Visual Studio Express with UnityVS.  It won't give you an error, but will only have a message that it can't find Visual Studio.   You have to install Visual Studio Pro to work with UnityVS.  I'm now running a 90 day trial and everything is working, but will have to write quick and decide if I want to upgrade my older version of Visual Studio Pro.  I spent a lot of time uninstalling and reinstalling UnityVS to get this to work. Many messages from Visual Studio that the project type wasn't recognized.  Once I installed Visual Studio Pro it still had the same message and I reinstalled UnityVS and everything worked well.

Another thing that led me in this direcetion was trying to figure out how to debug the touch screen interface in my Unity game. This seems like it will work well.  In Unity, you have to Build the solution for the Windows Store application which will create a new folder with a Visual Studio Windows Store project.  This has the C# scripts linked in it so you can debug and change those directly and debug your Windows Store application directly.  I could have done something similar and connected my Android tablet directly to Unity and ADB debugged on hardware, but this seems like a better way and I will be using that.