Exemplo n.º 1
0
    public IAssetRequest LoadAudio(string url, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType)
    {
        if (string.IsNullOrEmpty(url))
        {
            Debug.LogError("string.IsNullOrEmpty(url) == true");
            return(null);
        }
        string text = string.Format("{0}/{1}", this.m_strBaseResDir, url);

        try
        {
            if (!Path.HasExtension(text))
            {
                text = Path.ChangeExtension(text, ".mp3");
            }
        }
        catch (Exception ex)
        {
            XLog.Log.Fatal(ex.Message);
        }
        text = GameResourceManager.StandardlizePath(text);
        GameAssetResource assetResource = this.GetAssetResource(text, assetPRIType, true);

        return(new GameAssetRequest(assetResource, callBackFun));
    }
Exemplo n.º 2
0
    private static string ConvertToAssetBundleName(string ResPath)
    {
        ResPath = GameResourceManager.StandardlizePath(ResPath);
        string text = ResPath.Replace('/', '_');

        text = text.Replace(" ", "");
        return(Path.GetFileNameWithoutExtension(text));
    }
Exemplo n.º 3
0
    public IAssetRequest LoadTexture(string url, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType)
    {
        if (string.IsNullOrEmpty(url))
        {
            Debug.LogError("string.IsNullOrEmpty(url) == true");
            return(null);
        }
        string text = string.Format("{0}/{1}.jpg", this.m_strBaseResDir, url);

        text = GameResourceManager.StandardlizePath(text);
        GameAssetResource assetResource = this.GetAssetResource(text, assetPRIType, true);

        return(new GameAssetRequest(assetResource, callBackFun));
    }
Exemplo n.º 4
0
    public IAssetRequest CreateAssetRequest(string assetUrl, List <string> dependes, AssetRequestFinishedEventHandler callBackFun, AssetPRI assetPRIType, EnumAssetType eAssetType)
    {
        if (string.IsNullOrEmpty(assetUrl))
        {
            Debug.LogError("string.IsNullOrEmpty(assetUrl) == true");
            return(null);
        }
        assetUrl = string.Format("{0}/{1}", this.m_strBaseResDir, assetUrl);

        assetUrl = GameResourceManager.StandardlizePath(assetUrl);
        GameAssetResource assetResource = this.GetAssetResource(assetUrl, assetPRIType, true);

        return(new GameAssetRequest(assetResource, callBackFun));
    }
    public IAssetRequest LoadAtlas(string url, AssetRequestFinishedEventHandler callBackFun)
    {
        if (string.IsNullOrEmpty(url))
        {
            Debug.LogError("string.IsNullOrEmpty(url) == true");
            return(null);
        }
        string text = string.Format("{0}/{1}", this.m_strBaseResDir, url);

        text = Path.ChangeExtension(text, ".prefab");
        text = GameResourceManager.StandardlizePath(text);
        GameAssetResource assetResource = this.GetAssetResource(text, true);

        return(new GameAssetRequest(assetResource, callBackFun));
    }