Skip to content

Instantly share code, notes, and snippets.

View dyguests's full-sized avatar
:octocat:
٩(˃̶͈̀௰˂̶͈́)و

fanhl dyguests

:octocat:
٩(˃̶͈̀௰˂̶͈́)و
  • ChengDu.China
View GitHub Profile
@dyguests
dyguests / Singleton.cs
Last active May 11, 2024 22:04 — forked from luke161/Singleton.cs
Unity MonoBehaviour Singleton. Base class for creating a singleton in Unity, handles searching for an existing instance, useful if you've created the instance inside a scene. Also handles cleaning up of multiple singleton instances in Awake.
// ReSharper disable once InvalidXmlDocComment
/**
* Singleton.cs
* Author: Luke Holland (http://lukeholland.me/)
*/
using System;
using UnityEngine;
namespace Koyou.Commons