Detours: redirecting C# methods at runtime
Detours

Detours: redirecting C# methods at runtime

Detours are a way to replace the implementation of a C# method. Basically, you take a method (typically from some assembly you don’t have the source for) and overwrite it…

Snippet: quickly re-encoding video files w/ ffmpeg on Windows
reencode.bat

Snippet: quickly re-encoding video files w/ ffmpeg on Windows

Quick .bat script to re-encode yt-dlp‘d video files to H.264

Ray-mesh intersection in Unity Editor
IntersectRayMesh

Ray-mesh intersection in Unity Editor

Unity has a built-in IntersectRayMesh function, but it’s internal and editor-only… here’s how you use it.

Forcing Unity inspectors to redraw every frame
RequiresConstantRepaint

Forcing Unity inspectors to redraw every frame

Use Editor.RequiresConstantRepaint to make sure your custom inspector doesn’t skip any updates

Notifying Unity about texture modifications
IncrementUpdateCount

Notifying Unity about texture modifications

Use Texture.IncrementUpdateCount() to let Unity know that a texture has changed

Snippet: partial repository cloning w/ git sparse-checkout
git sparse-checkout

Snippet: partial repository cloning w/ git sparse-checkout

Use git sparse-checkout and git clone --filter to clone only part of a large repository

Using Unity asset labels
Asset labels

Using Unity asset labels

Don’t get your hopes up

Calling managed code from Burst
Burst ➟ Mono

Calling managed code from Burst

Find out how to call Mono code from Burst-compiled jobs and functions