Skip to content

Instantly share code, notes, and snippets.

View nilpunch's full-sized avatar

Daniil Pankevich nilpunch

View GitHub Profile
@nilpunch
nilpunch / AttackState.cs
Last active June 29, 2023 15:00
Simplest possible object-oriented FSM
public class AttackState : IBehaviorState
{
private readonly ICharacter _character;
public AttackState(ICharacter character)
{
_character = character;
}
public IBehaviorState Execute(long time)
@nilpunch
nilpunch / BillboardSprite.shader
Last active May 31, 2022 07:30
Billboard sprite shader.
Shader "Custom/Sprite Billboard"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
[Header(Aligning)]
_ScaleX ("Scale X", Float) = 1.0