static void Initialize() { if (!initialized) { if (!Application.isPlaying) { return; } initialized = true; var g = new GameObject("ThreadMgr"); m_Instence = g.AddComponent <ThreadMgr>(); DontDestroyOnLoad(g); } }
void BeginDownload(string url, string file) { m_CurDownloadNum++; ThreadMgr.RunAsync(new TheardEvent( () => { HttpDownFile down = new HttpDownFile(file, url); down.DownloadFile(); } , () => { m_CurDownloadNum--; m_DownloadFiles.Add(file); } )); }
void Awake() { m_Instence = this; initialized = true; }
static void Initialize() { if (!initialized) { if (!Application.isPlaying) return; initialized = true; var g = new GameObject("ThreadMgr"); m_Instence = g.AddComponent<ThreadMgr>(); DontDestroyOnLoad(g); } }