private static void OnLoadError(BaseLoaderElement loader) { Debug.Log("resource load error: " + loader.Path); _loadingDic.Remove(loader.Path); if (loader.errorCallback != null) { loader.errorCallback.Invoke(loader.Path); } loader.Unload(); }
public static void Unload(string path, System.Action <object> completeCallback, System.Action <string> errorCallback = null) { if (path == null) { return; } if (_loadingDic.ContainsKey(path)) { BaseLoaderElement loader = _loadingDic[path]; loader.completeCallback -= completeCallback; loader.errorCallback -= errorCallback; if (loader.completeCallback == null) { _loadingDic.Remove(path); loader.Unload(); //TestCollider.Instance.StopCoroutine("Load"); } } }
private static void OnLoadComplete(BaseLoaderElement loader) { _loadingDic.Remove(loader.Path); loader.completeCallback.Invoke(loader.GetContent()); loader.Unload(); }