public static void LoadAssetWithPool(string path, Action <bool> finish_callback) { if (string.IsNullOrEmpty(path)) { if (finish_callback != null) { finish_callback.Invoke(false); } return; } if (AssetManager.IsInPool(path)) { if (finish_callback != null) { finish_callback.Invoke(true); } return; } AssetLoader.LoadAsset(path, typeof(GameObject), delegate(Object obj) { AssetManagerBase.mapAssets.set_Item(path, obj); AssetManager.AddAssetBundleRef(path); AssetManager.InitAssetReference(path); if (finish_callback != null) { finish_callback.Invoke(true); } }); }
public static Object LoadAssetNowWithPool(string path) { if (string.IsNullOrEmpty(path)) { return(null); } if (AssetManager.IsInPool(path)) { return(AssetManagerBase.mapAssets.get_Item(path)); } Object @object = AssetManager.AssetOfNoPool.LoadAssetNow(path, typeof(Object)); AssetManagerBase.mapAssets.set_Item(path, @object); AssetManager.AddAssetBundleRef(path); AssetManager.InitAssetReference(path); return(AssetManagerBase.mapAssets.get_Item(path)); }