浏览代码

added font files for simplified chinese, japanese and korean, added font swap functionlity

/main
Dan 4 年前
当前提交
ba296092
共有 18 个文件被更改,包括 3166 次插入2030 次删除
  1. 121
      Assets/UX/Scenes/UXManagerScene.unity
  2. 72
      Assets/UX/Scripts/LocalizationManager.cs
  3. 1001
      Assets/Common/Fonts/NotoSansCJKjp-Regular SDF.asset
  4. 8
      Assets/Common/Fonts/NotoSansCJKjp-Regular SDF.asset.meta
  5. 22
      Assets/Common/Fonts/NotoSansCJKjp-Regular.otf.meta
  6. 1001
      Assets/Common/Fonts/NotoSansCJKkr-Regular SDF.asset
  7. 8
      Assets/Common/Fonts/NotoSansCJKkr-Regular SDF.asset.meta
  8. 22
      Assets/Common/Fonts/NotoSansCJKkr-Regular.otf.meta
  9. 953
      Assets/Common/Fonts/NotoSansCJKsc-Regular SDF.asset
  10. 8
      Assets/Common/Fonts/NotoSansCJKsc-Regular SDF.asset.meta
  11. 22
      Assets/Common/Fonts/NotoSansCJKsc-Regular.otf.meta
  12. 927
      Assets/Common/Fonts/Sunflower-Medium SDF.asset
  13. 8
      Assets/Common/Fonts/Sunflower-Medium SDF.asset.meta
  14. 1001
      Assets/Common/Fonts/Sunflower-Medium.ttf
  15. 22
      Assets/Common/Fonts/Sunflower-Medium.ttf.meta

121
Assets/UX/Scenes/UXManagerScene.unity


debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!114 &16318564 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
m_PrefabInstance: {fileID: 5977163237366113874}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &282840810
GameObject:
m_ObjectHideFlags: 0

m_DisablePlaneRendering: 1
m_PointCloudManager: {fileID: 1335839536}
m_PlaneManager: {fileID: 1335839537}
--- !u!114 &1866685902 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 249903488, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
m_PrefabInstance: {fileID: 5977163237366113874}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2146458540
GameObject:
m_ObjectHideFlags: 0

