Skip to content

Instantly share code, notes, and snippets.

Avatar

Andrew Wang andyman

View GitHub Profile
@andyman
andyman / OutlineWhenObscured.shader
Created Sep 22, 2020
Rimlight when obscured shader for Timothy
View OutlineWhenObscured.shader
Shader "Custom/OutlineWhenObscured"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
_MainTex("Albedo (RGB)", 2D) = "white" {}
_Glossiness("Smoothness", Range(0,1)) = 0.5
_Metallic("Metallic", Range(0,1)) = 0.0
_ObscuredColor("ObscuredColor", Color) = (1,0,0,1)
@andyman
andyman / knot_team_shanty.txt
Last active Mar 8, 2020
Knot Team Pirate Jam Shanty
View knot_team_shanty.txt
[CHORUS]
Yo ho ho
it's a pirate-jam-life for me
We code by day
and at night we sleep at sea
[VERSE (call and response)]
The theme this year:
uncertainty
View Commonly_Misspelled_Words.txt
"accommodate", not "accomodate"
"which", not "wich"
"receive", not "recieve"
"until", not "untill"
"occurred", not "occured"
"separate", not "seperate"
"government", not "goverment"
"definitely", not "definately"
"publicly", not "publically"
"liaison", not "liason"
View AutoSaveOnPlay.cs
// Place inside your Editor folder inside of Assets for it to save the current scene(s) when you run.
// The folder must be called "Editor", but can be nested within something else, e.g. Scripts/Editor
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
@andyman
andyman / AutoSaveOnPlay.cs
Created Mar 1, 2018
Automatically save the Unity scene when pressing play.
View AutoSaveOnPlay.cs
// Place inside your Editor folder inside of Assets for it to save the current scene(s) when you run.
// The folder must be called "Editor", but can be nested within something else, e.g. Scripts/Editor
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEditor.SceneManagement;
@andyman
andyman / pumpkin-chickpea-vegan-pizza.txt
Last active Oct 28, 2017
Pumpkin Chickpea Vegan Pizza Recipe v1.0.1
View pumpkin-chickpea-vegan-pizza.txt
Pumpkin Chickpea No-Knead Vegan Recipe
Makes 2 very filling 12-inch pizzas.
The vegan pizza ends up with a crispy style crust with a very filling protein-filled semi-sweet pumpkin/chickpea topping. Virgin coconut oil adds a surprising and creamy taste while the red bell peppers give a nod to more traditional pizzas.
I came up with this alternative-pizza recipe because I'm vegan (no animal products), and also have a conditional called Interstitial Cystitis (acidic/spicy/soy foods like tomato sauce, onions, and black pepper cause me pain and discomfort), and it's almost Halloween, and had a terrible vegan-pizza craving. If you don't have Interstitial Cystitis, then I'd recommend also adding onion and black pepper for additional taste.
This recipe has a simple mess-free no-knead dough that can be pre-made in bulk and refrigerated ahead of time for a week or two.
No-knead Crust/Dough Recipe
@andyman
andyman / NormalTextureTextureProcessor.cs
Created Jan 20, 2017
Converts textures that end in _n or _normal to normal textures. Add this to your /Editor folder.
View NormalTextureTextureProcessor.cs
using UnityEditor;
using UnityEngine;
using System.Collections;
public class NormalTextureTextureProcessor : AssetPostprocessor {
void OnPostprocessTexture(Texture2D texture) {
string lowerCaseAssetPath = assetPath.ToLower();
if (lowerCaseAssetPath.IndexOf("_n.") >= 0
@andyman
andyman / DontImportMaterials.cs
Created Jan 20, 2017
Add this to your /Editor folder in Unity to avoid importing materials for meshes.
View DontImportMaterials.cs
using UnityEditor;
public class DontImportMaterials : AssetPostprocessor
{
public void OnPreprocessModel()
{
ModelImporter modelImporter = (ModelImporter) assetImporter;
modelImporter.importMaterials = false;
}
}
@andyman
andyman / TiltSingleBehaviour.cs
Created Jan 20, 2017
Simple state machine behaviour to randomize an animator parameter at interval.
View TiltSingleBehaviour.cs
using UnityEngine;
using System.Collections;
public class TiltSingleBehaviour : StateMachineBehaviour {
public string xParameter = "tiltX";
public float minInterval = 1.0f;
public float maxInterval = 4.0f;
public float minValue = -1f;
@andyman
andyman / TiltBehaviour.cs
Created Jan 20, 2017
A simple state machine behaviour to randomly set two animator parameters at interval.
View TiltBehaviour.cs
using UnityEngine;
using System.Collections;
public class TiltBehaviour : StateMachineBehaviour {
public string xParameter = "tiltX";
public string yParameter = "tiltY";
public float minInterval = 1.0f;
public float maxInterval = 4.0f;