Exemplo n.º 1
0
 /* Unity */
 private void Awake()
 {
     if (instance != null)
     {
         GameObject.Destroy(gameObject);
         return;
     }
     instance        = this;
     gameObject.name = gameObjectName;
     GameObject.DontDestroyOnLoad(gameObject);
 }
Exemplo n.º 2
0
 public static void Create()
 {
     if (instance != null)
     {
         return;
     }
     instance = GameObject.FindObjectOfType <BillingEvents>();
     if (!instance)
     {
         GameObject gameObject = GameObject.Find(gameObjectName);
         if (!gameObject)
         {
             gameObject = new GameObject(gameObjectName);
         }
         instance = gameObject.GetComponent <BillingEvents>();
         if (!instance)
         {
             instance = gameObject.AddComponent <BillingEvents>();
         }
     }
 }