Traveller/scripts/utils/ResUtils.cs
Cold-Mint b0da4b049e
Improve the log of map generator.
完善地图生成器的日志。
2024-05-26 11:10:21 +08:00

18 lines
607 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
namespace ColdMint.scripts.utils;
public class ResUtils
{
/// <summary>
/// <para>The game returns the res directory with a.remap suffix at runtime, causing an error while loading the resource</para>
/// <para>游戏在运行时返回res目录后带有.remap后缀导致加载资源时出错</para>
/// </summary>
/// <param name="path"></param>
/// <returns></returns>
public static string GetAbsolutePath(string path)
{
var index = path.LastIndexOf(".remap", StringComparison.Ordinal);
return index > -1 ? path[..index] : path;
}
}