Skip to content

Instantly share code, notes, and snippets.

View andrew-raphael-lukasik's full-sized avatar
🏴‍☠️

Andrew Raphael Lukasik andrew-raphael-lukasik

🏴‍☠️
View GitHub Profile
@andrew-raphael-lukasik
andrew-raphael-lukasik / .SpacingBetweenItemsInListView_EditorWindow.cs.md
Last active February 19, 2025 18:42
Set of assets showing how to create `ListView` with space between elements
@andrew-raphael-lukasik
andrew-raphael-lukasik / .The Farmer Was Replaced.md
Last active April 1, 2025 07:53
"The Farmer Was Replaced" maze solver
@andrew-raphael-lukasik
andrew-raphael-lukasik / MinimumFsmBasedAiController.cs
Last active July 4, 2024 21:10
Goal: to write the most simple yet most useful FSM that convinces Unity devs who still use bool fields to keep track of ai states to change their misguided ways for the better.
using UnityEngine;
public class MinimumFsmBasedAiController : MonoBehaviour
{
public enum EState : byte
{
START = 0,
PATROL,
INVESTIGATE,
ATTACK,
@andrew-raphael-lukasik
andrew-raphael-lukasik / .VoxelCollisionGenerator.cs.md
Last active February 6, 2025 12:30
Tool to voxelize a Mesh Collider into multiple Box Colliders

GIF 21 01 2024 01-20-34

note: This is toy implementation, output is sub-optimal.

@andrew-raphael-lukasik
andrew-raphael-lukasik / .PhysicsJointDebugSystem.cs.md
Last active January 14, 2024 17:56
System to inspect `PhysicsJoint` and `PhysicsConstrainedBodyPair` data

System to visually inspect PhysicsJoint and PhysicsConstrainedBodyPair data

Written for entities 1.0.16, physics 1.0.16

Screenshot 2023-11-29 165444

// src* https://gist.github.com/andrew-raphael-lukasik/b00a59509cbe8fa2b15b1949fa4f4ad2
using System.Collections.Generic;
public struct MinHeap <T>
where T : System.IComparable<T>
{
List<T> _stack;
public int Length => _stack.Count;
public int Count => _stack.Count;
@andrew-raphael-lukasik
andrew-raphael-lukasik / .billboard-shadow.shadergraph.md
Last active March 22, 2025 20:02
Shader Graph files to create billboard trees with billboard shadows. Exported from Unity 2023.2 and Shader Graph 16.0.4

Shader Graph files to create billboard trees with billboard shadows. Exported from Unity 2023.2 and Shader Graph 16.0.4

GIF 17 11 2023 14-38-35

Note: Shaders written for default Quad meshes in mind.

To make sure shadows are being drawn always behind tree billboards change shadow material’s Sorting Priority to a negative value:

Screenshot 2023-11-17 145239

@andrew-raphael-lukasik
andrew-raphael-lukasik / .TV_Noise.shadergraph.md
Last active November 12, 2023 19:52
Shader graph to render pixelated, old TV-like noise

GIF 10 11 2023 13-40-46

@andrew-raphael-lukasik
andrew-raphael-lukasik / .ColorPickerElement.cs.md
Last active January 31, 2025 20:19
basic color picker for UI Toolkit

Color picker / UI Toolkit

GIF 08 11 2023 01-37-22

Answers a question: "How to make enemies surround player"

  • AttackSpotProvider.cs provides attack positions to attackers.
  • Attacker.cs simulates an attacker

GIF 05 10 2023 20-52-29