Skip to content

Instantly share code, notes, and snippets.

View andyman's full-sized avatar

Andrew Wang andyman

View GitHub Profile
@andyman
andyman / OutlineWhenObscured.shader
Created September 22, 2020 22:29
Rimlight when obscured shader for Timothy
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 March 8, 2020 11:31
Knot Team Pirate Jam Shanty
[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
@andyman
andyman / Commonly_Misspelled_Words.txt
Created January 12, 2020 21:17
Commonly Misspelled Words
"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"
@andyman
andyman / AutoSaveOnPlay.cs
Created September 28, 2018 10:41
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 / WebLocationChecker.cs
Created January 1, 2015 20:27
Simple script for Unity to check the domain that the web player is hosted on, and redirect it to the proper location if it is not in the list of domains. It does nothing if it is not a web player build.
using UnityEngine;
using System.Collections;
using System.Text;
/** Add this script to an object in the first scene of your game.
* It doesn't do anything for non-webplayer builds. For webplayer
* builds, it checks the domain to make sure it contains at least
* one of the strings, or it will redirect the page to the proper
* URL for the game.
*/
@andyman
andyman / AutoSaveOnPlay.cs
Created March 1, 2018 03:56
Automatically save the Unity scene when pressing play.
// 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 October 28, 2017 17:47
Pumpkin Chickpea Vegan Pizza Recipe v1.0.1
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 / WebLocationChecker.cs
Created March 25, 2016 14:12
WebLocationChecker.cs
using UnityEngine;
using System.Collections;
using System.Text;
/**
* WebLocationChecker by @andyman404
* Licensed under Creative Commons Zero (do with it as you want, no credit needed)
* https://creativecommons.org/publicdomain/zero/1.0/
*
* This script site-locks your Unity Webplayer/WebGL build.
@andyman
andyman / NormalTextureTextureProcessor.cs
Created January 20, 2017 22:22
Converts textures that end in _n or _normal to normal textures. Add this to your /Editor folder.
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 January 20, 2017 22:21
Add this to your /Editor folder in Unity to avoid importing materials for meshes.
using UnityEditor;
public class DontImportMaterials : AssetPostprocessor
{
public void OnPreprocessModel()
{
ModelImporter modelImporter = (ModelImporter) assetImporter;
modelImporter.importMaterials = false;
}
}