Skip to content

Commit

Permalink
fix(YARG.UI): use system.uri instead of unity built-in (YARC-Official…
Browse files Browse the repository at this point in the history
…#127)

apparently UnityWebRequest URL builder still doesn't work well for local files on mac/unix systems (even when prepending file:// before)

now using system.uri removes the necessity to specify the protocol too
  • Loading branch information
Pantotone authored Apr 18, 2023
1 parent 926bd43 commit 26732ca
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Assets/Script/UI/SelectedSongView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections;
using System.IO;
using System;
using TMPro;
using UnityEngine;
using UnityEngine.Networking;
Expand Down Expand Up @@ -166,9 +167,10 @@ private IEnumerator LoadAlbumCoverCoroutine(string filePath) {
}

// Load file
#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX
#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX

using UnityWebRequest uwr = UnityWebRequestTexture.GetTexture($"file://{filePath}");
Uri pathUri = new Uri(filePath);
using UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(pathUri);

#else

Expand Down

0 comments on commit 26732ca

Please sign in to comment.