Skip to content

Instantly share code, notes, and snippets.

View col000r's full-sized avatar

Markus Hofer col000r

View GitHub Profile
@mstevenson
mstevenson / SaveFBX.cs
Created August 5, 2013 20:05
ASCII FBX file exporter for Unity. Extracted from Michal Mandrysz's Unity Summer of Code 2009 external lightmapping project.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Text;
using UnityEditor;
using UnityEngine;
/*
@AngryAnt
AngryAnt / DualDisplay.cs
Last active January 24, 2024 08:26
Example use of the Unity 4.1 AirPlay API - gives a setup with the iOS device as controller of the remote display.
using UnityEngine;
using System.Collections;
/*
Runtime use:
To be available, AirPlay needs to be switched on for the device either via a native AirPlay UI component or
via the global AirPlay mirroring setting. Your options are:
A: Modify your Xcode project to layer a native AirPlay Cocoa control somewhere over your Unity content.
@mstevenson
mstevenson / ShuffleBag.cs
Last active May 25, 2020 12:16
Shuffle bag algorithm implemented in C#
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class ShuffleBag<T> : ICollection<T>, IList<T>
{
private List<T> data = new List<T> ();
private int cursor = 0;
private T last;
@tracend
tracend / component.json
Created July 10, 2012 08:44
[DEPRECATED]: Dead simple method to include Unity3D web player(s) using jQuery. Project moved to : http://github.com/makesites/jquery-unity3d
{
"name": "jquery-unity3d",
"version": "0.2.0",
"main": ["./jquery.unity3d.js"],
"dependencies": {
"jquery": "~1.8.2"
}
}
@AngryAnt
AngryAnt / ContainerGravity.cs
Created July 2, 2012 11:14
Example of simple component for keeping objects inside defined bounds by physically repelling them back when they exit.
using UnityEngine;
using System.Collections;
[RequireComponent (typeof (BoxCollider))]
public class ContainerGravity : MonoBehaviour
{
public float strength = 10.0f;
@AngryAnt
AngryAnt / EditorWindowExample.cs
Created June 15, 2012 08:30
EditorWindowExample from the Unity Asia Bootcamp 12 talk "Streamlining your Unity editor". A simple node based editor.
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
public class EditorWindowExample : EditorWindow
{
List<Node> nodes = new List<Node> ();
@darktable
darktable / SavWav.cs
Created April 6, 2012 05:01
Unity3D: script to save an AudioClip as a .wav file.
// Copyright (c) 2012 Calvin Rien
// http://the.darktable.com
//
// This software is provided 'as-is', without any express or implied warranty. In
// no event will the authors be held liable for any damages arising from the use
// of this software.
//
// Permission is granted to anyone to use this software for any purpose,
// including commercial applications, and to alter it and redistribute it freely,
// subject to the following restrictions:
@christophermanning
christophermanning / README.md
Last active November 22, 2022 22:14
Bitbucket Download Directory

Python script to download/shallow clone the files of a directory at bitbucket. This is useful when you just want a copy of the files in a subdirectory of a repository without needing mercurial or having to download the entire repository.