Skip to content

Instantly share code, notes, and snippets.

View Kpable's full-sized avatar

Lesther Kpable

View GitHub Profile
@Kpable
Kpable / ExecCalc_Damage.cpp
Last active August 22, 2025 22:05
Custom Unreal GAS Damage Calculation Execution
#include "AbilitySystem/ExecCalcs/ExecCalc_Damage.h"
#include "AbilitySystemComponent.h"
#include "AuraAbilityTypes.h"
#include "AuraGameplayTags.h"
#include "AbilitySystem/AuraAbilitySystemLibrary.h"
#include "AbilitySystem/AuraAttributeSet.h"
#include "AbilitySystem/Data/CharacterClassInfo.h"
#include "Interaction/CombatInterface.h"
@Kpable
Kpable / SpriteSelector.cs
Last active April 27, 2021 13:49
Sprite Selection component
using UnityEngine;
/// <summary>
/// Selects a sprite from an assigned group of sprites.
/// </summary>
[RequireComponent(typeof(SpriteRenderer))]
public class SpriteSelector : MonoBehaviour
{
/// <summary>
/// Group of sprites assigned in the inspector.
@Kpable
Kpable / SpriteFlip.cs
Created April 27, 2021 13:40
Sprite Flipping Component
using UnityEngine;
/// <summary>
/// Automatic Sprite fliping based on x movement.
/// Note: Assumes all sprites are right facing
/// </summary>
public class SpriteFlip : MonoBehaviour
{
private Vector3 movementVector;
@Kpable
Kpable / IInteractable.cs
Created April 27, 2021 13:21
Trigger based 2D Interaction System
/// <summary>
/// Interface for an interactable object
/// </summary>
public interface IInteractable
{
/// <summary>
/// Gets or sets a value indicating whether this object is being interacted with.
/// </summary>
bool Interacting { get; set; }
@Kpable
Kpable / PeriodicTimer.cs
Last active April 27, 2021 13:41
Periodic Timer Component
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// A timer that fires every time at the end of it's set duration and resets itself.
/// </summary>
public class PeriodicTimer : MonoBehaviour
{
/// <summary>
@Kpable
Kpable / OneShotTimer.cs
Last active April 27, 2021 13:42
One Shot Timer Component
using System.Collections;
using UnityEngine;
using UnityEngine.Events;
/// <summary>
/// A timer that fires once at the end of it's set duration.
/// </summary>
public class OneShotTimer : MonoBehaviour
{
/// <summary>
@Kpable
Kpable / README.md
Last active August 27, 2025 22:07
A robust, generic state machine for Unity that supports events, transitions, and flexible state management.

Unity Generic State Machine

A robust, generic state machine for Unity that supports events, transitions, and flexible state management. This system demonstrates core gameplay programming practices including modularity, event-driven design, and reusable AI architectures.

Features

  • Generic State Support
    Pass any enum type as state identifiers for a clean, type-safe API.
  • State Lifecycle Management
    Each state supports Enter, Update, and Exit callbacks.