Skip to content

Instantly share code, notes, and snippets.

inline float inverselerp(float min, float max, float x)
{
return (x - min) / (max - min);
}
float hash(float n)
{
return frac(sin(n)*43758.5453);
}
// Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
Shader "Custom/Airwave"
{
Properties
{
_TintColor("Color", Color) = (1, 1, 1, 1)
_AlphaMask("Alpha Mask", 2D) = "white" {}
_WaveNormal("Wave Normal", 2D) = "white" {}
_WaveStrength("Wave Strength", Float) = 0.3
Shader "Custom/StandardGradientValue"
{
Properties
{
_Color ("Color", Color) = (1,1,1,1)
_Color2 ("Color2", Color) = (1, 1, 1, 1)
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_GradientScale ("Gradient Scale", Float) = 1.0
_GradientOffset ("Gradient Offset", Float) = 0.0
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
public static class ExportTerrainTrees
{
[MenuItem("Utilities/Export Terrain Trees")]
static void ExportTrees()
{
[ExecuteInEditMode]
public class IndoorMaskEffect : ImageEffectBase
{
void OnPostRender()
{
Graphics.Blit(null as RenderTexture, material);
}
}
public struct FloatRange
{
public float min;
public float max;
public FloatRange(float inMin, float inMax)
{
min = inMin;
max = inMax;
}
[MenuItem("Sausage Soccer/Screenshot Characters")]
static void ScreenshotCharacters()
{
SkinData[] skinData = Resources.LoadAll<SkinData>("Characters/SkinData");
Transform pivotRoot = Selection.activeGameObject.transform;
bool prevRootActive = pivotRoot.gameObject.activeSelf;
pivotRoot.gameObject.SetActive(false);
string directory = Application.dataPath + "/../CharacterUI/";
struct Input
{
float3 worldPos;
half4 screenPos;
half4 grabPassPos;
half4 waveUV;
half4 grabPos;
};
half _NormalScale;
using System;
using System.IO;
using System.Net;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Linq;
using System;
using System.IO;
using System.Net;
using System.Xml;
using System.Collections.Generic;
using System.Text;
using System.Collections;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Linq;