Tag: csharp

  • Building a Random Quest Generator

    Building a Random Quest Generator

    TL;DR I wanted a low maintenance way to generate random quests for my game. So I created an awesome Factory class that did not require maintenance or upkeep as I added new quests. Keep reading to find out how I did it… The ProblemA SolutionThe Code The Problem I’m building an RPG-themed idle/incremental game, where…

  • Unity’s Transform Implements IEnumerable

    Unity’s Transform Implements IEnumerable

    The Usage Imagine you’re playing a survival game and you unlocked stone buildings, now you can finally upgrade from a wooden cabin to a stone house. After you risk life and limb to gather enough stone you start the upgrade and boom your house transforms from wood to stone. The developers could have completely replaced…

  • Creating Custom Unity Script Templates

    Creating Custom Unity Script Templates

    In the past, everytime I created a script I made the same changes – I removed the comments around Start and Update and added some regions to organize my code. Standard housekeeping stuff, or put another way, tedious and repetitive work, exactly the type of work every dev dislikes. I wanted a better way. When…

  • Implementing IEquatable and IComparable

    Implementing IEquatable and IComparable

    The Path of Discovery Recently, I created a ResearchItem class for my game, and I realized I wanted to sort them in a specific, non-alphabetical way. In the past when I wanted to control the sorting process I created an int SortOrder field. That I easily controlled how my items were sorted. There are several…