Skip to content

Commit

Permalink
コメントをへ英語に翻訳
Browse files Browse the repository at this point in the history
  • Loading branch information
AraiYuhki authored and durswd committed Apr 28, 2024
1 parent 73069cd commit 4e4a50f
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Dev/Plugin/Assets/Effekseer/Editor/EfkFileImporter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public static void Import()
if (string.IsNullOrEmpty(sourceFilePath))
return;

// 次回インポートする際に同じディレクトリを最初に選択してくれたほうが楽なので、今回選択したファイルのディレクトリを保存しておく
// Save the directory of the files you selected this time,
// because it is easier to select the same directory first the next time you import.
PlayerPrefs.SetString(OpenEfkFileDirectoryCacheKey, Path.GetDirectoryName(sourceFilePath));
PlayerPrefs.Save();

Expand All @@ -30,6 +31,7 @@ public static void Import()
var savePath = SelectSavePath(sourceFilePath);
if (string.IsNullOrEmpty(savePath))
return;
// Convert local path to absolute path, because not use Unity's function.
savePath = savePath.Replace("Assets", Application.dataPath);
var saveDirectory = Path.GetDirectoryName(savePath);

Expand All @@ -44,7 +46,7 @@ public static void Import()
}

/// <summary>
/// インポートするEfkファイルを選択する
/// Select the Efk file to be imported
/// </summary>
/// <returns></returns>
private static string SelectSourceFile()
Expand All @@ -54,7 +56,7 @@ private static string SelectSourceFile()
}

/// <summary>
/// 保存先のパスを選択
/// Select the save to path
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
Expand All @@ -65,7 +67,7 @@ private static string SelectSavePath(string filePath)
}

/// <summary>
/// Efkファイルで使用するリソースファイルの一覧をロードする
/// Load a list of resource files to be used in the Efk file.
/// </summary>
/// <param name="filePath"></param>
/// <returns></returns>
Expand All @@ -75,9 +77,9 @@ private static List<string> LoadResourceFilePaths(string filePath)
var data = File.ReadAllBytes(filePath);
var resourcePath = new EffekseerResourcePath();
if (!EffekseerEffectAsset.ReadResourcePath(data, ref resourcePath))
DisplayErrorDialog("Error", $"Failed to load {filePath}.");
DisplayErrorDialog($"Failed to load {filePath}.");

// 念の為、重複したファイルを排除したリストを返却する
// Remove duplicate files from the list, just to be safe.
var paths = new List<string>();
paths.AddRange(resourcePath.TexturePathList);
paths.AddRange(resourcePath.ModelPathList);
Expand All @@ -87,7 +89,7 @@ private static List<string> LoadResourceFilePaths(string filePath)
}

/// <summary>
/// コピー対象のファイルがすべて存在しているか確認する
/// Verify that all files to be copied exist.
/// </summary>
/// <param name="sourceFilePath"></param>
/// <param name="sourceDirectory"></param>
Expand All @@ -100,11 +102,11 @@ private static void ValidateFilePaths(string sourceFilePath, string sourceDirect
notFoundFiles.Add(sourceFilePath);
notFoundFiles.AddRange(resourcePaths.Where(path => !File.Exists(Path.Combine(sourceDirectory, path))));
if (notFoundFiles.Count > 0)
DisplayErrorDialog("エラー", $"These files are not found.\n{string.Join("\n", notFoundFiles)}");
DisplayErrorDialog($"These files are not found.\n{string.Join("\n", notFoundFiles)}");
}

/// <summary>
/// ファイルをコピーする
/// Copies the specified file to the specified path.
/// </summary>
/// <param name="sourceFilePath"></param>
/// <param name="destFilePath"></param>
Expand All @@ -127,18 +129,18 @@ private static void CopyFile(string sourceFilePath, string destFilePath)
}
catch (Exception e)
{
DisplayErrorDialog("Error", e.Message);
DisplayErrorDialog(e.Message);
}
}

/// <summary>
/// エラーダイアログを表示する
/// Show an error dialog.
/// </summary>
/// <param name="title"></param>
/// <param name="message"></param>
private static void DisplayErrorDialog(string title, string message)
private static void DisplayErrorDialog(string message)
{
EditorUtility.DisplayDialog(title, message, "OK");
EditorUtility.DisplayDialog("Error!", message, "OK");
throw new Exception(message);
}
}
Expand Down

0 comments on commit 4e4a50f

Please sign in to comment.