Created
October 15, 2013 14:13
-
-
Save fversnel/6992212 to your computer and use it in GitHub Desktop.
Singleton implementation from the 'Unite 2013 - Internal Unity Tips and Tricks' talk (http://www.youtube.com/watch?v=Ozc_hXzp_KU)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class Example : MonoBehaviour | |
{ | |
public static Example Singleton; | |
void OnEnable() | |
{ | |
if (Singleton == null) | |
Singleton = this; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment