Quantcast
Channel: Questions in topic: "webgl"
Viewing all articles
Browse latest Browse all 2390

UnityWebRequest check if file exists, without 404

$
0
0
Hi I am trying to write a method which checks if a file exists in the streamingAssets folder of a WebGL build. The following does work; but produces an annoying 404 error visible in the console. Is there any way around this? thanks. public IEnumerator CheckExists() { var path = Application.streamingAssetsPath + filepath; #if UNITY_EDITOR yield return null; isExisting = File.Exists(path); #else var www = UnityWebRequest.Head(path); yield return www.SendWebRequest(); isExisting = www.responseCode < 400; #endif } Error is shown as: > HEAD http://localhost:61543/StreamingAssets/Sequence/labels/000101.json 404 (Not Found)

Viewing all articles
Browse latest Browse all 2390

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>