Advertisement
Guest User

Untitled

a guest
Nov 21st, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.42 KB | None | 0 0
  1. public class GameState{
  2.     private static GameState _instance;
  3.    
  4.     public string Example; //пример переменной где можно сохранять, обращаться к ней из любого места в любое время GameState.Instance.Example
  5.  
  6.     public static GameState Instance{
  7.     get{
  8.     if (_instance == null){
  9.     _instance = new GameState();
  10. }
  11. return _instance;
  12. }}
  13. protected GameState(){}
  14.  
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement