Advertisement
Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.59 KB | None | 0 0
  1. public class Observer : MonoBehaviour {
  2.  
  3.     #region Singletone
  4.     private static Observer _instance;
  5.     public static Observer Instance
  6.     {
  7.         get
  8.         {
  9.             if (!_instance)
  10.             {
  11.                 _instance = FindObjectOfType(typeof(Observer)) as Observer;
  12.                 if (_instance == null)
  13.                 {
  14.                     Debug.Log("Error!");
  15.                 }
  16.             }
  17.             return _instance;
  18.         }
  19.     }
  20.     #endregion
  21.  
  22.     public delegate void GivePoints(int value);
  23.     public static event GivePoints OnGivePoints;
  24.  
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement