Context Menu buttons automatically format spritesheet and setup Sprite Library Asset.
Each hamster in the Hamster Ball Blitz! has distinct sprites and animations. I created a system and animation import pipelines to allow for using different sprite sheets for the same animations.
I created a custom Context Menu button in the Editor that automatically divides a spritesheet into individual sprites and then adds each sprite to a Sprite Library.
Our character animations choose the corresponding frame in the Sprite Library to render.
These tools I created resulted in faster importation of animation spritesheets that allowed for faster iteration and a larger cast of characters.
Sprite Library Asset
Character Animations render corresponding sprite in Sprite Library.
This system allowed us to have unique sprite sheets for each character in the game while preserving clean code architecture. The most exciting usage of this feature was the game's final boss Chunky Sandwich who replaces the typical hamster ball animations entirely and rolls around the arena with his large body.
The code below shows an example of how to get input using a Pawn. The Pawn class has two functions that are executed whenever input is received: OnActionPressed and OnActionReleased. To determine which button was pressed, we need to evaluate the name string of the context parameter.
public class ExamplePawn : Pawn {
// Variables
Vector2 moveInput = Vector2.zero;
// Handle input
protected override void OnActionPressed(InputAction.CallbackContext context) {
if (context.action.name == PawnAction.Move) {
moveInput = context.ReadValue<Vector2>();
// Handle movement in Update
}
if (context.action.name == PawnAction.ButtonA) {
// Jump
}
}
}
To improve usability when comparing against the string values, we have provided a static class named PawnAction which contains constant string variables for each possible action.
Menu allows for quick editing of gameplay values for A/B testing and design iteration
Playest session data saved to Excel sheet for analysis
Sprite renders different front/back animations for each camera
Scene rendered from OBJ and MTL files