diff --git a/Client/Assets/Main.unity b/Client/Assets/Main.unity index 95154ac..8fc7cd3 100644 --- a/Client/Assets/Main.unity +++ b/Client/Assets/Main.unity @@ -119,56 +119,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &558029961 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 558029962} - - component: {fileID: 558029963} - m_Layer: 0 - m_Name: Localization - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &558029962 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 558029961} - serializedVersion: 2 - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 1062825540} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &558029963 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 558029961} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 577f4666bd05453d9b779ce3050b9ec2, type: 3} - m_Name: - m_EditorClassIdentifier: - componentType: ---- !u!4 &1062825540 stripped -Transform: - m_CorrespondingSourceObject: {fileID: 425597497363353001, guid: 8e4808bf30e54a8439a661bfa35ee982, type: 3} - m_PrefabInstance: {fileID: 7354943399308362261} - m_PrefabAsset: {fileID: 0} --- !u!1 &1378554099 GameObject: m_ObjectHideFlags: 0 @@ -358,16 +308,9 @@ PrefabInstance: propertyPath: m_Name value: Entry objectReference: {fileID: 0} - - target: {fileID: 7354290124713579766, guid: 8e4808bf30e54a8439a661bfa35ee982, type: 3} - propertyPath: m_DecryptionServices - value: AlicizaX.Resource.Runtime.FileOffsetDecryption - objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] - m_AddedGameObjects: - - targetCorrespondingSourceObject: {fileID: 425597497363353001, guid: 8e4808bf30e54a8439a661bfa35ee982, type: 3} - insertIndex: -1 - addedObject: {fileID: 558029962} + m_AddedGameObjects: [] m_AddedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 8e4808bf30e54a8439a661bfa35ee982, type: 3} --- !u!1660057539 &9223372036854775807 diff --git a/Client/Packages/com.alicizax.unity.entry/Asset/Entry.prefab b/Client/Packages/com.alicizax.unity.entry/Asset/Entry.prefab index 7364254..4a4256d 100644 --- a/Client/Packages/com.alicizax.unity.entry/Asset/Entry.prefab +++ b/Client/Packages/com.alicizax.unity.entry/Asset/Entry.prefab @@ -535,6 +535,7 @@ Transform: - {fileID: 4323824073023419020} - {fileID: 8452422965548084857} - {fileID: 9160912643551877041} + - {fileID: 9144434048949093429} m_Father: {fileID: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &7461712675371014626 @@ -606,7 +607,7 @@ MonoBehaviour: m_AssetCapacity: 64 m_AssetExpireTime: 60 m_AssetPriority: 0 - m_DecryptionServices: AlicizaX.Resource.Runtime.FileStreamDecryption + m_DecryptionServices: AlicizaX.Resource.Runtime.FileOffsetDecryption --- !u!1 &6601518982324708866 GameObject: m_ObjectHideFlags: 0 @@ -687,6 +688,51 @@ MonoBehaviour: audioRolloffMode: 0 minDistance: 1 maxDistance: 500 +--- !u!1 &6766524136443284204 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 9144434048949093429} + - component: {fileID: 1599215827984154130} + m_Layer: 0 + m_Name: Localization + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &9144434048949093429 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6766524136443284204} + serializedVersion: 2 + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 425597497363353001} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1599215827984154130 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6766524136443284204} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 577f4666bd05453d9b779ce3050b9ec2, type: 3} + m_Name: + m_EditorClassIdentifier: + componentType: AlicizaX.Localization.Runtime.LocalizationManager --- !u!1 &8241741088829230542 GameObject: m_ObjectHideFlags: 0 diff --git a/Client/Packages/com.alicizax.unity.localization/Editor/AlicizaX.Localization.Editor.asmdef b/Client/Packages/com.alicizax.unity.localization/Editor/AlicizaX.Localization.Editor.asmdef index 4a2edcd..8ba3716 100644 --- a/Client/Packages/com.alicizax.unity.localization/Editor/AlicizaX.Localization.Editor.asmdef +++ b/Client/Packages/com.alicizax.unity.localization/Editor/AlicizaX.Localization.Editor.asmdef @@ -1,7 +1,11 @@ { "name": "AlicizaX.Localization.Editor", "rootNamespace": "AlicizaX.Localization.Editor", - "references": [], + "references": [ + "GUID:acfef7cabed3b0a42b25edb1cd4fa259", + "GUID:a19b414bea3b97240a91aeab9a8eab36", + "GUID:75b6f2078d190f14dbda4a5b747d709c" + ], "includePlatforms": [ "Editor" ], diff --git a/Client/Packages/com.alicizax.unity.localization/Editor/LocalizationComponentInspector.cs b/Client/Packages/com.alicizax.unity.localization/Editor/LocalizationComponentInspector.cs new file mode 100644 index 0000000..6fd69c5 --- /dev/null +++ b/Client/Packages/com.alicizax.unity.localization/Editor/LocalizationComponentInspector.cs @@ -0,0 +1,40 @@ +using AlicizaX.Editor; +using AlicizaX.Localization.Runtime; +using AlicizaX.Runtime; +using UnityEditor; + +namespace AlicizaX.Localization.Editor +{ + [CustomEditor(typeof(LocalizationComponent))] + internal sealed class LocalizationComponentInspector : ComponentTypeComponentInspector + { + private SerializedProperty _language; + + public override void OnInspectorGUI() + { + base.OnInspectorGUI(); + serializedObject.Update(); + + serializedObject.ApplyModifiedProperties(); + + Language language = (Language)EditorGUILayout.EnumPopup("语言", (Language)_language.enumValueIndex); + if ((int)language != _language.enumValueIndex) + { + _language.enumValueIndex = (int)language; + } + + Repaint(); + } + + protected override void RefreshTypeNames() + { + RefreshComponentTypeNames(typeof(ILocalizationManager)); + } + + protected override void Enable() + { + base.Enable(); + _language = serializedObject.FindProperty("_language"); + } + } +} diff --git a/Client/Packages/com.alicizax.unity.localization/Editor/LocalizationComponentInspector.cs.meta b/Client/Packages/com.alicizax.unity.localization/Editor/LocalizationComponentInspector.cs.meta new file mode 100644 index 0000000..417b3f7 --- /dev/null +++ b/Client/Packages/com.alicizax.unity.localization/Editor/LocalizationComponentInspector.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: bfdba79454e34e21a0da90fc360c0a34 +timeCreated: 1738836064 \ No newline at end of file diff --git a/Client/Packages/com.alicizax.unity.localization/Runtime/Localization/LocalizationComponent.cs b/Client/Packages/com.alicizax.unity.localization/Runtime/Localization/LocalizationComponent.cs index 63df04c..e6aba61 100644 --- a/Client/Packages/com.alicizax.unity.localization/Runtime/Localization/LocalizationComponent.cs +++ b/Client/Packages/com.alicizax.unity.localization/Runtime/Localization/LocalizationComponent.cs @@ -18,6 +18,7 @@ namespace AlicizaX.Localization.Runtime private EventComponent m_EventComponent = null; private SettingComponent m_SettingComponent = null; + [SerializeField] private Language _language; ///