private void LoadAllObjectsInPath(AssetLoadRequestTO to) { to.loadObjectList = Resources.LoadAll(to.path); HandleAssetLoaded(to); if (to.callback != null) { to.callback(to); } EventController.GetInstance().FireEvent(EventTypeEnum.AssetLoadComplete, null); LoadFinished(); }
private IEnumerator LoadAsync(AssetLoadRequestTO to) { ResourceRequest req = Resources.LoadAsync(to.path); while (!req.isDone) { Debug.Log("Load Progress: " + req.progress); yield return(null); } to.loadedObject = req.asset; HandleAssetLoaded(to); if (to.callback != null) { to.callback(to); } EventController.GetInstance().FireEvent(EventTypeEnum.AssetLoadComplete, null); LoadFinished(); }