Exemple #1
0
    /// <summary>
    /// 同步加载资源
    /// </summary>
    public object SyncLoadAsset <T>(string assetname, AssetType assetType = AssetType.HoldOnAsset)
    {
        AssetFile assetFile = AssetFileMgr.Instance.OpenAsset(assetname, null, false);
        object    obj       = assetFile.LoadAssetFile(assetname, typeof(T));

        if (obj != null)
        {
            switch (assetType)
            {
            case AssetType.HoldOnAsset:
                holdonFile[assetname] = assetFile;
                break;

            case AssetType.UIAsset:
                uiFile[assetname] = assetFile;
                break;

            case AssetType.BattleAsset:
                battleFile[assetname] = assetFile;
                break;
            }
        }

        return(obj);
    }