Skip to content

Instantly share code, notes, and snippets.

View HilariousCow's full-sized avatar

Aubrey Hesselgren HilariousCow

  • Seattle
View GitHub Profile
@HilariousCow
HilariousCow / ExampleUse
Last active August 29, 2015 14:13
A Random float Range type: Adapted a bunch from http://www.grapefruitgames.com/blog/2013/11/a-min-max-range-for-unity/ ,When used, returns a random value between two ranges. IntRange coming soon...
//...
public class MyScript : MonoBehaviour
{
[FloatRange(-1f,1f)] //using this will make the randomModulator appear with double handles.
public FloatRange randomModulator;
@HilariousCow
HilariousCow / TransformExtensions
Created January 13, 2015 12:51
some handy extensions i use in unity to clean up pretty boring instantiate code
using UnityEngine;
using System.Collections;
public static class TransformExtensions
{
public static void SetLayer(this Transform trans, int layer)
{
trans.gameObject.layer = layer;
foreach(Transform child in trans)
child.SetLayer( layer);

Keybase proof

I hereby claim:

  • I am hilariouscow on github.
  • I am hilariouscow (https://keybase.io/hilariouscow) on keybase.
  • I have a public key whose fingerprint is D7E0 4954 0961 1466 0D8D 0845 43DC 7BB1 6526 D32A

To claim this, I am signing this object:

@HilariousCow
HilariousCow / gist:9132977
Created February 21, 2014 11:47
Ribbon Shader (expands an infinitely thin ribbon using direction to camera, and direction to next/prev ribbon node)
Shader "BezzyLines/VertexTextureAlpha" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"