Skip to content

Instantly share code, notes, and snippets.

/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:[email protected]
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
@twobob
twobob / cpp_zahada.cpp
Created April 18, 2018 13:32 — forked from wermarter/cpp_zahada.cpp
Tiny Cutie Zahada Riddle Bot ( Using Web BRowser )
#include <windows.h>
#include <string>
#include <iostream>
using namespace std;
int main() {
string url; cin >> url;
url = "http://www.mcgov.co.uk/riddles/" + url + ".html";
ShellExecute(NULL, "open", url.c_str(), "", ".", SW_SHOWNORMAL);
return 0;
}
@twobob
twobob / dungeon_maker.py
Created June 17, 2018 02:41 — forked from Alex-Huleatt/dungeon_maker.py
Simple dungeon maker. Guaranteed connectedness.
'''
@author AlexHuleatt
Generate a simple, connected dungeon. Focus is on rooms, not maze-like features.
Output of get_dungeon is two sets:
1. A set of (y,x) tuples representing the position of walls
2. A set of (y,x) tuples representing the walls removed to make doors
Guaranteed connectedness between all open cells.
@twobob
twobob / A set of Unity3D extension methods
Created August 18, 2018 18:28 — forked from omgwtfgames/A set of Unity3D extension methods
Some useful extension method for Unity3D
A collection of useful C# extension methods for the Unity engine.
@twobob
twobob / Dungeon.cs
Created August 25, 2018 23:16 — forked from xDavidLeon/Dungeon.cs
Zelda Dungeon Generator for Unity 3D
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Dungeon : MonoSingleton<Dungeon>
{
[System.Serializable]
public class Position
{
public int x = 0;
@twobob
twobob / ToonDeferredShading2017.shader
Created August 25, 2018 23:18 — forked from xDavidLeon/ToonDeferredShading2017.shader
Unity 5.6 Deferred Cel Shading Modification
// Unity built-in shader source. Copyright (c) 2016 Unity Technologies. MIT license (see license.txt)
// Modifications by David Leon. Copyright (c) 2017 Lince Works SL. MIT license (see license.txt)
Shader "ToonDeferredShading2017" {
Properties {
_LightTexture0 ("", any) = "" {}
_LightTextureB0 ("", 2D) = "" {}
_ShadowMapTexture ("", any) = "" {}
_SrcBlend ("", Float) = 1
_DstBlend ("", Float) = 1
using UnityEngine;
public class SimpleSoundManager:MonoBehaviour {
// Audio source
private AudioSource musicSrc;
private AudioSource effectSrc;
// Instance variable
private static SimpleSoundManager instance;
// Instance
@twobob
twobob / MeshCut.cs
Created September 7, 2018 08:28 — forked from alexcmd/MeshCut.cs
Mesh cut algorithm for Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class MeshCut
{
private static Plane blade;
private static Transform victim_transform;
private static Mesh victim_mesh;
@twobob
twobob / SkinnedMeshCombiner.cs
Created September 8, 2018 01:31 — forked from radiatoryang/SkinnedMeshCombiner.cs
example code for combining SkinnedMeshRenderers at runtime (for optimization reasons usually), which I use in my games for Mixamo Fuse models specifically... PLEASE DON'T ASK ME FOR HELP WITH THIS, this is more for learning purposes, and it's not really an easy-to-use Asset Store thing? also I have a lot of weird hacks specific for my uses... ag…
// this code is under MIT License, by Robert Yang + others (credits in comments)
// a lot of this is based on http://wiki.unity3d.com/index.php?title=SkinnedMeshCombiner
// but I removed the atlasing stuff because I don't need it
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
@twobob
twobob / FreeFormDeformer.cs
Created September 8, 2018 01:35 — forked from Jerdak/FreeFormDeformer.cs
Example of free form deformation using Unity. Full package can be found in my main repository: https://github.com/Jerdak/FreeFormDeformation/tree/master/Unity
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// Helper class that represents a parameterized vertex
/// </summary>
public class Vector3Param {
///bernstein polynomial packing