Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bcatcho on github.
  • I am bcatcho_dd (https://keybase.io/bcatcho_dd) on keybase.
  • I have a public key ASCOgsZRcYIZKoBns6wVmK8WkhCYgG9tIqfb16bJ63-hLwo

To claim this, I am signing this object:

@bcatcho
bcatcho / calculations.txt
Last active August 29, 2015 14:22
Backend for Game Design Tool
#
Start:
bld_townhall 1,
bld_factory 1,
bld_collector 1,
bld_settlement 2
@bcatcho
bcatcho / MITLicense2015.txt
Created March 14, 2015 04:26
My MIT License for 2015
The MIT License (MIT)
Copyright (c) 2015 Brandon Catcho
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@bcatcho
bcatcho / UniformTextureAtlasMeshRenderHelper.cs
Last active August 29, 2015 14:17
Unity 5 Behaviour to help with applying texture atlases to a model without changing UVs
// The MIT License (MIT) - https://gist.github.com/bcatcho/1926794b7fd6491159e7
// Copyright (c) 2015 Brandon Catcho
using UnityEngine;
using System.Collections.Generic;
namespace CatchCo
{
[RequireComponent(typeof(MeshRenderer))]
public class UniformTextureAtlasMeshRenderHelper : MonoBehaviour
{
@bcatcho
bcatcho / SetMaterialWithSpriteEditorWindow.cs
Last active December 29, 2017 16:22
Set a Material's main texture with a sprite.
// The MIT License (MIT) - https://gist.github.com/bcatcho/1926794b7fd6491159e7
// Copyright (c) 2015 Brandon Catcho
using UnityEngine;
using UnityEditor;
namespace CatchCo.EditorScripts.Util
{
public class SetMaterialWithSpriteEditorWindow : EditorWindow
{
private Material _material;
Shader "Custom/yar" {
Properties {
_ColorLow ("Color Low", COLOR) = (1,1,1,1)
_ColorHigh ("Color High", COLOR) = (1,1,1,1)
_yPosLow ("Y Pos Low", Float) = 0
_yPosHigh ("Y Pos High", Float) = 10
_GradientStrength ("Graident Strength", Float) = 1
_EmissiveStrengh ("Emissive Strengh ", Float) = 1
_ColorX ("Color X", COLOR) = (1,1,1,1)
_ColorY ("Color Y", COLOR) = (1,1,1,1)
@bcatcho
bcatcho / SpriteCombiner.cs
Last active July 26, 2021 02:50
Combine Unity3d Sprites
// The MIT License (MIT) - https://gist.github.com/bcatcho/1926794b7fd6491159e7
// Copyright (c) 2015 Brandon Catcho
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
#if UNITY_EDITOR
using System;
using UnityEditor;
using UnityEditor.Sprites;
// ---------------------------------
// 1. SETUP
// We need:
// - a frame buffer to do anything
// - a color render buffer to draw on off screen
// - a texture to paint with
// - and a mesh that describes where it is drawn
// THE FRAME BUFFER
GLuint framebuffer;
using UnityEngine;
using UnityEditor;
using System.Collections;
namespace CatchCo.Diagram.EditorScripts
{
public class SpriteHelperEditorWindow : EditorWindow
{
[MenuItem ("CatchCo/Sprite Helper")]
private static void Init ()
Shader "insula/env/outdoor" {
Properties {
_texture ("texture", 2D) = "white" {}
_fakeshadowcolor ("fake shadow color", Color) = (0.5,0.5,0.5,1)
_fakeshadowfacenormal ("fake shadow face normal", Vector) = (0,0,0,0)
_shadowspread ("shadow spread", Float ) = 0.95
_bgcolor ("bg color", Color) = (0.5,0.5,0.5,1)
_silhouette ("silhouette value", Range(0, 1)) = 1
_waterLevel ("water level", Float) = -2
_waterDepth ("water depth", Float) = 4