Пример #1
0
    public override void Initialize()
    {
        base.Initialize();
        m_loaderDict = new Dictionary <EAssetLoaderType, IAssetLoader>();
        IAssetLoader resLoader = new ResourceLoader();


        TextAsset ta = Resources.Load <TextAsset>("Scp/internalResources.csv");

        if (ta == null)
        {
            throw new Exception("ResourceManager Init Error! Scp/resconfig.csv not found!");
        }
        //加载内部资源组
        ResourceGroup iresGroup = null;

        try
        {
            iresGroup          = new ResourceGroup();
            iresGroup.itemList = CsvUtil.LoadObjectsWithString <ResourceItem>(ta.text);
        }catch (Exception e)
        {
            Debug.LogError("Parse resconfig.csv failed !");
            throw e;
        }
        ResourceGroup preLoadResGroup = null;

        ta = Resources.Load <TextAsset>("Scp/PreloadResources.csv");
        try
        {
            preLoadResGroup          = new ResourceGroup();
            preLoadResGroup.itemList = CsvUtil.LoadObjectsWithString <ResourceItem>(ta.text);
        }
        catch (Exception e)
        {
            Debug.LogError("Parse resconfig.csv failed !");
            throw e;
        }
    }