로컬라이즈 추가
com.unity.localization 추가
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 175cafb710462ef489cbf56cb46c97d5
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="LocalizationSupport.cs" company="Sirenix IVS">
|
||||
// Copyright (c) Sirenix IVS. All rights reserved.
|
||||
// </copyright>
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
#if UNITY_EDITOR
|
||||
|
||||
namespace Sirenix.OdinInspector.Modules.Localization.Editor
|
||||
{
|
||||
using UnityEngine.Localization;
|
||||
using Sirenix.OdinInspector.Editor;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using Sirenix.Utilities.Editor;
|
||||
using System.Reflection;
|
||||
|
||||
public class LocalizedReferenceProcessor : OdinAttributeProcessor<LocalizedReference>
|
||||
{
|
||||
public override bool CanProcessChildMemberAttributes(InspectorProperty parentProperty, MemberInfo member)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void ProcessSelfAttributes(InspectorProperty property, List<Attribute> attributes)
|
||||
{
|
||||
attributes.Add(new DrawWithUnityAttribute());
|
||||
}
|
||||
}
|
||||
|
||||
public class LocalizedReferenceResolver : OdinPropertyResolver<LocalizedReference>
|
||||
{
|
||||
public override int ChildNameToIndex(string name)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override int ChildNameToIndex(ref StringSlice name)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
public override InspectorPropertyInfo GetChildInfo(int childIndex)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
protected override int GetChildCount(LocalizedReference value)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 46db7b2a049564544ad19a2e480a1333
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Sirenix.OdinInspector.Modules.UnityLocalization.Editor",
|
||||
"references": [ "Unity.Localization", "Sirenix.Serialization", "Sirenix.OdinInspector.Attributes", "Sirenix.OdinInspector.Editor", "Sirenix.Utilities.Editor" ],
|
||||
"includePlatforms": [ "Editor" ],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": true,
|
||||
"autoReferenced": true,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [ "Sirenix.Serialization.dll", "Sirenix.OdinInspector.Attributes.dll", "Sirenix.OdinInspector.Editor.dll", "Sirenix.Utilities.Editor.dll" ],
|
||||
"defineConstraints": []
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3656feb4b010c5941972fb7b3b9eec3e
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b2477452e56429547b05666cbaaf3502
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,54 @@
|
||||
//-----------------------------------------------------------------------
|
||||
// <copyright file="LocalizedStringFormatter.cs" company="Sirenix IVS">
|
||||
// Copyright (c) Sirenix IVS. All rights reserved.
|
||||
// </copyright>
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
using Sirenix.Serialization;
|
||||
using System.Reflection;
|
||||
using UnityEngine.Localization;
|
||||
using System;
|
||||
|
||||
[assembly: RegisterFormatter(typeof(Sirenix.OdinInspector.Modules.Localization.LocalizedStringFormatter))]
|
||||
|
||||
namespace Sirenix.OdinInspector.Modules.Localization
|
||||
{
|
||||
public class LocalizedStringFormatter : ReflectionOrEmittedBaseFormatter<LocalizedString>
|
||||
{
|
||||
private static readonly FieldInfo m_LocalVariables_Field;
|
||||
|
||||
static LocalizedStringFormatter()
|
||||
{
|
||||
m_LocalVariables_Field = typeof(LocalizedString).GetField("m_LocalVariables", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
if (m_LocalVariables_Field == null)
|
||||
{
|
||||
DefaultLoggers.DefaultLogger.LogError("Could not find field 'UnityEngine.LocalizedString.m_LocalVariables'" +
|
||||
" - the internals of the Localization package have changed, and deserialization of Odin-serialized" +
|
||||
" LocalizedString instances may be broken in some cases.");
|
||||
}
|
||||
}
|
||||
|
||||
protected override LocalizedString GetUninitializedObject()
|
||||
{
|
||||
return new LocalizedString();
|
||||
}
|
||||
|
||||
protected override void DeserializeImplementation(ref LocalizedString value, IDataReader reader)
|
||||
{
|
||||
base.DeserializeImplementation(ref value, reader);
|
||||
|
||||
if (m_LocalVariables_Field != null && value != null)
|
||||
{
|
||||
var localVariablesList = m_LocalVariables_Field.GetValue(value);
|
||||
|
||||
// This list is not allowed to be null!
|
||||
if (localVariablesList == null)
|
||||
{
|
||||
localVariablesList = Activator.CreateInstance(m_LocalVariables_Field.FieldType);
|
||||
m_LocalVariables_Field.SetValue(value, localVariablesList);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 93ff93294e9339b40b68190c779d0009
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Sirenix.OdinInspector.Modules.UnityLocalization",
|
||||
"references": [ "Unity.Localization", "Sirenix.Serialization", "Sirenix.Serialization.Config" ],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
"allowUnsafeCode": true,
|
||||
"autoReferenced": true,
|
||||
"overrideReferences": false,
|
||||
"precompiledReferences": [ "Sirenix.Serialization.dll", "Sirenix.Serialization.Config.dll" ],
|
||||
"defineConstraints": [ "!ODIN_INSPECTOR_EDITOR_ONLY" ]
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 09320d9ddd505f84d9a6e5203cf75192
|
||||
AssemblyDefinitionImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,14 @@
|
||||
ManifestVersion: 1
|
||||
ModuleID: Unity.Localization
|
||||
ModuleVersion: 1.1.0.0
|
||||
ModuleFiles:
|
||||
Editor.meta
|
||||
Runtime.meta
|
||||
Editor/LocalizationSupport.cs
|
||||
Editor/LocalizationSupport.cs.meta
|
||||
Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef
|
||||
Editor/Sirenix.OdinInspector.Modules.UnityLocalization.Editor.asmdef.meta
|
||||
Runtime/LocalizedStringFormatter.cs
|
||||
Runtime/LocalizedStringFormatter.cs.meta
|
||||
Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef
|
||||
Runtime/Sirenix.OdinInspector.Modules.UnityLocalization.asmdef.meta
|
||||
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7a45c9366323d464589438f0da4086d4
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Reference in New Issue
Block a user