You are here

Automatic Quality Adaption for Unity3D

While most gamers enjoy having as many options as possible to fine-tune the look and performance of the games they play, this is not always possible or advisable to do.

Especially in therapy games, where games are on one hand used by non-hardcore gamers that are oblivious to those possibilities and on the other hand are likely to be played on systems that have not been built to be used as powerful gaming machines, another solution is needed.

The following MonoBehaviour can easily be added to a project and adapts the quality of a game automatically in order to provide smooth frame rates.


Simple Version Numbering in Unity3D

Keeping track of different builds of (Unity) games can occasionally be convoluted, especially if you’re in a workflow where you also have to provide installers with your builds. With different testers potentially testing different versions, it’s easy to lose track what bug is fixed in what version or build.

Luckily, Unity3D is based on Mono (.NET), and therefore the problem can be solved by simply dropping in a new MonoBehaviour. Read on for how it works.


Clean-Up Day: New Tricks with C#

Since I’m currently cleaning up my code to hand it in with my project, I figured I could write some of the stuff down I learned during my work on our game.

All of it applies, of course, to C#, and was used in Unity 3D.

Checking for a type

Using the is keyword, you can easily check whether a certain object is of a desired type. Also, you should be aware of the as keyword, that allows you to cast an object as something else (given that this is possible).


How to Format a Time String with C# in Unity 3D

(This is only here for personal reference, since this is rather basic programming …)


/// Formats the input string (in seconds) as a human readable /// string in the form of MM:SS. /// /// /// A of the current playing time. /// private string formatedTimeString (string input) { int seconds; int minutes;


Losing It: When Unity3D Is Unable To Find Its Objects in the Build Anymore

When preparing my game for Fantoche, I ran into problems several times, since upon building my game, the screen either remained black or parts of my game did not work, with the log showing a NullReferenceException.

In both times, it was related to me tagging objects in the Unity 3D editor. This is caused by the somewhat peculiar implementation of tagging in Unity which only allows one tag to be added to an object.