Created
September 10, 2019 14:06
-
-
Save nothke/24954b99a88771bfa8f005f4a2e8416a to your computer and use it in GitHub Desktop.
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
/// Singleton example | |
using UnityEngine; | |
public class SomeSingletonClass : MonoBehaviour | |
{ | |
public static SomeSingletonClass instance; | |
void Awake() { instance = this; } | |
public float someValue; | |
// Now you can access this value from anywhere with SomeSingletonClass.instance.someValue | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment