Exemplo n.º 1
0
 private static void Init()
 {
     if (!XTaskManager.IsInit)
     {
         XTaskManager.IsInit    = true;
         XTaskManager._instance = (Object.FindObjectOfType(typeof(XTaskManager)) as XTaskManager);
         if (!XTaskManager._instance)
         {
             GameObject gameObject = new GameObject("XTaskManager");
             Object.DontDestroyOnLoad(gameObject);
             XTaskManager._instance = gameObject.AddComponent <XTaskManager>();
         }
         else
         {
             Object.DontDestroyOnLoad(XTaskManager._instance);
         }
     }
 }
Exemplo n.º 2
0
 private void OnApplicationQuit()
 {
     XTaskManager._instance = null;
 }