Пример #1
0
        // eResourcesType 打包类型资源加载
        public void loadResources(LoadParam param)
        {
            param.resolvePath();

#if PKG_RES_LOAD
            if (param.m_path.IndexOf(PakSys.PAK_EXT) != -1)     // 如果加载的是打包文件
            {
                param.m_resPackType = ResPackType.ePakType;
            }
            else        // 加载的是非打包文件
            {
                param.m_resPackType = ResPackType.eUnPakType;
            }
            load(param);
#elif UnPKG_RES_LOAD
            // 判断资源所在的目录,是在 StreamingAssets 目录还是在 persistentData 目录下,目前由于没有完成,只能从 StreamingAssets 目录下加载
            param.m_resPackType = ResPackType.eUnPakType;
            param.m_resLoadType = ResLoadType.eStreamingAssets;
            return(load(param));
#else
            param.m_resPackType = ResPackType.eResourcesType;
            param.m_resLoadType = ResLoadType.eLoadResource;
            load(param);
#endif
        }
Пример #2
0
        // eLevelType 打包类型资源加载,都用协程加载
        public void loadLevel(LoadParam param)
        {
            param.resolveLevel();

#if PKG_RES_LOAD
            param.m_resPackType = ResPackType.ePakLevelType;
            param.resolvePath();
            load(param);
#elif UnPKG_RES_LOAD
            param.m_resPackType = ResPackType.eUnPakLevelType;
            param.m_resLoadType = ResLoadType.eStreamingAssets;
            load(param);
#else
            param.m_resPackType = ResPackType.eLevelType;
            param.m_resLoadType = Ctx.m_instance.m_cfg.m_resLoadType;
            load(param);
#endif
        }
Пример #3
0
        // eLevelType 打包类型资源加载,都用协程加载
        public void loadLevel(LoadParam param)
        {
            param.resolveLevel();

#if PKG_RES_LOAD
            param.m_resPackType = ResPackType.ePakLevelType;
            param.resolvePath();
            load(param);
#elif UnPKG_RES_LOAD
            param.m_resPackType = ResPackType.eUnPakLevelType;
            param.m_resLoadType = ResLoadType.eStreamingAssets;
            load(param);
#else
            param.m_resPackType = ResPackType.eLevelType;
            param.m_resLoadType = Ctx.m_instance.m_cfg.m_resLoadType;
            load(param);
#endif
        }
Пример #4
0
 public ResItem getAndLoad(LoadParam param)
 {
     param.resolvePath();
     load(param);
     return getResource(param.m_path);
 }
Пример #5
0
        // eResourcesType 打包类型资源加载
        public void loadResources(LoadParam param)
        {
            param.resolvePath();

#if PKG_RES_LOAD
            if (param.m_path.IndexOf(PakSys.PAK_EXT) != -1)     // 如果加载的是打包文件
            {
                param.m_resPackType = ResPackType.ePakType;
            }
            else        // 加载的是非打包文件
            {
                param.m_resPackType = ResPackType.eUnPakType;
            }
            load(param);
#elif UnPKG_RES_LOAD
            // 判断资源所在的目录,是在 StreamingAssets 目录还是在 persistentData 目录下,目前由于没有完成,只能从 StreamingAssets 目录下加载
            param.m_resPackType = ResPackType.eUnPakType;
            param.m_resLoadType = ResLoadType.eStreamingAssets;
            return load(param);
#else
            param.m_resPackType = ResPackType.eResourcesType;
            param.m_resLoadType = ResLoadType.eLoadResource;
            load(param);
#endif
        }
Пример #6
0
 public ResItem getAndLoad(LoadParam param)
 {
     param.resolvePath();
     load(param);
     return(getResource(param.m_path));
 }