m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 249903488, guid: 29251f2f7c5044cce8e7eb862b4d93ef, type: 3}
propertyPath: m_enableAutoSizing
value: 1
objectReference: {fileID: 0}
- target: {fileID: 249903488, guid: 29251f2f7c5044cce8e7eb862b4d93ef, type: 3}
propertyPath: m_fontSize
value: 18
objectReference: {fileID: 0}
- target: {fileID: 249903488, guid: 29251f2f7c5044cce8e7eb862b4d93ef, type: 3}
propertyPath: m_fontSizeMax
value: 48
objectReference: {fileID: 0}
- target: {fileID: 249903488, guid: 29251f2f7c5044cce8e7eb862b4d93ef, type: 3}
propertyPath: m_textInfo.lineCount
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1582620437, guid: 29251f2f7c5044cce8e7eb862b4d93ef, type: 3}
propertyPath: m_LocalizeText
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
- target: {fileID: 5977163237366113879, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_firstOverflowCharacterIndex
value: -1
propertyPath: CurrentLocalizedLanguage
value: 6
- target: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
- target: {fileID: 5977163237366113879, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_margin.z
value: 0.74786377
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_InstructionText
value:
objectReference: {fileID: 16318564}
- target: {fileID: 5977163237366113879, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_margin.x
value: -0.9393158
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_ReasonText
value:
objectReference: {fileID: 1866685902}
- target: {fileID: 5977163237366113879, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_enableAutoSizing
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_fontSize
value: 18
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653921, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_fontSizeMax
value: 48
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653923, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653923, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_SizeDelta.x
value: 680
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653923, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_AnchoredPosition.y
value: -870
objectReference: {fileID: 0}
- target: {fileID: 5977163236686653923, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_JapaneseFont
value:
objectReference: {fileID: 11400000, guid: cdb088147c9ed4bb8ab98a33b8db1621,
type: 2}
- target: {fileID: 5977163237366113879, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
propertyPath: m_SizeDelta.y
value: 140
objectReference: {fileID: 0}
propertyPath: m_KoreanFont
value:
objectReference: {fileID: 11400000, guid: 4897fa2674fae4b8cbaf5f5d0da2caaf,
type: 2}
propertyPath: CurrentLocalizedLanguage
value: 1
objectReference: {fileID: 0}
propertyPath: m_SimplifiedChineseFont
value:
objectReference: {fileID: 11400000, guid: c0eea587536634f07b5b907b5c6ee1a8,
type: 2}
- target: {fileID: 5977163238016480453, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_Name

propertyPath: m_CoachingOverlay
value:
objectReference: {fileID: 427002221}
- target: {fileID: 5977163238016480456, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_LocalizeText
value: 1
objectReference: {fileID: 0}
- target: {fileID: 5977163238016480458, guid: 29251f2f7c5044cce8e7eb862b4d93ef,
type: 3}
propertyPath: m_ARSessionOrigin

72
Assets/UX/Scripts/LocalizationManager.cs


using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.Localization;
using UnityEngine.Localization.Settings;

public bool localizationComplete => m_LocalizationComplete;
[SerializeField]
TMP_FontAsset m_SimplifiedChineseFont;
public TMP_FontAsset simplifiedChineseFont
{
get => m_SimplifiedChineseFont;
set => m_SimplifiedChineseFont = value;
}
[SerializeField]
TMP_FontAsset m_JapaneseFont;
public TMP_FontAsset japaneseFont
{
get => m_JapaneseFont;
set => m_JapaneseFont = value;
}
[SerializeField]
TMP_FontAsset m_KoreanFont;
public TMP_FontAsset koreanFont
{
get => m_KoreanFont;
set => m_KoreanFont = value;
}
[SerializeField]
TMP_Text m_InstructionText;
public TMP_Text instructionText
{
get => m_InstructionText;
set => m_InstructionText = value;
}
[SerializeField]
TMP_Text m_ReasonText;
public TMP_Text reasonText
{
get => m_ReasonText;
set => m_ReasonText = value;
}
IEnumerator Start()
{
yield return LocalizationSettings.InitializationOperation;

LocalizationSettings.SelectedLocale = LocalizationSettings.AvailableLocales.Locales[(int)CurrentLocalizedLanguage];
SwapFonts(CurrentLocalizedLanguage);
// get all values at start, dynamic localization (changing language at runtime) not supported with this structure
var m_Init = LocalizationSettings.StringDatabase.GetLocalizedStringAsync(k_ReasonTable, k_InitializeKey);

}
m_LocalizationComplete = true;
}
void SwapFonts(SupportedLanguages selectedLanguage)
{
TMP_FontAsset m_FontToSet = null;
// only swap fonts for Simplified Chinese, Japanese and Korean
switch (selectedLanguage)
{
case SupportedLanguages.ChineseSimplified:
m_FontToSet = m_SimplifiedChineseFont;
break;
case SupportedLanguages.Japanese:
m_FontToSet = m_JapaneseFont;
break;
case SupportedLanguages.Korean:
m_FontToSet = m_KoreanFont;
break;
}
if (m_FontToSet != null)
{
m_InstructionText.font = m_FontToSet;
m_ReasonText.font = m_FontToSet;
}
}
}

1001
Assets/Common/Fonts/NotoSansCJKjp-Regular SDF.asset
文件差异内容过多而无法显示
查看文件

8
Assets/Common/Fonts/NotoSansCJKjp-Regular SDF.asset.meta


fileFormatVersion: 2
guid: cdb088147c9ed4bb8ab98a33b8db1621
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

22
Assets/Common/Fonts/NotoSansCJKjp-Regular.otf.meta


fileFormatVersion: 2
guid: 9ecf95665ac0843429a538e930ff8764
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Noto Sans CJK JP
fontNames:
- Noto Sans CJK JP
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/Common/Fonts/NotoSansCJKkr-Regular SDF.asset
文件差异内容过多而无法显示
查看文件

8
Assets/Common/Fonts/NotoSansCJKkr-Regular SDF.asset.meta


fileFormatVersion: 2
guid: 4897fa2674fae4b8cbaf5f5d0da2caaf
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

22
Assets/Common/Fonts/NotoSansCJKkr-Regular.otf.meta


fileFormatVersion: 2
guid: 963f85d98f2fe46dfa36d838fdf028d2
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Noto Sans CJK KR
fontNames:
- Noto Sans CJK KR
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

953
Assets/Common/Fonts/NotoSansCJKsc-Regular SDF.asset
文件差异内容过多而无法显示
查看文件

8
Assets/Common/Fonts/NotoSansCJKsc-Regular SDF.asset.meta


fileFormatVersion: 2
guid: c0eea587536634f07b5b907b5c6ee1a8
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

22
Assets/Common/Fonts/NotoSansCJKsc-Regular.otf.meta


fileFormatVersion: 2
guid: ba643852f6c6248389e971f68928e8a0
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Noto Sans CJK SC
fontNames:
- Noto Sans CJK SC
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

927
Assets/Common/Fonts/Sunflower-Medium SDF.asset
文件差异内容过多而无法显示
查看文件

8
Assets/Common/Fonts/Sunflower-Medium SDF.asset.meta


fileFormatVersion: 2
guid: ec8374f10812d40b2a406deeff190249
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 0
userData:
assetBundleName:
assetBundleVariant:

1001
Assets/Common/Fonts/Sunflower-Medium.ttf
文件差异内容过多而无法显示
查看文件

22
Assets/Common/Fonts/Sunflower-Medium.ttf.meta


fileFormatVersion: 2
guid: 5298c1065c1dd453cb586d879ea9a074
TrueTypeFontImporter:
externalObjects: {}
serializedVersion: 4
fontSize: 16
forceTextureCase: -2
characterSpacing: 0
characterPadding: 1
includeFontData: 1
fontName: Sunflower
fontNames:
- Sunflower
fallbackFontReferences: []
customCharacters:
fontRenderingMode: 0
ascentCalculationMode: 1
useLegacyBoundsCalculation: 0
shouldRoundAdvanceValue: 1
userData:
assetBundleName:
assetBundleVariant:

部分文件因为文件数量过多而无法显示

正在加载...
取消
保存