Skip to content

Instantly share code, notes, and snippets.

View bartofzo's full-sized avatar

bartofzo bartofzo

View GitHub Profile
Shader "Hidden/JumpFloodOutline"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "PreviewType" = "Plane" }
Cull Off ZWrite Off ZTest Always
@bartofzo
bartofzo / LogRangeAttribute.cs
Last active December 22, 2023 19:48
Unity Logarithmic Range Slider
using System;
using UnityEditor;
using UnityEngine;
namespace Tools
{
/// <summary>
/// Add this attribute to a float property to make it a logarithmic range slider
/// </summary>
[AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)]
@bartofzo
bartofzo / smoothboolean.js
Created October 17, 2019 17:17
Helper class for animating on/off values
/**
* Helper class for animating on/off values
*
* (c) 2019 - Bart van de Sande
*
*/
export default class SmoothBoolean
{
/**
/**
*
* Provides an easy way to start animating on an event and keep doing new frame requests for X number of ms after the last poke has occured
*
* (c) 2019 - Bart van de Sande
*/
export default class AnimationFrameTail
{
constructor(tailDuration, callback)
@bartofzo
bartofzo / MonoBehaviourSingleton.cs
Last active October 1, 2019 11:15
Boilerplate for making a Unity GameObject a singleton
/**
*
* Boilerplate for making a Unity GameObject a singleton
* 2019 - Bart van de Sande / Nonline
*
*/
using UnityEngine;
public class MonoBehaviourSingleton<T> : MonoBehaviour where T : MonoBehaviourSingleton<T>