Tag Archives: howto

How to fix build error with UnityAds after upgrading to Unity 5

Is your Unity project using UnityAds? Did you just update to Unity 5? Are you now seeing an error when trying to build for Android? The read on…

Unity 5 now includes in-built support for UnityAds, without requiring the UnityAds plugin from the Asset Store. As such, if you’ve previously imported the plugin, Unity might complain. It may simply be fixable by choosing Assets > Reimport All (which might make Unity realise it should ‘ignore imported version’ of UnityAds). Continue reading How to fix build error with UnityAds after upgrading to Unity 5

Unity – How to make things see where they’re going

While developing a game, I wanted to enable characters to “see” where they’re going; that is, to tell them what they’re about to stumble into, without using colliders. The answer was to cast a Ray, angled slightly downward,  in front of the character, so he can “see” if he’s about to walk into a tree, or a river, before it happens. Continue reading Unity – How to make things see where they’re going

SmoothBitmap – How to enforce pixel smoothing on a Bitmap

A common oversight when using Bitmaps with loaded content is that Flash will revert a Bitmap’s smoothing parameter to false when you replace its bitmapData. It’s simple enough to fix, but since you may not know if someone is going to replace the bitmapData of a Bitmap you have created – then it’s often better to code defensively around it.

This little SmoothBitmap class is for just such an occassion. Instantiate it like a regular Bitmap and, no matter what another developer does with it, smooth pixels when scaling/rotating will be ensured.

Dependency Injection by Extension pattern

Since I’m not sure whether I have indeed invented a new design pattern here. So, alternative titles for this post include:

  • Dependency Injection without a Dependency Injection framework
  • Why misuse of the default namespace for tests is pure evil
  • How to make your code more testable without completely messing it up

Continue reading Dependency Injection by Extension pattern