使用 ILSpy 工具查看了 System.IO.Path 类中的 Combine 方法 对它的功能有点不放心,原方法实现如下: // System.IO.Path /// <summary>Combines two path strings.</summary> /// <returns>A string containing the combined paths. If one of the specified paths is a zero-length stri…
https://docs.microsoft.com/en-us/dotnet/api/system.io.path.combine?view=netframework-4.8#System_IO_Path_Combine_System_String_System_String_ public static string Combine (string path1, string path2); Returns String The combined paths. If one of the s…
代码如下图,这样就不用在绝对路径和相对路径之间不断转换了. 想要得到绝对路径时就傅 Application.dataPath + xxx using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; public class abbuilder { [MenuItem("AssetBundle/BuildABx")]…
using System; using System.IO; class Test { public static void Main() { string path = @"c:\temp\MyTest.txt"; if (!File.Exists(path)) { // Create a file to write to. using (StreamWriter sw = File.CreateText(path)) { sw.WriteLine("Hello"…