Fontsize now affects exhibit titles

This commit is contained in:
2018-10-26 16:42:42 +02:00
parent e573e69243
commit e74dd2861e
8 changed files with 40 additions and 15 deletions

View File

@@ -42,6 +42,7 @@ GameObject:
- component: {fileID: 222811054124192620}
- component: {fileID: 114580846098669954}
- component: {fileID: 114748046949405592}
- component: {fileID: 114657141587138028}
m_Layer: 0
m_Name: TextMeshPro
m_TagString: Untagged
@@ -318,6 +319,18 @@ MonoBehaviour:
- {fileID: 0}
- {fileID: 0}
m_maskType: 0
--- !u!114 &114657141587138028
MonoBehaviour:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1153460862401542}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 8b136c9157840904ba79e96d50f494bc, type: 3}
m_Name:
m_EditorClassIdentifier:
SizeClass: 2
--- !u!114 &114748046949405592
MonoBehaviour:
m_ObjectHideFlags: 1

View File

@@ -75,7 +75,6 @@ namespace RothenburgAR.UI
{
ModelButton.SetActive(false);
}
//TODO implement
}
public void SwitchToFullscreenModelView()

View File

@@ -20,14 +20,16 @@ namespace RothenburgAR.UI
FontsizeSetting.Default, new Dictionary<FontsizeClass, float>
{
{FontsizeClass.Header, 40f},
{FontsizeClass.Body, 25f}
{FontsizeClass.Body, 25f},
{FontsizeClass.ExhibitTitle, 1f}
}
},
{
FontsizeSetting.Large, new Dictionary<FontsizeClass, float>
{
{FontsizeClass.Header, 55f},
{FontsizeClass.Body, 30f}
{FontsizeClass.Header, 48},
{FontsizeClass.Body, 30f},
{FontsizeClass.ExhibitTitle, 1.2f}
}
}
};
@@ -75,6 +77,7 @@ namespace RothenburgAR.UI
public enum FontsizeClass
{
Header,
Body
Body,
ExhibitTitle
}
}

View File

@@ -47,6 +47,14 @@ namespace RothenburgAR.UI
{
Debug.Log("Switching Font size to '" + Enum.GetName(typeof(FontsizeSetting), setting) + "'");
FontsizeManager.Instance.CurrentFontsizeSetting = setting;
StateManager sm = TrackerManager.Instance.GetStateManager();
foreach (var item in sm.GetActiveTrackableBehaviours())
{
var teh = item.gameObject.GetComponent<TrackableEventHandler>();
teh.OnTrackableStateChanged(TrackableBehaviour.Status.NOT_FOUND, TrackableBehaviour.Status.TRACKED);
}
SwitchToARView();
}
}

View File

@@ -10,21 +10,21 @@ namespace RothenburgAR.UI
void OnEnable()
{
var tmproText = gameObject.GetComponent<TMPro.TextMeshProUGUI>();
if (tmproText != null)
var tmproTextUI = gameObject.GetComponent<TMPro.TextMeshProUGUI>();
if (tmproTextUI != null)
{
tmproText.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass);
tmproTextUI.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass);
//tmproText.enableAutoSizing = true;
//tmproText.fontSizeMax = FontsizeManager.Instance.GetFontsize(this.SizeClass);
//tmproText.fontSizeMin = tmproText.fontSizeMax * 0.8f;
}
}
void Update()
{
var tmproText = gameObject.GetComponent<TMPro.TextMeshPro>();
if (tmproText != null)
{
tmproText.fontSize = FontsizeManager.Instance.GetFontsize(this.SizeClass);
}
}
}
}

View File

@@ -16,6 +16,8 @@ namespace RothenburgAR.UI
// Dynamically load Title when Exhibit is found
ExhibitTitleBehaviour titleElement = Exhibit.TitleBehaviour;
titleElement.DisplayText = titleElement.DataText.GetTextByLanguage(LanguageManager.Instance.CurrentLanguageKey);
titleElement.gameObject.SetActive(false);
titleElement.gameObject.SetActive(true);
}

View File

@@ -332,7 +332,7 @@ namespace RothenburgAR.Updater
else
{
UpdateCompletedDialog.SetActive(false);
downloadEndedTime = DateTime.Now.AddSeconds(1);
downloadEndedTime = DateTime.Now.AddYears(1);
}
}
}

View File

@@ -571,7 +571,7 @@ PlayerSettings:
webGLCompressionFormat: 1
scriptingDefineSymbols:
1: TMP_PRESENT
4: VUFORIA_IOS_SETTINGS
4: VUFORIA_IOS_SETTINGS;TMP_PRESENT
7: TMP_PRESENT
14: VUFORIA_WSA_SETTINGS
platformArchitecture: {}