private IEnumerator DoLoadResAsync(string path, ResLoadedCallBack resLoaded) { if (path == null) { } else { if (mResourceTable.ContainsKey(path)) { resLoaded(mResourceTable[path]); } else { ResourceRequest resourceRequest = Resources.LoadAsync <GameObject>(path); yield return(null); while (!resourceRequest.isDone) { yield return(null); } GameObject prefab = resourceRequest.asset as GameObject; if (prefab != null) { mResourceTable[path] = prefab; resLoaded(prefab); } } } }
public void LoadRes(string path, ResLoadedCallBack resLoaded, bool noticeError, bool compress) { if (path == null) { return; } if (mResourceTable.ContainsKey(path)) { resLoaded(mResourceTable[path]); return; } Object prefab = Resources.Load(path, typeof(GameObject)); if (prefab != null) { mResourceTable[path] = prefab; resLoaded(prefab); } }
public void LoadResAsync(string path, ResLoadedCallBack resLoaded) { GameEngine.Instance.StartCoroutine(DoLoadResAsync(path, resLoaded)); }
public void LoadRes(string path, ResLoadedCallBack resLoaded, bool noticeError) { LoadRes(path, resLoaded, noticeError, true); }
public void LoadRes(string path, ResLoadedCallBack resLoaded) { LoadRes(path, resLoaded, false, true); }