-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from anatawa12/internationalization
Internationalization
- Loading branch information
Showing
33 changed files
with
403 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using CustomLocalization4EditorExtension; | ||
using UnityEditor; | ||
|
||
namespace Anatawa12.AvatarOptimizer | ||
{ | ||
abstract class AvatarTagComponentEditorBase : Editor | ||
{ | ||
private readonly SaveVersionDrawer _saveVersion = new SaveVersionDrawer(); | ||
|
||
public sealed override void OnInspectorGUI() | ||
{ | ||
CL4EE.DrawLanguagePicker(); | ||
|
||
var description = Description; | ||
if (!string.IsNullOrEmpty(description)) | ||
EditorGUILayout.HelpBox(description, MessageType.None); | ||
|
||
_saveVersion.Draw(serializedObject); | ||
|
||
OnInspectorGUIInner(); | ||
} | ||
|
||
protected virtual string Description => null; | ||
protected abstract void OnInspectorGUIInner(); | ||
} | ||
|
||
[CustomEditor(typeof(AvatarTagComponent), true)] | ||
class DefaultAvatarTagComponentEditor : AvatarTagComponentEditorBase | ||
{ | ||
protected override void OnInspectorGUIInner() | ||
{ | ||
serializedObject.UpdateIfRequiredOrScript(); | ||
var iterator = serializedObject.GetIterator(); | ||
|
||
var enterChildren = true; | ||
while (iterator.NextVisible(enterChildren)) | ||
{ | ||
if ("m_Script" != iterator.propertyPath) | ||
EditorGUILayout.PropertyField(iterator, true); | ||
enterChildren = false; | ||
} | ||
|
||
serializedObject.ApplyModifiedProperties(); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using CustomLocalization4EditorExtension; | ||
|
||
namespace Anatawa12.AvatarOptimizer | ||
{ | ||
static class Localizations | ||
{ | ||
[AssemblyCL4EELocalization] | ||
public static Localization Localization { get; } = new Localization( | ||
"8b53df9f2e18428bbba2165c4f2af9be", "en"); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
using CustomLocalization4EditorExtension; | ||
using UnityEditor; | ||
|
||
namespace Anatawa12.AvatarOptimizer | ||
{ | ||
[CustomEditor(typeof(MergeBone))] | ||
public class MergeBoneEditor : Editor | ||
class MergeBoneEditor : AvatarTagComponentEditorBase | ||
{ | ||
private SaveVersionDrawer _saveVersion = new SaveVersionDrawer(); | ||
public override void OnInspectorGUI() | ||
protected override string Description => CL4EE.Tr("MergeBone:description"); | ||
|
||
protected override void OnInspectorGUIInner() | ||
{ | ||
EditorGUILayout.LabelField("You will remove this GameObject and merge bone to parent"); | ||
_saveVersion.Draw(serializedObject); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.