Categories
Technology Unity Visual Studio

Microsoft <3 Xamarin

Microsoft has acquired Xamarin. It has finally happened, and while a few years back this would have been horrifying news, I’m actually OK with it now.

This news is exciting for a few different reasons. It raises many questions, and opens up a whole ton of possibilities for .NET development in a multi-platform world.

Categories
Scripting Tips Unity

7 Random Tips for Unity Developers

I’m fairly active in the Unity community, both locally, and online. During my time working as a Unity dev, I’ve seen some bad code, a lot of horrible code, and some good code. I’ve been been lucky enough to feast my eyes upon some great code. The tips that follow are merely based on my observations and experience.

I’m by no means a programming god, and these are not commandments, but I’ve found some success in following these tips. Hopefully some of you can find these helpful as well.

Without further ado, let’s begin:

Categories
Random Thoughts Technology Unity

The End of Browser Games?

 

With the recent news of Adobe Flash been re-branded as Adobe Animate (Animate CC, to be exact), and the less-recent news that Mozilla would follow in Google’s footsteps in pulling the plug on NPAPI for Firefox, browser-based games are left in a somewhat awkward spot. Unity has moved away from their web player in (desperate) favor of WebGL. Where do they go from here?

Categories
Scripting Tips Unity

JSON De/Serialization Using Unity and JsonFx

Difficulty: Medium

My previous JSON tutorial was a while ago, and it never covered actually deserializing data (but is still useful on it’s own), so rather than doing the second half on its own, this tutorial will cover all the steps from the beginning using  JsonFx.

∗ This guide is tested as of Unity 4.3.4f

 

Purpose

The purpose of serializing data is so that it can be stored or shared across different systems, or even applications. It creates a common data template that can be converted back and forth (serialized and deserialized) even when the source data is not one that is understood by the receiving system or application natively. There are various common formats that can be used (i.e XML, CSV,  Binary, or in our case, JSON), to serialize data into.

In our example, we’re going to create a class that lives within our application; a Sandwich. When we create an instance of it, it will exist in memory until we destroy it or the app is stopped. Once we turn off play mode in the unity editor (or close our window in a build), that data is gone. By serializing it, in this case to a text file using JSON, not only can we store it to the file system, but we can edit it offline and see the changes reflected in our application when we load it up again. This is all sort of odd-sounding without seeing it in action, so let’s get to it.

Categories
Unity

Unity and JSON – Quick Guide

I’m not a big fan of XML. It’s a bit heavy and dense, and though it’s effective, I just prefer JSON.

Introduction

But what IS Json? Well I’m not going to cover that, but some people smarter than I have already answered that question, so have a look over here and come back when you’re done.

If you’ve never used it, it may take a while to wrap your head around the inception-like dictionary-within-a-dictionary structure. But after you serialize and deserialize some data, you’ll get an idea of how it works.

Unity doesn’t have a built in solution for JSON. Though Unity supports JavaScript, it’s not quite the  same flavor you may have run across in web programming, it’s actually a different language, which is why more and more people are calling it UnityScript, instead. Why do I bring this up? Well, we can’t just use existing JavaScript libraries to incorporate JSON. There are alternatives, though! Let’s explore…

Categories
Unity Visual Studio

Visual Studio 2012 Surprises!

The Visual Studio 2012 product site is garbage. It’s hard to navigate, doesn’t give you meaningful information and doesn’t really boast about some of the coolest new features.

I use VS2012 when I’m developing on Windows because it’s awesome. Most of my work is in Unity, so I have it set as the default editor, so when I open scripts in Unity, they open in VS2012 by default.

A few days ago, I happened to double click an .fbx file on accident, and I was surprised to see the VS2012 loading screen popup. I figured it would open the FBX as a text file, and that would be that, but it was much more interesting than that.