Skip to content

Instantly share code, notes, and snippets.

@CharlieHess
CharlieHess / CircularTextMeshPro.cs
Last active August 3, 2025 12:46
Improved CircularTextMeshPro using OnPreRenderText
using UnityEngine;
using TMPro;
using Sirenix.OdinInspector;
/// <summary>
/// An extension of TextMeshPro that causes the text to be displayed in a
/// circular arc.
///
/// Adapted from https://github.com/TonyViT/CurvedTextMeshPro and improved.
/// TonyViT's version has some unnecessary properties and doesn't use the
@yasirkula
yasirkula / SceneViewObjectPickerContextWindow.cs
Last active April 8, 2026 11:05
Select the object under the cursor via right click in Unity's Scene window
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using UnityEditor;
using UnityEngine;
using UnityEngine.Pool;
using UnityEngine.UI;
public class SceneViewObjectPickerContextWindow : EditorWindow

GPU Instancing for GameObjects

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

@Kryzarel
Kryzarel / EasingFunctions.cs
Last active April 6, 2026 17:57
C# Easing Functions
using System;
namespace Kryz.Tweening
{
// Made with the help of this great post: https://joshondesign.com/2013/03/01/improvedEasingEquations
// --------------------------------- Other Related Links --------------------------------------------------------------------
// Original equations, bad formulation: https://github.com/danro/jquery-easing/blob/master/jquery.easing.js
// A few equations, very simplified: https://gist.github.com/gre/1650294
// Easings.net equations, simplified: https://github.com/ai/easings.net/blob/master/src/easings/easingsFunctions.ts
@yasirkula
yasirkula / MultiScreenshotCapture.cs
Last active February 23, 2026 12:18
Capture multiple screenshots with different resolutions simultaneously in Unity 3D
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using UnityEditor;
using UnityEngine;
namespace MultiScreenshotCaptureNamespace
{
internal static class ReflectionExtensions
@andyraddatz
andyraddatz / ASCIIStringExtensions.cs
Last active January 20, 2026 08:51
C# String extension method to fold diacritics to ASCII characters
// IMPORTANT
using System.Collections.Generic;
using System.Text;
// This gist was created thanks to this comment from Alexander on StackOverflow:
// https://stackoverflow.com/questions/249087/how-do-i-remove-diacritics-accents-from-a-string-in-net#comment86833005_34272324
// This is a derivative work. The logic of this function comes from a switch statement found inside the
// Lucene.Net library. The documentation of the conversion of characters is quite impressive
// (thank you @NightOwl888 and @synhershko !!!):