Skip to content

Instantly share code, notes, and snippets.

@birdinforest
birdinforest / memory-test.ts
Created September 12, 2020 05:35 — forked from connorjclark/memory-test.ts
memory leak test
import { ChildProcess, spawn } from 'child_process';
import * as puppeteer from 'puppeteer';
const DEBUG = Boolean(process.env.DEBUG);
const CI = Boolean(process.env.CI);
const QUERY = Boolean(process.env.QUERY);
jest.setTimeout((QUERY ? 200 : 100) * 1000);
interface MemorySample {
@birdinforest
birdinforest / CameraLookAt.cs
Last active September 13, 2016 04:46 — forked from col000r/CameraLookAt.cs
CameraLookAt
using UnityEngine;
using System.Collections;
/// <summary>
/// Put this script on a camera, assign a target and the camera will always look at that target, smoothly following it.
/// </summary>
public class CameraLookAt : MonoBehaviour {
public Transform target; //Look at this
private Transform aimTarget;
@birdinforest
birdinforest / ObliqueCameraProjection.cs
Last active September 13, 2016 04:47 — forked from mstevenson/ObliqueCameraProjection.cs
Oblique Camera Projection
using UnityEngine;
using System.Collections;
public class ObliqueCameraProjection : MonoBehaviour
{
private Matrix4x4 originalProjection;
public Vector2 slideViewport;
public Vector2 slideFrustum;
public Vector2 slideFarClip; // compound slideViewport and slideFrustum
public Vector2 skew;
using UnityEngine;
using UnityEditor;
//Version 0.21 | twitter:@izm update for DK2
//Version 0.2 | s.b.Newsom Edition
//Source from http://answers.unity3d.com/questions/179775/game-window-size-from-editor-window-in-editor-mode.html
//Modified by seieibob for use at the Virtual Environment and Multimodal Interaction Lab at the University of Maine.
//Use however you'd like!
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
[RequireComponent (typeof(SpriteRenderer))]
public class SpriteAnimator : MonoBehaviour
{
public List<Sprite> frames = new List<Sprite> ();
public float fps = 15;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public delegate void InputKeyDelegate (KeyCode key);
public delegate void InputAxisDelegate (string name,float value);
public class InputEvents : MonoBehaviour
{
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.IO;
public class FileUtility {
/// <summary>
/// Determine whether a given path is a directory.
/// </summary>
@birdinforest
birdinforest / Fps.cs
Last active August 26, 2016 06:09 — forked from mstevenson/Fps.cs
Show Fps.
using UnityEngine;
using System.Collections;
public class Fps : MonoBehaviour {
string label = "";
float count;
IEnumerator Start ()
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
/*
void GetComponentsInChildrenRecursive<T> (Transform parent, List<T> buffer)
where T : Component
{
foreach (Transform t in parent) {
var c = t.GetComponent<T> ();
if (c) {
buffer.Add (c);
}
GetComponentsInChildrenRecursive (t, buffer);
}