Update
This commit is contained in:
ALEXTANG
2022-05-24 18:12:17 +08:00
parent 6210778de3
commit c9fafcaef0
4 changed files with 52 additions and 1 deletions

2
.gitignore vendored
View File

@@ -11,6 +11,8 @@
/[Mm]emoryCaptures/
/EditorBuild/
# /[Aa]ssets/TResources/DLL/
/[Aa]ssets/StreamingAssets
/BuildBundleInfo/
# Asset meta data should only be ignored when the corresponding asset is also ignored
!/[Aa]ssets/**/*.meta

View File

@@ -126,5 +126,28 @@ namespace TEngine
return File.OpenRead(filePath);
#endif
}
/// <summary>
/// 从指定文件中读取字节串
/// </summary>
/// <param name="filePath">文件路径</param>
/// <returns></returns>
public static byte[] ReadAllBytesFromOutOrInnerFolder(string filePath)
{
if (string.IsNullOrEmpty(filePath))
return null;
return ReadAllBytesFromOutFolder(filePath);
}
private static byte[] ReadAllBytesFromOutFolder(string filePath)
{
if (!File.Exists(filePath))
{
TLogger.LogError("file:[{0}] is not exist!, please check!", filePath);
return null;
}
return File.ReadAllBytes(filePath);
}
}
}

View File

@@ -4,5 +4,8 @@
EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes: []
m_Scenes:
- enabled: 1
path: Assets/NetDemo/TEngine-NetDemo.unity
guid: 961c85cf7d9a44549a13b94e9931e037
m_configObjects: {}

View File

@@ -126,5 +126,28 @@ namespace TEngineCore
return File.OpenRead(filePath);
#endif
}
/// <summary>
/// 从指定文件中读取字节串
/// </summary>
/// <param name="filePath">文件路径</param>
/// <returns></returns>
public static byte[] ReadAllBytesFromOutOrInnerFolder(string filePath)
{
if (string.IsNullOrEmpty(filePath))
return null;
return ReadAllBytesFromOutFolder(filePath);
}
private static byte[] ReadAllBytesFromOutFolder(string filePath)
{
if (!File.Exists(filePath))
{
TLogger.LogError("file:[{0}] is not exist!, please check!", filePath);
return null;
}
return File.ReadAllBytes(filePath);
}
}
}