loader.js:1 warning: 2 FS.syncfs operations in flight at once, probably just doing extra work

在Google浏览器中运行WebGL出现的错误

是因为写了加载和反序列化本地 JSON 文件(如下所示),则会输出上述警告

public T LoadLocalData(string path) where T : class{try{using (var sw = new StreamReader(path)){var json = sw.ReadToEnd();return JsonUtility.FromJson(json);}}catch (System.Exception e){Debug.LogError($"Error: {path} | {e.Message}");}return null;}

WebGL中不允许使用文件操作

public T LoadLocalData(string path) where T : class{#if UNITY_WEBGL// WebGL用其他代替处理return null;#elsetry{using (var sw = new StreamReader(path)){var json = sw.ReadToEnd();return JsonUtility.FromJson(json);}}catch (System.Exception e){Debug.LogError($"Error: {path} | {e.Message}");}return null;#endif}