This commit is contained in:
yangjing 2022-08-31 21:09:23 +08:00
parent c3080c7e0f
commit caf461888b
2 changed files with 11 additions and 1 deletions

View File

@ -1,7 +1,9 @@
using System.Data;
using System.IO;
using System.Collections.Generic;
#if UNITY_EDITOR
using Excel;
#endif
using UnityEngine;
public class ExcelParser
@ -59,6 +61,7 @@ public class ExcelParser
/// <returns></returns>
static DataRowCollection ReadExcelContext(string pFilePath, ref int pColNum, ref int pRowNum)
{
#if UNITY_EDITOR
FileStream stream = File.Open(pFilePath, FileMode.Open, FileAccess.Read, FileShare.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
@ -67,5 +70,8 @@ public class ExcelParser
pColNum = result.Tables[0].Columns.Count;
pRowNum = result.Tables[0].Rows.Count;
return result.Tables[0].Rows;
#else
return null;
#endif
}
}

View File

@ -70,7 +70,11 @@ public static class AdsUtils
{
TKGSDKManager.Instance.ShowRewardAd(pAdPos, (pResult) =>
{
pSuccessCallback?.Invoke();
if (pResult)
{
pSuccessCallback?.Invoke();
}
}, noUnityTips, true);
}