mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
1、Scene.Create接口增加了一个泛型方法接口。 2、SceneConfig增加了SceneTypeConfig和SceneSubType
1、Scene.Create接口增加了一个泛型方法接口。 2、SceneConfig增加了SceneTypeConfig和SceneSubType
This commit is contained in:
34
Assets/GameScripts/DotNet/Core/Helper/ExcelHelper.cs
Normal file
34
Assets/GameScripts/DotNet/Core/Helper/ExcelHelper.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
#if TENGINE_NET
|
||||
using OfficeOpenXml;
|
||||
|
||||
namespace TEngine.Helper;
|
||||
|
||||
public static class ExcelHelper
|
||||
{
|
||||
public static ExcelPackage LoadExcel(string name)
|
||||
{
|
||||
return new ExcelPackage(name);
|
||||
}
|
||||
|
||||
public static string GetCellValue(this ExcelWorksheet sheet, int row, int column)
|
||||
{
|
||||
ExcelRange cell = sheet.Cells[row, column];
|
||||
|
||||
try
|
||||
{
|
||||
if (cell.Value == null)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
string s = cell.GetValue<string>();
|
||||
|
||||
return s.Trim();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new Exception($"Rows {row} Columns {column} Content {cell.Text} {e}");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2ea3356f30cb40949949691a0e258a05
|
||||
timeCreated: 1690561972
|
@@ -5,6 +5,16 @@ namespace TEngine.Core
|
||||
{
|
||||
public static class FileHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// 获取文件全路径。
|
||||
/// </summary>
|
||||
/// <param name="relativePath"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetFullPath(string relativePath)
|
||||
{
|
||||
return Path.GetFullPath(Path.Combine(Directory.GetCurrentDirectory(), relativePath));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 拷贝文件到目标路径、如果目标目录不存在会自动创建目录
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user