I have a class SaveSystem which contains 2 extern methods: SaveExtern, LoadExtern these methods are supposed to be loaded externally from a lib in order to maintain cloud progress saving. But after this, Unity started to throw these errors on build. What may be the cause and how can I fix it.
Library\Bee\\artifacts\WebGL\build\debug_WebGL_wasm\build.js: undefined symbol:
LoadExtern (referenced by top-level compiled C/C++ code)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
[DllImport("__Internal")]
private static extern void SaveExtern(string data);
[DllImport("__Internal")]
private static extern void LoadExtern();
I tried reinstalling Unity, deleting everything from \Library, including #if UNITY_WEBGL and #if !UNITY_EDITOR && UNITY_WEBGL
The answer was rather simple:
You may find info about it here.
https://docs.unity3d.com/Manual/webgl-interactingwithbrowserscripting.html
Big thanks to derHugo for making up my mind