Ejemplo n.º 1
0
    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);
            }
        }
    }
Ejemplo n.º 2
0
    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));
    }