Skip to content

Instantly share code, notes, and snippets.

@nothke
Created September 10, 2019 14:06
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nothke/24954b99a88771bfa8f005f4a2e8416a to your computer and use it in GitHub Desktop.
Save nothke/24954b99a88771bfa8f005f4a2e8416a to your computer and use it in GitHub Desktop.
/// 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