使用WWW方式加载

        private IEnumerator LoadImage(string path, MeshRenderer output)
        {
            var url = "file://" + path;
            var www = new WWW(url);
            yield return www;

            var texture = www.texture;
            if (texture == null)
            {
                Debug.LogError("Failed to load texture url:" + url);
            }

            output.material.mainTexture = texture;
        }

使用Texture2D加载

        if (!File.Exists(filepath))
        {
            Debug.LogError($"File not exists {filepath}");
            return;
        }

        var x = new Texture2D(200, 200);
        if (!x.LoadImage(File.ReadAllBytes(filepath)))
        {
            Debug.LogError($"Load image failed");
            return;
        }

        rawImage.texture = x;