• Whitelisting subdirectories in Git

    After having migrated the development of Grid Framework to Git I wanted to set it up to track only certain sub-directories. I turned out that whitelisting is quite tricky, so here is how I did it for people who might run into the same problem.

    Continue reading…

  • CheckComponent()

    Here is a quick but handy tip. Recently I found myself needing to reference various components in my script without knowing if they exist. I have to get the component and then check if it exists, and if not add it to prevent null exceptions. Here is what you would write in such a case:

    Continue reading…

  • Unity and properties/accessors

    As mentioned in the previous post I'd like to relate my experience with using properties in Unity and how to make them work properly. Properties are a C# feature and not available in UnityScript (another reason to ditch UnityScript). To help demonstrate what I mean I will be using a "circle" class.

    Continue reading…

  • Hex Grid introduction video

    I made a short video giving you an overview of hex grids, so you can see them right in action. I'll make a video on how to extend Grid Framework with your own methods yourself next,

    Continue reading…

  • Swap variables in Unity

    I've decided to go with one HexGrid class and provide enough options. To do this I will need to swap around variables so I can use the same formulae for different cases. I could write the swapping part where it is needed, but then I'd be writing the same thing several times (which is a bad thing to do). Wouldn't it be better if there was some sort of swapping function? Could that function work for any type of variable? Could it work without needing to reassign variables again? Yes to all of that:

    Continue reading…