i’m pretty sure it’s somewhere in the docs, but i haven’t found it yet…:
how can i differentiate whether the code is running/compiled for the editorpreview (the “ᗧ Game”-Tab) so i can fake up my jslib stuff like
#if UNITY_WEBGL
[DllImport("__Internal")]
private static extern void CopyFileData(string filename, IntPtr dst);
#else
private void CopyFileData(string filename, IntPtr dst) {
//some dummy implementation
}
#endif
or something like
void Start() {
if (UnityEngine.Player.IsPlayMode) {
LoadFileFromDisk(@"c:\dev\myproject\init.config");
}
}