説明なし
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

GetRelativePath.cs 724B

1234567891011121314151617181920212223242526
  1. using System;
  2. using UnityEngine;
  3. namespace Unity.PlasticSCM.Editor
  4. {
  5. internal static class GetRelativePath
  6. {
  7. internal static string ToApplication(string path)
  8. {
  9. Uri relativeToUri = new Uri(ApplicationDataPath.Get());
  10. Uri pathUri = new Uri(FixVolumeLetterPath(path));
  11. return Uri.UnescapeDataString(
  12. relativeToUri.MakeRelativeUri(pathUri).ToString());
  13. }
  14. static string FixVolumeLetterPath(string path)
  15. {
  16. string volumeLetter = new string(new char[] { path[0] });
  17. volumeLetter = volumeLetter.ToUpperInvariant();
  18. return string.Concat(volumeLetter, path.Substring(1));
  19. }
  20. }
  21. }