internal static byte[] loadFile(string fn) { try { byte[] bytes; if (loaderDelegate != null) { bytes = loaderDelegate(fn); } else { fn = fn.Replace(".", "/"); TextAsset asset = (TextAsset)Resources.Load(fn); if (asset == null) { return(null); } bytes = asset.bytes; } DebugInterface.require(fn, bytes); return(bytes); } catch (Exception e) { throw new Exception(e.Message); } }
internal static byte[] loadFile(string fn) { try { byte[] bytes; if (loaderDelegate != null) { bytes = loaderDelegate(fn); } else { fn = fn.Replace(".", "/"); #if !SLUA_STANDALONE TextAsset asset = (TextAsset)Resources.Load(fn); if (asset == null) { return(null); } bytes = asset.bytes; #else bytes = File.ReadAllBytes(fn); #endif } if (bytes != null) { DebugInterface.require(fn, bytes); } return(bytes); } catch (Exception e) { throw new Exception(e.Message); } }