Here are most of the Unity plugins / C# code I’m using for Riflestorm.
C Sharp Promise
C Sharp Promise let you easily handle anything async in your game. I use this library everywhere, for things like waiting for an animation to complete, or the camera to move to a certain place. Promises can even be chained, meaning when one action is done, then the next action is ran.
It also has a wait promise which waits for a set time then completes.
return camera.EaseCenterTo(entity)
.Then(entity.Revive)
.Then(() => waitUtil.WaitFor(0.2f));
Open Terminal
Open Terminal creates an in-game terminal which can run your pre-defined commands at any time. This saves time during testing because I have commands for almost everything, like giving money, spawning an enemy, or instantly winning a level. These commands can be run while the game is running in the editor or in a build.
Moonsharp
Moonsharp lets you run Lua scripts from Unity. Because Riflestorm is procedurally generated, I have scripts for generating campaigns / levels, playing cutscenes and basic AI logic. It’s very easy to setup and saves a lot of time because scripts are easy to type out. Although in the future I might switch to mruby – a ruby equivalent.
This is unmaintained so watch out.
iTween
Just like from my Flash games, iTween lets you do things like move the camera to a position over a certain period of time. This is also coupled with a promise so I can do things like:
camera.EaseCenterToTile(targetPos, .3f))
.Done(() => Debug.Log("I'm done moving"));
Protobuf Unity
Protobuf Unity is a thin wrapper around Google’s Protobuffer. This lets you create non-breakable save files, meaning no matter what changes are made to the game in the future the save file will never break. This is huge and worth the hassle to setup – no one wants their save file to break because of a version update. In fact I believe this is the number one complaint for Early Access games.
The way it works is each property has it’s own unique id, so as long as you don’t change the ids, the save file will always be readable, even for other versions of the game.
You’ll need to create your own proto file like below:
message Game {
Squad squad = 1;
Campaign campaign = 2;
Inventory inventory = 3;
map<string, bool> campaign_completions = 4;
int64 last_save_date = 5;
int32 difficulty = 6;
int32 cash = 7;
int32 total_days = 8;
int32 cutscene = 9;
}
Google proto buff will then generate a C# class for you to use.
Flash Sprite Sheet Importer
Flash Sprite Sheet Importer is a free asset in the Unity store which lets you import Animate CC spritesheets into Unity. One downside is it doesn’t let you set the pivot points or names for the sprites it generates. So I have heavily modified the source code to allow that.
Textmesh Pro
Textmesh Pro gives you great looking fonts and supports to great features like shadows and glows. It’s free, better than Unitys text component and there is no reason not to use it.
Zenject
Zenject is a free dependency injection framework, meaning it lets you define all your project dependencies in an installer file and you can grab those dependencies from anywhere in the game. It doesn’t sound useful but I highly recommend it.
Your code will end up looking like this:
[Inject]
EntityDieSignal dieSignal;
[Inject]
MiniStatuses miniStatuses;
[Inject]
public RespawnTicker respawnTicker { get; private set; }
[Inject]
public TurnBubble turnBubble { get; private set; }
Thread Ninja
Thread Ninja is a simple thread framework, it makes threads easy to run by making them look like coroutines.
Unity Gradient Background
Unity Gradient Background replaces the ugly solid color behind the camera with a clean gradient.