Application.streamingAssetsPath Android平台上不能用File直接读取,必须通过WWW

时间:2020-03-16 09:51:34   收藏:0   阅读:181

技术分享图片

// Application.streamingAssetsPath 获取StreamingAssets文件夹的物理路径

IEnumerator Start()
    {
       string Url ="file://"+Application.streamingAssetsPath + "/1.jpg";
        WWW www = new WWW(Url);
        yield return www;
        if (www.error != null)
            Debug.Log(www.error.ToString()+"...ERROR");
        Texture2D t2d = www.texture;
        gameObject.renderer.material.mainTexture = t2d;
       // Debug.Log(Url);
    }

原文:https://www.cnblogs.com/open-coder/p/12501756.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!