Skip to content

Instantly share code, notes, and snippets.

@adammyhre
adammyhre / ProjectSetup.cs
Last active November 5, 2025 08:55
Automated Unity Project Setup Script
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
using UnityEngine;
using static System.Environment;
@FronkonGames
FronkonGames / TailwindColors.cs
Last active February 24, 2026 19:29
Tailwind color palette for Unity.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// _______ _ _ _ _ _____ _
// |__ __| (_) | (_) | | / ____| | |
// | | __ _ _| |_ ___ _ __ __| | | | ___ | | ___ _ __ ___
// | |/ _` | | \ \ /\ / / | '_ \ / _` | | | / _ \| |/ _ \| '__/ __|
// | | (_| | | |\ V V /| | | | | (_| | | |___| (_) | | (_) | | \__ \
// |_|\__,_|_|_| \_/\_/ |_|_| |_|\__,_| \_____\___/|_|\___/|_| |___/
//
// An expertly-crafted color palette out-of-the-box that is a great starting point if you don’t have your
// own specific branding in mind. Based on https://tailwindcss.com/docs/customizing-colors
@pema99
pema99 / WorldPositionFromDepth.shader
Created September 15, 2023 19:24
WorldPositionFromDepth thx d4rkpl4y3r and lox
Shader "Unlit/GridAllocation"
{
SubShader
{
Tags { "Queue" = "Overlay" }
ZTest Always
Pass
{
CGPROGRAM
@pema99
pema99 / AudioLinkUI.shader
Last active February 26, 2024 09:12
AudioLinkUI V3
Shader "AudioLink/AudioLinkUI"
{
Properties
{
_Gain("Gain", Range(0, 2)) = 1.0
[ToggleUI] _Autogain("Autogain", Float) = 0.0
_Threshold0("Low Threshold", Range(0, 1)) = 0.5
_Threshold1("Low Mid Threshold", Range(0, 1)) = 0.5
_Threshold2("High Mid Threshold", Range(0, 1)) = 0.5
@xavierarpa
xavierarpa / PackageCreator.cs
Last active May 27, 2024 06:35
Folder to package.tgz
#if UNITY_EDITOR
using System.IO;
using UnityEditor;
using UnityEditor.PackageManager;
using UnityEditor.PackageManager.Requests;
public static class PackageCreator
{
public static void CreateTgzPackage(string packagePath, string sourcePath)
{
PackRequest packRequest = Client.Pack(sourcePath, packagePath);
@Matthew-J-Spencer
Matthew-J-Spencer / PlayerAnimator.cs
Created July 6, 2022 11:30
Control unity animations using code. Video: https://youtu.be/ZwLekxsSY3Y
using System;
using UnityEngine;
using UnityEngine.Tilemaps;
using Random = UnityEngine.Random;
public class PlayerAnimator : MonoBehaviour {
[SerializeField] private float _minImpactForce = 20;
// Anim times can be gathered from the state itself, but
// for the simplicity of the video...
Shader "Unlit/ScreenVertPos"
{
Properties
{
[IntRange] _Width ("Texture Size (POT)", Range(0, 13)) = 7
}
SubShader
{
Pass
{
@Goropocha
Goropocha / SignInWithApplePostprocessor.cs
Created March 27, 2021 08:13
Sign in with Apple Unity Plugin の Xcode 設定自動化
#if UNITY_IOS
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEditor.iOS.Xcode;
using AppleAuth.Editor;
/// <summary>
/// Xcode 設定自動化
/// </summary>
@yasirkula
yasirkula / DuplicateAssetDetector.cs
Last active September 1, 2025 15:29
Find duplicate assets in Unity
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Security.Cryptography;
using UnityEditor;
using UnityEditor.IMGUI.Controls;
using UnityEngine;
using Object = UnityEngine.Object;
@Meorawr
Meorawr / async.lua
Last active September 8, 2024 20:17
Lua 5.1 Async/Await
#!/usr/bin/lua5.1
--- Async/Await for Lua 5.1
-- This script implements async/await functions for Lua, allowing tasks to
-- be queued and scheduled independently.
--
-- This is just an example and has a bunch of issues, isn't tested, isn't
-- even actually used anywhere; I basically just got bored and had one of
-- those "what if?" type ideas 6 hours ago.
local co_create = coroutine.create