Skip to content

Instantly share code, notes, and snippets.

@docky
docky / FadeInOut.cs
Created April 20, 2012 14:38
FadeInOut unity component - easy fading of objects
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Game : MonoBehaviour
{
public static Game instance;
public Player player;
public int score = 0;
@LotteMakesStuff
LotteMakesStuff / StatsBarAttribute.cs
Last active January 23, 2025 01:57
StatsBar property drawer for Unity~ Add a [StatsBar] attribute to a property to make it draw a lil bar, really useful for visualizing character stats like Health or Mana.
// NOTE DONT put in an editor folder
using UnityEngine;
public class StatsBarAttribute : PropertyAttribute
{
public string valueMax;
public StatsBarColor color;
public StatsBarAttribute(string valueMax = null, StatsBarColor color = StatsBarColor.Red)
@probablyspoonie
probablyspoonie / ToonTerrain.cginc
Last active April 2, 2024 02:00
Toon Terrain Tutorial
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Edits by Glynn Taylor. MIT license
// Includes code for splitmap by https://twitter.com/adamgryu and triplanar mapping by https://github.com/keijiro. MIT License
#ifndef TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED
#define TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED
struct Input
{
float3 localNormal : TEXCOORD0;
@docky
docky / ToonTerrain.cginc
Created February 14, 2021 22:33 — forked from probablyspoonie/ToonTerrain.cginc
Toon Terrain Tutorial
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Edits by Glynn Taylor. MIT license
// Includes code for splitmap by https://twitter.com/adamgryu and triplanar mapping by https://github.com/keijiro. MIT License
#ifndef TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED
#define TERRAIN_SPLATMAP_COMMON_CGINC_INCLUDED
struct Input
{
float3 localNormal : TEXCOORD0;