Skip to content

Instantly share code, notes, and snippets.

@AliBharwani
AliBharwani / URPPatchValidator.cs
Created April 2, 2026 15:50
Patch for analytic soft shadows asset in URP
// URPPatchValidator.cs
// Auto-patches URP's Lighting.hlsl to add global UASS (Analytic Soft Shadows) shadow receiving.
// Makes ALL Lit-based materials (including ShaderGraph Lit) receive UASS shadows without
// needing to swap to the standalone "Lit + AnalyticShadows" shader.
//
// Drop this in an Editor/ folder in your Unity project. It runs on every domain reload.
// Tested on Unity 6000.0.3 / URP 17.0.3 — anchor strings may need updating for other versions.
//
// Optional: Add this to your standalone "Lit + AnalyticShadows.shader" around its
// TEXTURE2D_X(_UASSTexture) declaration to avoid duplicate definition errors:
@AliBharwani
AliBharwani / ArrowTipTrigger.cs
Last active February 6, 2025 17:35
Piercing Arrow in Unity
using UnityEngine;
public class ArrowTipTrigger : MonoBehaviour
{
void OnTriggerEnter(Collider other)
{
SendMessageUpwards("OnArrowTipTriggerEnter", other, SendMessageOptions.RequireReceiver);
}
}