Пример #1
0
    public void Load(EResourcesType resourceType, string resName, ELoadSpeedType speedType, Action <ResourceInfo> callBack)
    {
        //检测是否已经加载过了
        ResourceInfo info = null;

        if (m_resourcesDB.IsResourceExist(resourceType, resName))
        {
            info = m_resourcesDB.GetResourceInfo(resourceType, resName);

            if (info != null)
            {
                if (callBack != null)
                {
                    callBack(info);
                }
                return;
            }
        }

        //走资源加载
        switch (speedType)
        {
        case ELoadSpeedType.Immediately:
        {
            m_resourceLoader.AppendLoadTask(resourceType, resName, callBack);
        }
        break;

        case ELoadSpeedType.Normal:
        {
            m_resourceLoader.AppendLoadTaskAsync(resourceType, resName, callBack);
        }
        break;
        }
    }
Пример #2
0
 public ResLoadTask(string name, EResourcesType resType, ELoadSpeedType speedType, Action <ResourceInfo> callBack)
 {
     m_resType       = resType;
     m_name          = name;
     m_loadSpeedType = speedType;
     m_callBack      = callBack;
 }