public LoadingQueue(MonoBehaviour mono_behaviour, bool enable_ref_count) { monoBehaviour = mono_behaviour; if (enable_ref_count) { ResourceLoad resourceLoad = ResourceLoad.GetResourceLoad(mono_behaviour, true); if (resourceLoad.list == null) { resourceLoad.list = new BetterList <ResourceObject>(); } } }
public LoadObject LoadEffect(RESOURCE_CATEGORY category, string name, bool check_cache = false) { if (string.IsNullOrEmpty(name)) { return(null); } name = ResourceName.AddAttributID(name); if (check_cache) { ResourceObject cachedResourceObject = MonoBehaviourSingleton <ResourceManager> .I.cache.GetCachedResourceObject(category, name); if (cachedResourceObject != null) { ResourceLoad resourceLoad = ResourceLoad.GetResourceLoad(monoBehaviour, false); resourceLoad.SetReference(cachedResourceObject); return(null); } } return(Load(category, name, false)); }
public void Load(MonoBehaviour mono_behaviour, RESOURCE_CATEGORY category, string package_name, string[] resource_names, bool cache_package = false) { isLoading = false; if (resource_names != null && resource_names.Length >= 1) { loadedObjects = MonoBehaviourSingleton <ResourceManager> .I.cache.GetCachedResourceObjects(category, resource_names); if (loadedObjects != null) { if (loadedObjects[0] != null) { loadedObject = loadedObjects[0].obj; } int i = 0; for (int num = loadedObjects.Length; i < num; i++) { if (loadedObjects[i] == null) { loadedObjects = null; break; } } } } if (resLoad == null) { resLoad = ResourceLoad.GetResourceLoad(mono_behaviour, false); } if (loadedObjects == null) { isLoading = true; MonoBehaviourSingleton <ResourceManager> .I.Load(resLoad, category, package_name, resource_names, OnLoadComplate, OnLoadError, cache_package, null); } else { resLoad.SetReference(loadedObjects); } }
public void Load(MonoBehaviour mono_behaviour, RESOURCE_CATEGORY category, string resource_name, bool cache_package) { isLoading = false; if (!string.IsNullOrEmpty(resource_name)) { if (resLoad == null) { resLoad = ResourceLoad.GetResourceLoad(mono_behaviour, false); } ResourceObject cachedResourceObject = MonoBehaviourSingleton <ResourceManager> .I.cache.GetCachedResourceObject(category, resource_name); if (cachedResourceObject != null) { loadedObject = cachedResourceObject.obj; resLoad.SetReference(cachedResourceObject); } if (loadedObject == null) { isLoading = true; MonoBehaviourSingleton <ResourceManager> .I.Load(resLoad, category, resource_name, OnLoadComplate, OnLoadError, cache_package, null); } } }
public static void Create(MonoBehaviour call_mono, List <int> degreeIds, bool isButton, Action <DegreePlate> onFinish) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown ResourceObject cachedResourceObject = MonoBehaviourSingleton <ResourceManager> .I.cache.GetCachedResourceObject(RESOURCE_CATEGORY.UI, "DegreePlate"); if (cachedResourceObject != null) { DegreePlate component = (Object.Instantiate(cachedResourceObject.obj) as GameObject).GetComponent <DegreePlate>(); component.Initialize(degreeIds, isButton, onFinish); } else { MonoBehaviourSingleton <ResourceManager> .I.Load(ResourceLoad.GetResourceLoad(call_mono, true), RESOURCE_CATEGORY.UI, "DegreePlate", delegate(ResourceManager.LoadRequest x, ResourceObject[] y) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown y[0].refCount++; DegreePlate component2 = (Object.Instantiate(y[0].obj) as GameObject).GetComponent <DegreePlate>(); component2.Initialize(degreeIds, isButton, onFinish); }, null, false, null); } }