Skip to content

Instantly share code, notes, and snippets.

@tsubaki
tsubaki / SingletonMonoBehaviour.cs
Last active August 13, 2021 12:45
旧シングルトンの改良版。初回起動時にインスタンスが登録されていなければ自身を登録する
using UnityEngine;
using System.Collections;
public class SingletonMonoBehaviour<T> : MonoBehaviour where T : SingletonMonoBehaviour<T>
{
protected static T instance;
public static T Instance {
get {
if (instance == null) {
instance = (T)FindObjectOfType (typeof(T));
@SteveSongMIT
SteveSongMIT / captainflint.dtl
Created March 20, 2012 22:50
Simple Cowboy web server + ErlyDTL
<html>
<body>
GET squawk:<br />
{{ squawk_get }}<br /><br />
POST squawk:<br />
{{ squawk_post }}<br /><br />