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 / .UIDocumentLocalization.cs.md
Last active April 26, 2024 07:50
Text localization script for UIDocument (UI Toolkit @ Unity)

pattern to follow

// NOTE: this class assumes that you designate StringTable keys in label fields (as seen in Label, Button, etc) // and start them all with '#' char (so other labels will be left be)

@andrew-raphael-lukasik
andrew-raphael-lukasik / .ObjFileFormatVertexColorImporter.cs.md
Last active April 24, 2024 10:13
OBJ file format vertex color importer for Unity

(Unity) vertex color importer for MeshLab's OBJ files

@andrew-raphael-lukasik
andrew-raphael-lukasik / .LetFindNearestTargets.cs.md
Last active April 23, 2024 21:39
| How to use TransformAccessArray | How to add Transform to TransformAccessArray mid execution | How to remove Transform from TransformAccessArray mid execution |

24gevbpq93uREUwegh9u32ibqae9uyshdfbwep23ugo99832ewuTW$Ewwt

@andrew-raphael-lukasik
andrew-raphael-lukasik / .VoxelCollisionGenerator.cs.md
Last active April 22, 2024 10:36
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 / .GpuInstancingForGameObjects.cs.md
Last active April 15, 2024 15:32
GPU Instancing for GameObjects

GPU Instancing for GameObjects

frustum culling, multiple materials are being segregated into batches with their own AABB:

@andrew-raphael-lukasik
andrew-raphael-lukasik / MinimumFsmBasedAiController.cs
Last active April 13, 2024 14:54
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 / .LabelAutoFit.cs.md
Last active April 11, 2024 22:52
Custom Label element for Unity / UI Toolkit stack

unity UiToolkit label text auto fit width height this code is NOT production-ready, it's just a sketch to test out a possible solution for a problem

IMPORTANT NOTE: This elemeent doesn't work with flexGrow as it leads to undefined behaviour (recursion). Use Size/Width[%] and Size/Height attributes instead requirement

@andrew-raphael-lukasik
andrew-raphael-lukasik / .LetsRotateAndSpawn.cs.md
Last active April 11, 2024 22:52
object orientation placement schemes

image0 image1

@andrew-raphael-lukasik
andrew-raphael-lukasik / .CarsAISystem.cs.md
Last active March 26, 2024 21:51
job system for basic steering behavior at scale

img1 img2

@andrew-raphael-lukasik
andrew-raphael-lukasik / random projects & daily coding exercises.md
Last active March 3, 2024 17:31
random projects & daily coding exercises

random projects & daily coding exercises

AI

crowd steering