Skip to content

Instantly share code, notes, and snippets.

View mehmeteacar's full-sized avatar

mehmeteacar

  • istanbul
View GitHub Profile
@mstevenson
mstevenson / MonoBehaviourSingleton.cs
Created December 18, 2012 04:51
Generic Singleton classes for Unity. Use MonoBehaviourSingletonPersistent for any singleton that must survive a level load.
using UnityEngine;
using System.Collections;
public class MonoBehaviourSingleton<T> : MonoBehaviour
where T : Component
{
private static T _instance;
public static T Instance {
get {
if (_instance == null) {
@tamagokun
tamagokun / Console.as
Created July 27, 2011 20:02
AS3 Trace Console for Google Chrome/Firebug
package
{
import flash.display.Sprite;
import flash.events.ErrorEvent;
import flash.events.UncaughtErrorEvent;
import flash.external.ExternalInterface;
public class Console extends Sprite
{
public function Console():void