Press "Enter" to skip to content

Tag: unity

Serial Com Ports in Unity (+Arduino stuffs)

Hey everyone! Sorry it’s been such a long time. I’ve been super busy with work and all most of the stuff I’m working on cannot be shared publicly. However, one project I’m working on requires Serial Port communications and the scripts I had been using started to lock up and no longer work. It’s a common pain with Serial Ports and threading in Unity’s .NET. Threads don’t close, ports don’t close, programs lock up, etc, etc. So I spent some of my personal time enhancing DWilches’ SerialCommUnity project on Github. DWilches’ SerialCommUnity project is a great basis for doing serial…

Loading

1 Comment

Data Serialization Part 2 – Unity3D, Json.NET, and Twitter REST API

Why Json.NET? Unity does now include a Json utility, but it falls flat in many cases. It doesn’t serialize nested classes well (classes with multiple levels of inheritance), it can’t rename the Json object’s variables to something more appropriate for your code base, and there’s really not a lot of options. However, it does claim to be “…significantly faster than popular .NET JSON solutions…”. One of my favorite features of Json.NET is that it can easily serialize private fields and public fields with private setters. This allows for maintaining access restriction in you code base’s models without requiring the use…

Loading

Leave a Comment

Implementing Touch Controls in Unity 3D

Throughout the ages games have been controlled in a variety of ways: joysticks, gamepads, mouse & keyboard, and many more! With the advent of mobile devices new styles of input have become available to us, namely touch screen controls. In this tutorial you’ll learn how to implement two different styles of touch input in Unity: Virtual joystick: This is where buttons on the screen that are similar to a gamepad or joystick are used. Direct interaction: This is where the player directly interacts with objects in the game to control their movement, firing, and other actions. Unity makes it incredibly…

Loading

2 Comments

Saving Data in Unity 3D (Serialization for Beginners)

With games we almost always need to save some data: scores, inventory, progress, preferences, etc. There are many ways to do this in Unity. In this article I’ll take you through a few different ways to save data and hopefully encourage some good habits when structuring your applications for saved data. There are two main levels of persistency for data: Session Data (data doesn’t necessarily need to be remembered the next time you load up the application): This is usually done via static variables and is used for only values that matter for the current session. Most commonly this is for…

Loading

11 Comments

Unity3D Certification Courseware Review

Hi everyone! I’ve been prepping for the Unity Certification that I’ll be taking at Unite LA next week. For preparation I decided to work through the Unity Courseware. I received 30-day access to it for “free” when I subscribed to Unity Plus so it was a double win! I figured that I should review it as well so that others know what they’re getting for their money. Please note that I’m sure they’ll be making improvements in the future, so this review may/may not be valid in a few months. You have multiple options to rent the courseware. The cheapest…

Loading

2 Comments

Diagnostics

Ever have a bright idea and think to yourself “oh, man, this is going to be so much faster”? Well, I do often, and often I find out that I’m a dummy. But that’s OK! We need to learn. So how do you find out your bright idea is as bright as a black hole? Diagnostics. The tool I tend to use most is simply the Stopwatch provided by the System.Diagnostics namespace. It’s pretty simple and provides that much-needed insight to the age-old question: “Is this method better than that method”. In this article I’ll take you through a couple…

Loading

Leave a Comment