protected bool LoadByteCodeByFile(OnLoadScriptByteCode pCallBack) { string szPathName = "test.code"; print_error("开始加载, 路径:" + szPathName); try { BetterStreamingAssets.Initialize(); byte[] fileData = BetterStreamingAssets.ReadAllBytes(szPathName); if (fileData != null && fileData.Length > 0) { print_error("加载成功, Path:" + szPathName + ", 文件大小:" + fileData.Length); } pCallBack(fileData); return(true); } catch (Exception e) { print_error(e.ToString()); } print_error("加载失败:" + szPathName); return(false); }
protected virtual void LoadByteCode(OnLoadScriptByteCode pCallBack) { LoadByteCodeByFile(pCallBack); }