Skip to content

Instantly share code, notes, and snippets.

View whitebull's full-sized avatar
🎯
Focusing

whitebull

🎯
Focusing
View GitHub Profile
@whitebull
whitebull / Singleton.cs
Last active March 1, 2024 15:31 — forked from timofei7/Singleton.cs
Singleton abstract class for unity.
using UnityEngine;
using System.Collections;
/// <summary>
/// MONOBEHAVIOR PSEUDO SINGLETON ABSTRACT CLASS
/// usage : best is to be attached to a gameobject but if not that is ok,
/// : this will create one on first access
/// example : '''public sealed class MyClass : Singleton<MyClass> {'''
/// references : http://tinyurl.com/d498g8c
/// : http://tinyurl.com/cc73a9h