From 0a8c63e6c92638366a42498e1d5f0b2af4a46e7c Mon Sep 17 00:00:00 2001 From: Steve Halliwell Date: Thu, 20 Aug 2020 16:46:54 +1000 Subject: [PATCH] Remove doReadHead logic path from writer with TMPro --- Assets/Fungus/Scripts/Components/Writer.cs | 3 +- Assets/Tests/WritingSpeedTest.unity | 143 ++++++++++++++++++++- 2 files changed, 138 insertions(+), 8 deletions(-) diff --git a/Assets/Fungus/Scripts/Components/Writer.cs b/Assets/Fungus/Scripts/Components/Writer.cs index 6e2d40d0..d3006010 100644 --- a/Assets/Fungus/Scripts/Components/Writer.cs +++ b/Assets/Fungus/Scripts/Components/Writer.cs @@ -288,7 +288,7 @@ namespace Fungus // Update the read ahead string buffer. This contains the text for any // Word tags which are further ahead in the list. - if (doReadAheadText) + if (doReadAheadText && !textAdapter.SupportsHiddenCharacters()) { readAheadString.Length = 0; for (int j = i + 1; j < tokens.Count; ++j) @@ -586,7 +586,6 @@ namespace Fungus textAdapter.RevealedCharacters++; NotifyGlyph(); - //TODO need to log some info here, it's not a perf spike // Punctuation pause if (IsPunctuation(textAdapter.LastRevealedCharacter)) diff --git a/Assets/Tests/WritingSpeedTest.unity b/Assets/Tests/WritingSpeedTest.unity index 94903426..dd7912c3 100644 --- a/Assets/Tests/WritingSpeedTest.unity +++ b/Assets/Tests/WritingSpeedTest.unity @@ -96,6 +96,7 @@ LightmapSettings: m_PVRFilteringAtrousPositionSigmaAO: 1 m_ExportTrainingData: 0 m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 m_LightingDataAsset: {fileID: 0} m_UseShadowmask: 1 --- !u!196 &4 @@ -217,6 +218,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -355,6 +357,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -428,6 +431,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -535,6 +539,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -612,6 +617,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0.25882354, g: 0.25490198, b: 0.2627451, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -645,6 +651,10 @@ GameObject: - component: {fileID: 911349663} - component: {fileID: 911349662} - component: {fileID: 911349661} + - component: {fileID: 911349664} + - component: {fileID: 911349665} + - component: {fileID: 911349666} + - component: {fileID: 911349667} m_Layer: 0 m_Name: GameObject m_TagString: Untagged @@ -668,7 +678,7 @@ MonoBehaviour: scrollPos: {x: 0, y: 0} variablesScrollPos: {x: 0, y: 0} variablesExpanded: 1 - blockViewHeight: 400 + blockViewHeight: 478 zoom: 1 scrollViewRect: serializedVersion: 2 @@ -679,7 +689,7 @@ MonoBehaviour: selectedBlocks: - {fileID: 911349658} selectedCommands: - - {fileID: 911349661} + - {fileID: 911349666} variables: [] description: stepPause: 0 @@ -735,8 +745,8 @@ MonoBehaviour: m_EditorClassIdentifier: nodeRect: serializedVersion: 2 - x: 306 - y: 116 + x: 300 + y: 120 width: 120 height: 40 tint: {r: 1, g: 1, b: 1, a: 1} @@ -748,8 +758,12 @@ MonoBehaviour: commandList: - {fileID: 911349663} - {fileID: 911349657} + - {fileID: 911349665} - {fileID: 911349662} - {fileID: 911349661} + - {fileID: 911349667} + - {fileID: 911349664} + - {fileID: 911349666} suppressAllAutoSelections: 0 --- !u!4 &911349659 Transform: @@ -840,6 +854,118 @@ MonoBehaviour: itemId: 2 indentLevel: 0 sayDialog: {fileID: 1470136050} +--- !u!114 &911349664 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911349655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 5 + indentLevel: 0 + storyText: Say that again... + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + waitForVO: 0 + setSayDialog: {fileID: 0} +--- !u!114 &911349665 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911349655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 6 + indentLevel: 0 + storyText: Say long words, big words that cause a wrap like antidisestablishmentarianism, + extraneously multisyllabic, or supercalifragilisticexpialidocious! + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + waitForVO: 0 + setSayDialog: {fileID: 0} +--- !u!114 &911349666 +MonoBehaviour: + m_ObjectHideFlags: 2 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911349655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 7 + indentLevel: 0 + storyText: '{s=10}{b}Say {i}with{/i}{/b} TM{color=red}Pro and then there is yet + more {/color}words, big ones. Like antidisestablishmentarianism, extraneously + multisyllabic, or supercalifragilisticexpialidocious!' + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + waitForVO: 0 + setSayDialog: {fileID: 0} +--- !u!114 &911349667 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 911349655} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: ec422cd568a9c4a31ad7c36d0572b9da, type: 3} + m_Name: + m_EditorClassIdentifier: + itemId: 8 + indentLevel: 0 + storyText: '{b}Say {i}with{/i}{/b} TM{color=red}Pro and{/color}words, big ones. + Like antidisestablishmentarianism, extraneously multisyllabic, or supercalifragilisticexpialidocious!' + description: + character: {fileID: 0} + portrait: {fileID: 0} + voiceOverClip: {fileID: 0} + showAlways: 1 + showCount: 1 + extendPrevious: 0 + fadeWhenDone: 1 + waitForClick: 1 + stopVoiceover: 1 + waitForVO: 0 + setSayDialog: {fileID: 0} --- !u!1 &1030652734 GameObject: m_ObjectHideFlags: 0 @@ -874,6 +1000,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1042,6 +1169,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1117,6 +1245,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1565,7 +1694,6 @@ MonoBehaviour: writeWholeWords: 0 forceRichText: 1 instantComplete: 1 - doReadAheadText: 1 --- !u!114 &1470136057 MonoBehaviour: m_ObjectHideFlags: 0 @@ -1692,6 +1820,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1789,6 +1918,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -1996,6 +2126,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0.25882354, g: 0.25490198, b: 0.2627451, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2073,6 +2204,7 @@ MonoBehaviour: m_Material: {fileID: 0} m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} m_RaycastTarget: 1 + m_Maskable: 1 m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] @@ -2277,7 +2409,6 @@ MonoBehaviour: writeWholeWords: 0 forceRichText: 1 instantComplete: 1 - doReadAheadText: 1 --- !u!114 &1802548009 MonoBehaviour: m_ObjectHideFlags: 0