Example #1
0
        public Vector3 direction; // 直线的方向

        public Line(Vector3 startPoint, Vector3 endPointOrVec, CreatType creatType = CreatType.TwoPoint)
        {
            point = startPoint;
            if (creatType == CreatType.TwoPoint)
            {
                direction = endPointOrVec - startPoint;
            }
            else
            {
                direction = endPointOrVec;
            }
        }
Example #2
0
 /// <summary>
 /// 创建文件夹
 /// </summary>
 public static void CreateFolder(string path, CreatType type = CreatType.KeepOld)
 {
     if (!Directory.Exists(path))
     {
         Directory.CreateDirectory(path);
     }
     else
     {
         switch (type)
         {
         case CreatType.CreateNew:
             DeleteFolder(path);
             Directory.CreateDirectory(path);
             break;
         }
     }
 }
Example #3
0
 /// <summary>
 /// 创建文件
 /// </summary>
 public static void CreateFile(string path, CreatType type = CreatType.KeepOld)
 {
     if (!File.Exists(path))
     {
         File.Create(path).Close();
     }
     else
     {
         switch (type)
         {
         case CreatType.CreateNew:
             File.Delete(path);
             File.Create(path).Close();
             break;
         }
     }
 }
Example #4
0
 /// <summary>
 /// 创建文件
 /// </summary>
 public static void CreateFile(string path, CreatType type = CreatType.KeepOld)
 {
     if (!File.Exists(path))
     {
         string dirPath = Utility.Text.SplitPathName(path)[0];
         CreateFolder(dirPath);
         File.Create(path).Close();
     }
     else
     {
         switch (type)
         {
         case CreatType.CreateNew:
             File.Delete(path);
             File.Create(path).Close();
             break;
         }
     }
 }