feat(ui): 添加终端章节面板标题本地化

This commit is contained in:
2026-07-05 00:16:34 +08:00
parent 84764d7b6b
commit f87dcc687f
34 changed files with 383 additions and 8 deletions
@@ -47,6 +47,11 @@ MonoBehaviour:
- Locale-en
- Locale-ja-JP
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 7ea8c68fdc624de4c86434963c06ec55
m_Address: Assets/Language/ChapterInfo/ChapterInfo Shared Data.asset
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -29,6 +29,12 @@ MonoBehaviour:
m_SerializedLabels:
- Locale-zh-Hans
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: bdf8ad79a9f707b45805e23c25ccdadb
m_Address: ChapterInfo_zh-Hans
m_ReadOnly: 1
m_SerializedLabels:
- Locale-zh-Hans
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -29,6 +29,12 @@ MonoBehaviour:
m_SerializedLabels:
- Locale-en
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 8906df9235e52fb41b11fe8776a77032
m_Address: ChapterInfo_en
m_ReadOnly: 1
m_SerializedLabels:
- Locale-en
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -29,6 +29,12 @@ MonoBehaviour:
m_SerializedLabels:
- Locale-ja-JP
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: 9d8accfdeabc8034c986233920a17184
m_Address: ChapterInfo_ja-JP
m_ReadOnly: 1
m_SerializedLabels:
- Locale-ja-JP
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 77169ce22e430f64fb36c771815a4a7b, type: 2}
m_SchemaSet:
@@ -17,6 +17,7 @@ namespace AibisDream.SystemEditor
EditorGUILayout.Space();
EditorGUILayout.LabelField("显示信息", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(serializedObject.FindProperty("title"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("titleKey"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("description"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("coverPic"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("chapter"));
@@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 7835984298058520967}
- component: {fileID: 1609702765442850283}
- component: {fileID: 7824289977680254835}
- component: {fileID: 2847364519283746190}
m_Layer: 0
m_Name: Text
m_TagString: Untagged
@@ -134,6 +135,46 @@ MonoBehaviour:
m_hasFontAssetChanged: 0
m_baseMaterial: {fileID: 0}
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
--- !u!114 &2847364519283746190
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3741443766353379355}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 56eb0353ae6e5124bb35b17aff880f16, type: 3}
m_Name:
m_EditorClassIdentifier:
m_StringReference:
m_TableReference:
m_TableCollectionName:
m_TableEntryReference:
m_KeyId: 0
m_Key:
m_FallbackState: 0
m_WaitForCompletion: 0
m_LocalVariables: []
m_FormatArguments: []
m_UpdateString:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 7824289977680254835}
m_TargetAssemblyTypeName: TMPro.TMP_Text, Unity.TextMeshPro
m_MethodName: set_text
m_Mode: 0
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName:
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 1
references:
version: 2
RefIds: []
--- !u!1 &5803930194917653799
GameObject:
m_ObjectHideFlags: 0
@@ -636,6 +677,7 @@ MonoBehaviour:
rightPreview: {fileID: 8065397976120885801}
emptyText: {fileID: 574046667114464224}
selectedTitleText: {fileID: 7824289977680254835}
selectedTitleLocalize: {fileID: 2847364519283746190}
previousButton: {fileID: 4277087511383866260}
nextButton: {fileID: 7511681537542705576}
restartButton: {fileID: 3594820709225083917}
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6493808043fdb1a4698ca4598e421589
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,52 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5b11a58205ec3474ca216360e9fa74a8, type: 3}
m_Name: ChapterInfo Shared Data
m_EditorClassIdentifier:
m_TableCollectionName: ChapterInfo
m_TableCollectionNameGuidString: 7ea8c68fdc624de4c86434963c06ec55
m_Entries:
- m_Id: 3062295029520000001
m_Key: scene_day0_prologue
m_Metadata:
m_Items: []
- m_Id: 3062295029520000002
m_Key: scene_day1_begin
m_Metadata:
m_Items: []
- m_Id: 3062295029520000003
m_Key: scene_day1_first_pp1
m_Metadata:
m_Items: []
- m_Id: 3062295029520000004
m_Key: scene_day1_mid
m_Metadata:
m_Items: []
- m_Id: 3062295029520000005
m_Key: scene_day1_night
m_Metadata:
m_Items: []
- m_Id: 3062295029520000006
m_Key: scene_day1_sleep
m_Metadata:
m_Items: []
m_Metadata:
m_Items: []
m_KeyGenerator:
rid: 3062295019520000006
references:
version: 2
RefIds:
- rid: 3062295019520000006
type: {class: DistributedUIDGenerator, ns: UnityEngine.Localization.Tables, asm: Unity.Localization}
data:
m_CustomEpoch: 1783180286110
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7ea8c68fdc624de4c86434963c06ec55
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,24 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5be51871efa6c3e4eae1703925c8f5ac, type: 3}
m_Name: ChapterInfo
m_EditorClassIdentifier:
m_SharedTableData: {fileID: 11400000, guid: 7ea8c68fdc624de4c86434963c06ec55, type: 2}
m_Tables:
- {fileID: 11400000, guid: 8906df9235e52fb41b11fe8776a77032, type: 2}
- {fileID: 11400000, guid: bdf8ad79a9f707b45805e23c25ccdadb, type: 2}
- {fileID: 11400000, guid: 9d8accfdeabc8034c986233920a17184, type: 2}
m_Extensions: []
m_Group: String Table
references:
version: 2
RefIds: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 490eb00e17f7ee84c8d08da5ce00a7e3
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3}
m_Name: ChapterInfo_en
m_EditorClassIdentifier:
m_LocaleId:
m_Code: en
m_SharedData: {fileID: 11400000, guid: 7ea8c68fdc624de4c86434963c06ec55, type: 2}
m_Metadata:
m_Items: []
m_TableData:
- m_Id: 3062295029520000001
m_Localized: 'Prologue: Nightmare'
m_Metadata:
m_Items: []
- m_Id: 3062295029520000002
m_Localized: 'Day 1: Morning'
m_Metadata:
m_Items: []
- m_Id: 3062295029520000003
m_Localized: Art Model Patient - Pepe
m_Metadata:
m_Items: []
- m_Id: 3062295029520000004
m_Localized: 'Day 1: Noon'
m_Metadata:
m_Items: []
- m_Id: 3062295029520000005
m_Localized: 'Day 1: Night'
m_Metadata:
m_Items: []
- m_Id: 3062295029520000006
m_Localized: Dream 1
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8906df9235e52fb41b11fe8776a77032
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3}
m_Name: ChapterInfo_ja-JP
m_EditorClassIdentifier:
m_LocaleId:
m_Code: ja-JP
m_SharedData: {fileID: 11400000, guid: 7ea8c68fdc624de4c86434963c06ec55, type: 2}
m_Metadata:
m_Items: []
m_TableData:
- m_Id: 3062295029520000001
m_Localized: "\u5E8F\u7AE0: \u60AA\u5922"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000002
m_Localized: "\u4E00\u65E5\u76EE\uFF1A\u671D"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000003
m_Localized: "\u7F8E\u8853\u578B\u60A3\u8005 - \u30DA\u30DA"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000004
m_Localized: "\u4E00\u65E5\u76EE\uFF1A\u663C"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000005
m_Localized: "\u4E00\u65E5\u76EE\uFF1A\u591C"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000006
m_Localized: "\u5922\u30FB1"
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9d8accfdeabc8034c986233920a17184
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,47 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e9620f8c34305754d8cc9a7e49e852d9, type: 3}
m_Name: ChapterInfo_zh-Hans
m_EditorClassIdentifier:
m_LocaleId:
m_Code: zh-Hans
m_SharedData: {fileID: 11400000, guid: 7ea8c68fdc624de4c86434963c06ec55, type: 2}
m_Metadata:
m_Items: []
m_TableData:
- m_Id: 3062295029520000001
m_Localized: "\u5E8F\u7AE0\uFF1A\u5669\u68A6"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000002
m_Localized: "\u7B2C\u4E00\u5929\u65E9\u4E0A"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000003
m_Localized: "\u7F8E\u5DE5\u578B\u53F7\u60A3\u8005-\u4F69\u4F69"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000004
m_Localized: "\u7B2C\u4E00\u5929\uFF0C\u4E2D\u5348"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000005
m_Localized: "\u7B2C\u4E00\u5929\uFF0C\u665A\u4E0A"
m_Metadata:
m_Items: []
- m_Id: 3062295029520000006
m_Localized: "\u7B2C\u4E00\u4E2A\u68A6"
m_Metadata:
m_Items: []
references:
version: 2
RefIds: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bdf8ad79a9f707b45805e23c25ccdadb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 2fa76ffaa57f62244b77be9b25ca14c2, type: 3}
firstSceneName: Scene/OpenFixScene
title: "\u5E8F\u7AE0\uFF1A\u5669\u68A6"
titleKey: scene_day0_prologue
description: "\u9519\u8BEF\u6570\u636E"
coverPic: {fileID: 21300000, guid: c66b2b5ca74393c45a0d281a6662aa54, type: 3}
chapter: "\u9519\u8BEF\u6570\u636E"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 26fc6619bbcda734a81361b8bb615f04, type: 3}
firstSceneName: Scene/PeipeiFixScene
title: "\u7F8E\u5DE5\u578B\u53F7\u60A3\u8005-\u4F69\u4F69"
titleKey: scene_day1_first_pp1
description: "\u8BB0\u5FC6-\u89C6\u89C9\u6865\u622A\u65AD\u672F"
coverPic: {fileID: 21300000, guid: ef7ba7c21d2aea048abe5729d7da2eee, type: 3}
chapter: "\u8BB0\u5FC6-\u89C6\u89C9\u6865\u622A\u65AD\u672F"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 533dc422c8871c143a551bd5d446b439, type: 3}
firstSceneName: Scene/SubWay
title: "\u7B2C\u4E00\u5929\u65E9\u4E0A"
titleKey: scene_day1_begin
description: "\u5730\u94C1\uFF0C\u548C\u706B\u5C71\u7684\u5BF9\u8BDD"
coverPic: {fileID: 21300000, guid: f78e34492dd89b341928553dd1dfcbdb, type: 3}
chapter: "\u5730\u94C1\uFF0C\u548C\u706B\u5C71\u7684\u5BF9\u8BDD"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 293561ce52efc594399242651d44b366, type: 3}
firstSceneName: Scene/ClinicOut
title: "\u7B2C\u4E00\u5929\uFF0C\u4E2D\u5348"
titleKey: scene_day1_mid
description: "\u4F69\u4F691\u7ED3\u675F\u540E\u7684\u5BF9\u8BDD"
coverPic: {fileID: 21300000, guid: 7715c89797cc6ca4e914b85f5524e9fd, type: 3}
chapter: "\u4F69\u4F691\u7ED3\u675F\u540E\u7684\u5BF9\u8BDD"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 29ebe788cfe2c084e88ffdd8e2f93378, type: 3}
firstSceneName: "Scene/\u9152\u5427\u573A\u666F"
title: "\u7B2C\u4E00\u5929\uFF0C\u665A\u4E0A"
titleKey: scene_day1_night
description: "\u9152\u5427\u548C\u5947\u7433\u7684\u5BF9\u8BDD"
coverPic: {fileID: 21300000, guid: df86302e77350e34ea422cd24043dd93, type: 3}
chapter: "\u9152\u5427\u548C\u5947\u7433\u7684\u5BF9\u8BDD"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: beb6e77de3427b04dae210b2c9ca29a1, type: 3}
firstSceneName: "Scene/\u68A6\u5883"
title: "\u7B2C\u4E00\u4E2A\u68A6"
titleKey: scene_day1_sleep
description: "\u627E\u5230\u5929\u6587\u53F0\u7684\u5165\u53E3"
coverPic: {fileID: 21300000, guid: 20296b9c29cb10f4a97913165e98fb62, type: 3}
chapter: "\u627E\u5230\u5929\u6587\u53F0\u7684\u5165\u53E3"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 01b0567a3c6489a4c998435857e3cebc, type: 3}
firstSceneName: Scene/HuoShanFixScene
title: "\u706B\u5C71"
titleKey: scene_day2_first_hs1
description: "\u6211\u7684\u7535\u89C6\u5934\u670B\u53CB"
coverPic: {fileID: 21300000, guid: 77af8281471ddab42993b4b7795f2f57, type: 3}
chapter: "\u6211\u7684\u7535\u89C6\u5934\u670B\u53CB"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 247e2ccd847942843bb87841bb9888c5, type: 3}
firstSceneName: Scene/PeipeiFixScene
title: "\u505C\u6B62\u60F3\u8C61"
titleKey: scene_day2_next_pp2
description: "\u505C\u6B62\u60F3\u8C61"
coverPic: {fileID: 21300000, guid: ef7ba7c21d2aea048abe5729d7da2eee, type: 3}
chapter: "\u505C\u6B62\u60F3\u8C61"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 6ecfe80fd0370554db9a7ec3a173f7e3, type: 3}
firstSceneName: Scene/SubWay
title: "\u5730\u94C1\u4E0A"
titleKey: scene_day2_begin
description: "\u5BBF\u9189"
coverPic: {fileID: 21300000, guid: 922da7b13a1cf2747a43933c2afea754, type: 3}
chapter: "\u5BBF\u9189"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 25f49957c68bca34bb1aeafec7feca8b, type: 3}
firstSceneName: Scene/ClinicOut
title: "\u7B2C\u4E8C\u5929\u4E2D\u5348"
titleKey: scene_day2_mid
description: "\u7B2C\u4E8C\u5929\u4E2D\u5348"
coverPic: {fileID: 21300000, guid: 7715c89797cc6ca4e914b85f5524e9fd, type: 3}
chapter: "\u7B2C\u4E8C\u5929\u4E2D\u5348"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: ec06c945cb99fb544b1dd9a2a6ea9a7b, type: 3}
firstSceneName: Scene/ClinicOut
title: "\u5915\u9633"
titleKey: scene_day2_night
description: "\u5915\u9633"
coverPic: {fileID: 21300000, guid: dc09bd90b2ce79249ac504f07b98944f, type: 3}
chapter: "\u5915\u9633"
@@ -18,6 +18,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: 62f2a99a47fc652449b846035a739529, type: 3}
firstSceneName: "Scene/\u68A6\u5883"
title: "\u542F\u793A"
titleKey: scene_day2_sleep
description: "\u6D77\u662F\u5B58\u5728\u7684\u5417\uFF1F"
coverPic: {fileID: 21300000, guid: 2796d4ad771bcde488978d1c1e67ed8f, type: 3}
chapter: "\u6D77\u662F\u5B58\u5728\u7684\u5417\uFF1F"
@@ -16,6 +16,7 @@ MonoBehaviour:
yarnProject: {fileID: 7545569452688597077, guid: e6bac2644a8a04b4899ce2fe8ae1f4fc, type: 3}
firstSceneName: Scene/SubWay
title: PlaytestEnd
titleKey: scene_general_end
description: PlaytestEnd
coverPic: {fileID: 21300000, guid: 8344881c78a9845499555d573e34e362, type: 3}
chapter: 99
+1
View File
@@ -57,6 +57,7 @@ namespace AibisDream.Utility
#region
public const string UITextTable = "UIText";
public const string ChapterInfoTable = "ChapterInfo";
#endregion
@@ -34,6 +34,7 @@ namespace AibisDream
{
chapterSo = chapterSo,
title = chapterSo.title,
titleKey = chapterSo.titleKey,
chapter = chapterSo.chapter,
desc = chapterSo.description,
pic = chapterSo.coverPic,
@@ -122,6 +123,7 @@ namespace AibisDream
public struct ChapterVo
{
public string title;
public string titleKey;
public string chapter;
public string desc;
public Sprite pic;
+4
View File
@@ -31,6 +31,10 @@ namespace AibisDream
#region
public string title;
[Tooltip("章节面板显示用本地化 Key,对应 ChapterInfo 表条目;为空则回退 title")]
public string titleKey;
public string description;
public Sprite coverPic;
public string chapter;
@@ -1,7 +1,10 @@
using System;
using System.Collections.Generic;
using AibisDream;
using AibisDream.Utility;
using TMPro;
using UnityEngine;
using UnityEngine.Localization.Components;
using UnityEngine.UI;
namespace AibisDream.UI
@@ -14,6 +17,7 @@ namespace AibisDream.UI
[SerializeField] private TerminalChapterItemView rightPreview;
[SerializeField] private TMP_Text emptyText;
[SerializeField] private TMP_Text selectedTitleText;
[SerializeField] private LocalizeStringEvent selectedTitleLocalize;
[SerializeField] private Button previousButton;
[SerializeField] private Button nextButton;
[SerializeField] private Button restartButton;
@@ -32,6 +36,11 @@ namespace AibisDream.UI
private void Awake()
{
if (selectedTitleLocalize == null && selectedTitleText != null)
{
selectedTitleLocalize = selectedTitleText.GetComponent<LocalizeStringEvent>();
}
previousButton?.onClick.AddListener(Previous);
nextButton?.onClick.AddListener(Next);
restartButton?.onClick.AddListener(Restart);
@@ -109,10 +118,7 @@ namespace AibisDream.UI
if (!hasChapters)
{
if (selectedTitleText != null)
{
selectedTitleText.text = "NO CHAPTER DATA";
}
SetSelectedTitle(null, "NO CHAPTER DATA");
restartButton?.gameObject.SetActive(false);
UpdateNavigationButtons(false);
@@ -132,10 +138,7 @@ namespace AibisDream.UI
rightPreview?.Init(_chapters[_currentIndex + 1], selected: false, preview: true);
}
if (selectedTitleText != null)
{
selectedTitleText.text = current.title;
}
SetSelectedTitle(current.titleKey, current.title);
restartButton?.gameObject.SetActive(true);
UpdateNavigationButtons(true);
@@ -162,6 +165,27 @@ namespace AibisDream.UI
}
}
private void SetSelectedTitle(string titleKey, string fallbackTitle)
{
if (!string.IsNullOrEmpty(titleKey) && selectedTitleLocalize != null)
{
selectedTitleLocalize.enabled = true;
selectedTitleLocalize.SetTable(ConstRef.ChapterInfoTable);
selectedTitleLocalize.SetEntry(titleKey);
return;
}
if (selectedTitleLocalize != null)
{
selectedTitleLocalize.enabled = false;
}
if (selectedTitleText != null)
{
selectedTitleText.text = fallbackTitle;
}
}
private void Previous()
{
if (_chapters.Count == 0 || _currentIndex <= 0)