From b8aa2e0935f309b112648f0352f35f5f33da946b Mon Sep 17 00:00:00 2001
From: dereelatwit <54997325+dereelatwit@users.noreply.github.com>
Date: Thu, 3 Aug 2023 14:05:08 -0400
Subject: started implementing UI
---
.../Examples & Extras/Scripts/Benchmark01.cs | 128 ++++
.../Examples & Extras/Scripts/Benchmark01.cs.meta | 10 +
.../Examples & Extras/Scripts/Benchmark01_UGUI.cs | 135 +++++
.../Scripts/Benchmark01_UGUI.cs.meta | 10 +
.../Examples & Extras/Scripts/Benchmark02.cs | 97 +++
.../Examples & Extras/Scripts/Benchmark02.cs.meta | 11 +
.../Examples & Extras/Scripts/Benchmark03.cs | 92 +++
.../Examples & Extras/Scripts/Benchmark03.cs.meta | 11 +
.../Examples & Extras/Scripts/Benchmark04.cs | 85 +++
.../Examples & Extras/Scripts/Benchmark04.cs.meta | 11 +
.../Examples & Extras/Scripts/CameraController.cs | 292 +++++++++
.../Scripts/CameraController.cs.meta | 10 +
.../Examples & Extras/Scripts/ChatController.cs | 51 ++
.../Scripts/ChatController.cs.meta | 12 +
.../Examples & Extras/Scripts/DropdownSample.cs | 19 +
.../Scripts/DropdownSample.cs.meta | 11 +
.../Examples & Extras/Scripts/EnvMapAnimator.cs | 35 ++
.../Scripts/EnvMapAnimator.cs.meta | 12 +
.../Examples & Extras/Scripts/ObjectSpin.cs | 69 +++
.../Examples & Extras/Scripts/ObjectSpin.cs.meta | 10 +
.../Scripts/ShaderPropAnimator.cs | 51 ++
.../Scripts/ShaderPropAnimator.cs.meta | 10 +
.../Examples & Extras/Scripts/SimpleScript.cs | 58 ++
.../Examples & Extras/Scripts/SimpleScript.cs.meta | 10 +
.../Examples & Extras/Scripts/SkewTextExample.cs | 158 +++++
.../Scripts/SkewTextExample.cs.meta | 12 +
.../Scripts/TMP_DigitValidator.cs | 27 +
.../Scripts/TMP_DigitValidator.cs.meta | 12 +
.../Scripts/TMP_ExampleScript_01.cs | 64 ++
.../Scripts/TMP_ExampleScript_01.cs.meta | 12 +
.../Scripts/TMP_FrameRateCounter.cs | 134 +++++
.../Scripts/TMP_FrameRateCounter.cs.meta | 10 +
.../Scripts/TMP_PhoneNumberValidator.cs | 105 ++++
.../Scripts/TMP_PhoneNumberValidator.cs.meta | 12 +
.../Scripts/TMP_TextEventCheck.cs | 73 +++
.../Scripts/TMP_TextEventCheck.cs.meta | 12 +
.../Scripts/TMP_TextEventHandler.cs | 254 ++++++++
.../Scripts/TMP_TextEventHandler.cs.meta | 12 +
.../Scripts/TMP_TextInfoDebugTool.cs | 652 +++++++++++++++++++++
.../Scripts/TMP_TextInfoDebugTool.cs.meta | 12 +
.../Scripts/TMP_TextSelector_A.cs | 157 +++++
.../Scripts/TMP_TextSelector_A.cs.meta | 12 +
.../Scripts/TMP_TextSelector_B.cs | 547 +++++++++++++++++
.../Scripts/TMP_TextSelector_B.cs.meta | 14 +
.../Scripts/TMP_UiFrameRateCounter.cs | 125 ++++
.../Scripts/TMP_UiFrameRateCounter.cs.meta | 12 +
.../Scripts/TMPro_InstructionOverlay.cs | 84 +++
.../Scripts/TMPro_InstructionOverlay.cs.meta | 10 +
.../Examples & Extras/Scripts/TeleType.cs | 83 +++
.../Examples & Extras/Scripts/TeleType.cs.meta | 10 +
.../Scripts/TextConsoleSimulator.cs | 121 ++++
.../Scripts/TextConsoleSimulator.cs.meta | 12 +
.../Scripts/TextMeshProFloatingText.cs | 223 +++++++
.../Scripts/TextMeshProFloatingText.cs.meta | 11 +
.../Examples & Extras/Scripts/TextMeshSpawner.cs | 79 +++
.../Scripts/TextMeshSpawner.cs.meta | 11 +
.../Examples & Extras/Scripts/VertexColorCycler.cs | 84 +++
.../Scripts/VertexColorCycler.cs.meta | 12 +
.../Examples & Extras/Scripts/VertexJitter.cs | 175 ++++++
.../Examples & Extras/Scripts/VertexJitter.cs.meta | 12 +
.../Examples & Extras/Scripts/VertexShakeA.cs | 161 +++++
.../Examples & Extras/Scripts/VertexShakeA.cs.meta | 12 +
.../Examples & Extras/Scripts/VertexShakeB.cs | 185 ++++++
.../Examples & Extras/Scripts/VertexShakeB.cs.meta | 12 +
.../Examples & Extras/Scripts/VertexZoom.cs | 192 ++++++
.../Examples & Extras/Scripts/VertexZoom.cs.meta | 12 +
.../Examples & Extras/Scripts/WarpTextExample.cs | 144 +++++
.../Scripts/WarpTextExample.cs.meta | 12 +
68 files changed, 5325 insertions(+)
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark03.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark03.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark04.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark04.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/CameraController.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/CameraController.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/ChatController.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/ChatController.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/DropdownSample.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/EnvMapAnimator.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/EnvMapAnimator.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/ObjectSpin.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/ObjectSpin.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/ShaderPropAnimator.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/ShaderPropAnimator.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/SimpleScript.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/SimpleScript.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/SkewTextExample.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/SkewTextExample.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_DigitValidator.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_DigitValidator.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_ExampleScript_01.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_ExampleScript_01.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_FrameRateCounter.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_FrameRateCounter.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_PhoneNumberValidator.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_PhoneNumberValidator.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextEventCheck.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextEventCheck.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextEventHandler.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextEventHandler.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextInfoDebugTool.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextInfoDebugTool.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextSelector_A.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextSelector_A.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextSelector_B.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_TextSelector_B.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_UiFrameRateCounter.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMP_UiFrameRateCounter.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMPro_InstructionOverlay.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TMPro_InstructionOverlay.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TeleType.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TeleType.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs.meta
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs
create mode 100644 Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs.meta
(limited to 'Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts')
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs
new file mode 100644
index 0000000..b48ebbd
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs
@@ -0,0 +1,128 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class Benchmark01 : MonoBehaviour
+ {
+
+ public int BenchmarkType = 0;
+
+ public TMP_FontAsset TMProFont;
+ public Font TextMeshFont;
+
+ private TextMeshPro m_textMeshPro;
+ private TextContainer m_textContainer;
+ private TextMesh m_textMesh;
+
+ private const string label01 = "The <#0050FF>count is: {0}";
+ private const string label02 = "The count is: ";
+
+ //private string m_string;
+ //private int m_frame;
+
+ private Material m_material01;
+ private Material m_material02;
+
+
+
+ IEnumerator Start()
+ {
+
+
+
+ if (BenchmarkType == 0) // TextMesh Pro Component
+ {
+ m_textMeshPro = gameObject.AddComponent();
+ m_textMeshPro.autoSizeTextContainer = true;
+
+ //m_textMeshPro.anchorDampening = true;
+
+ if (TMProFont != null)
+ m_textMeshPro.font = TMProFont;
+
+ //m_textMeshPro.font = Resources.Load("Fonts & Materials/Anton SDF", typeof(TextMeshProFont)) as TextMeshProFont; // Make sure the Anton SDF exists before calling this...
+ //m_textMeshPro.fontSharedMaterial = Resources.Load("Fonts & Materials/Anton SDF", typeof(Material)) as Material; // Same as above make sure this material exists.
+
+ m_textMeshPro.fontSize = 48;
+ m_textMeshPro.alignment = TextAlignmentOptions.Center;
+ //m_textMeshPro.anchor = AnchorPositions.Center;
+ m_textMeshPro.extraPadding = true;
+ //m_textMeshPro.outlineWidth = 0.25f;
+ //m_textMeshPro.fontSharedMaterial.SetFloat("_OutlineWidth", 0.2f);
+ //m_textMeshPro.fontSharedMaterial.EnableKeyword("UNDERLAY_ON");
+ //m_textMeshPro.lineJustification = LineJustificationTypes.Center;
+ m_textMeshPro.enableWordWrapping = false;
+ //m_textMeshPro.lineLength = 60;
+ //m_textMeshPro.characterSpacing = 0.2f;
+ //m_textMeshPro.fontColor = new Color32(255, 255, 255, 255);
+
+ m_material01 = m_textMeshPro.font.material;
+ m_material02 = Resources.Load("Fonts & Materials/LiberationSans SDF - Drop Shadow"); // Make sure the LiberationSans SDF exists before calling this...
+
+
+ }
+ else if (BenchmarkType == 1) // TextMesh
+ {
+ m_textMesh = gameObject.AddComponent();
+
+ if (TextMeshFont != null)
+ {
+ m_textMesh.font = TextMeshFont;
+ m_textMesh.GetComponent().sharedMaterial = m_textMesh.font.material;
+ }
+ else
+ {
+ m_textMesh.font = Resources.Load("Fonts/ARIAL", typeof(Font)) as Font;
+ m_textMesh.GetComponent().sharedMaterial = m_textMesh.font.material;
+ }
+
+ m_textMesh.fontSize = 48;
+ m_textMesh.anchor = TextAnchor.MiddleCenter;
+
+ //m_textMesh.color = new Color32(255, 255, 0, 255);
+ }
+
+
+
+ for (int i = 0; i <= 1000000; i++)
+ {
+ if (BenchmarkType == 0)
+ {
+ m_textMeshPro.SetText(label01, i % 1000);
+ if (i % 1000 == 999)
+ m_textMeshPro.fontSharedMaterial = m_textMeshPro.fontSharedMaterial == m_material01 ? m_textMeshPro.fontSharedMaterial = m_material02 : m_textMeshPro.fontSharedMaterial = m_material01;
+
+
+
+ }
+ else if (BenchmarkType == 1)
+ m_textMesh.text = label02 + (i % 1000).ToString();
+
+ yield return null;
+ }
+
+
+ yield return null;
+ }
+
+
+ /*
+ void Update()
+ {
+ if (BenchmarkType == 0)
+ {
+ m_textMeshPro.text = (m_frame % 1000).ToString();
+ }
+ else if (BenchmarkType == 1)
+ {
+ m_textMesh.text = (m_frame % 1000).ToString();
+ }
+
+ m_frame += 1;
+ }
+ */
+ }
+}
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs.meta
new file mode 100644
index 0000000..9910676
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: f970ea55f9f84bf79b05dab180b8c125
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs
new file mode 100644
index 0000000..38f4a27
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs
@@ -0,0 +1,135 @@
+using UnityEngine;
+using System.Collections;
+using UnityEngine.UI;
+
+
+namespace TMPro.Examples
+{
+
+ public class Benchmark01_UGUI : MonoBehaviour
+ {
+
+ public int BenchmarkType = 0;
+
+ public Canvas canvas;
+ public TMP_FontAsset TMProFont;
+ public Font TextMeshFont;
+
+ private TextMeshProUGUI m_textMeshPro;
+ //private TextContainer m_textContainer;
+ private Text m_textMesh;
+
+ private const string label01 = "The <#0050FF>count is: ";
+ private const string label02 = "The count is: ";
+
+ //private const string label01 = "TextMesh <#0050FF>Pro! The count is: {0}";
+ //private const string label02 = "Text Mesh The count is: ";
+
+ //private string m_string;
+ //private int m_frame;
+
+ private Material m_material01;
+ private Material m_material02;
+
+
+
+ IEnumerator Start()
+ {
+
+
+
+ if (BenchmarkType == 0) // TextMesh Pro Component
+ {
+ m_textMeshPro = gameObject.AddComponent();
+ //m_textContainer = GetComponent();
+
+
+ //m_textMeshPro.anchorDampening = true;
+
+ if (TMProFont != null)
+ m_textMeshPro.font = TMProFont;
+
+ //m_textMeshPro.font = Resources.Load("Fonts & Materials/Anton SDF", typeof(TextMeshProFont)) as TextMeshProFont; // Make sure the Anton SDF exists before calling this...
+ //m_textMeshPro.fontSharedMaterial = Resources.Load("Fonts & Materials/Anton SDF", typeof(Material)) as Material; // Same as above make sure this material exists.
+
+ m_textMeshPro.fontSize = 48;
+ m_textMeshPro.alignment = TextAlignmentOptions.Center;
+ //m_textMeshPro.anchor = AnchorPositions.Center;
+ m_textMeshPro.extraPadding = true;
+ //m_textMeshPro.outlineWidth = 0.25f;
+ //m_textMeshPro.fontSharedMaterial.SetFloat("_OutlineWidth", 0.2f);
+ //m_textMeshPro.fontSharedMaterial.EnableKeyword("UNDERLAY_ON");
+ //m_textMeshPro.lineJustification = LineJustificationTypes.Center;
+ //m_textMeshPro.enableWordWrapping = true;
+ //m_textMeshPro.lineLength = 60;
+ //m_textMeshPro.characterSpacing = 0.2f;
+ //m_textMeshPro.fontColor = new Color32(255, 255, 255, 255);
+
+ m_material01 = m_textMeshPro.font.material;
+ m_material02 = Resources.Load("Fonts & Materials/LiberationSans SDF - BEVEL"); // Make sure the LiberationSans SDF exists before calling this...
+
+
+ }
+ else if (BenchmarkType == 1) // TextMesh
+ {
+ m_textMesh = gameObject.AddComponent();
+
+ if (TextMeshFont != null)
+ {
+ m_textMesh.font = TextMeshFont;
+ //m_textMesh.renderer.sharedMaterial = m_textMesh.font.material;
+ }
+ else
+ {
+ //m_textMesh.font = Resources.Load("Fonts/ARIAL", typeof(Font)) as Font;
+ //m_textMesh.renderer.sharedMaterial = m_textMesh.font.material;
+ }
+
+ m_textMesh.fontSize = 48;
+ m_textMesh.alignment = TextAnchor.MiddleCenter;
+
+ //m_textMesh.color = new Color32(255, 255, 0, 255);
+ }
+
+
+
+ for (int i = 0; i <= 1000000; i++)
+ {
+ if (BenchmarkType == 0)
+ {
+ m_textMeshPro.text = label01 + (i % 1000);
+ if (i % 1000 == 999)
+ m_textMeshPro.fontSharedMaterial = m_textMeshPro.fontSharedMaterial == m_material01 ? m_textMeshPro.fontSharedMaterial = m_material02 : m_textMeshPro.fontSharedMaterial = m_material01;
+
+
+
+ }
+ else if (BenchmarkType == 1)
+ m_textMesh.text = label02 + (i % 1000).ToString();
+
+ yield return null;
+ }
+
+
+ yield return null;
+ }
+
+
+ /*
+ void Update()
+ {
+ if (BenchmarkType == 0)
+ {
+ m_textMeshPro.text = (m_frame % 1000).ToString();
+ }
+ else if (BenchmarkType == 1)
+ {
+ m_textMesh.text = (m_frame % 1000).ToString();
+ }
+
+ m_frame += 1;
+ }
+ */
+ }
+
+}
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs.meta
new file mode 100644
index 0000000..5a26304
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark01_UGUI.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: 8ef7be1c625941f7ba8ed7cc71718c0d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs
new file mode 100644
index 0000000..29d75b6
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/Benchmark02.cs
@@ -0,0 +1,97 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class Benchmark02 : MonoBehaviour
+ {
+
+ public int SpawnType = 0;
+ public int NumberOfNPC = 12;
+
+ public bool IsTextObjectScaleStatic;
+ private TextMeshProFloatingText floatingText_Script;
+
+
+ void Start()
+ {
+
+ for (int i = 0; i < NumberOfNPC; i++)
+ {
+
+
+ if (SpawnType == 0)
+ {
+ // TextMesh Pro Implementation
+ GameObject go = new GameObject();
+ go.transform.position = new Vector3(Random.Range(-95f, 95f), 0.25f, Random.Range(-95f, 95f));
+
+ TextMeshPro textMeshPro = go.AddComponent();
+
+ textMeshPro.autoSizeTextContainer = true;
+ textMeshPro.rectTransform.pivot = new Vector2(0.5f, 0);
+
+ textMeshPro.alignment = TextAlignmentOptions.Bottom;
+ textMeshPro.fontSize = 96;
+ textMeshPro.enableKerning = false;
+
+ textMeshPro.color = new Color32(255, 255, 0, 255);
+ textMeshPro.text = "!";
+ textMeshPro.isTextObjectScaleStatic = IsTextObjectScaleStatic;
+
+ // Spawn Floating Text
+ floatingText_Script = go.AddComponent();
+ floatingText_Script.SpawnType = 0;
+ floatingText_Script.IsTextObjectScaleStatic = IsTextObjectScaleStatic;
+ }
+ else if (SpawnType == 1)
+ {
+ // TextMesh Implementation
+ GameObject go = new GameObject();
+ go.transform.position = new Vector3(Random.Range(-95f, 95f), 0.25f, Random.Range(-95f, 95f));
+
+ TextMesh textMesh = go.AddComponent();
+ textMesh.font = Resources.Load("Fonts/ARIAL");
+ textMesh.GetComponent().sharedMaterial = textMesh.font.material;
+
+ textMesh.anchor = TextAnchor.LowerCenter;
+ textMesh.fontSize = 96;
+
+ textMesh.color = new Color32(255, 255, 0, 255);
+ textMesh.text = "!";
+
+ // Spawn Floating Text
+ floatingText_Script = go.AddComponent();
+ floatingText_Script.SpawnType = 1;
+ }
+ else if (SpawnType == 2)
+ {
+ // Canvas WorldSpace Camera
+ GameObject go = new GameObject();
+ Canvas canvas = go.AddComponent and Unity";
+ private string label02 = "Example of using <#ffa000>Graphics Inline with Text in TextMesh<#40a0ff>Pro and Unity";
+
+
+ private TMP_Text m_textMeshPro;
+
+
+ void Awake()
+ {
+ // Get Reference to TextMeshPro Component
+ m_textMeshPro = GetComponent();
+ m_textMeshPro.text = label01;
+ m_textMeshPro.enableWordWrapping = true;
+ m_textMeshPro.alignment = TextAlignmentOptions.Top;
+
+
+
+ //if (GetComponentInParent(typeof(Canvas)) as Canvas == null)
+ //{
+ // GameObject canvas = new GameObject("Canvas", typeof(Canvas));
+ // gameObject.transform.SetParent(canvas.transform);
+ // canvas.GetComponent().renderMode = RenderMode.ScreenSpaceOverlay;
+
+ // // Set RectTransform Size
+ // gameObject.GetComponent().sizeDelta = new Vector2(500, 300);
+ // m_textMeshPro.fontSize = 48;
+ //}
+
+
+ }
+
+
+ IEnumerator Start()
+ {
+
+ // Force and update of the mesh to get valid information.
+ m_textMeshPro.ForceMeshUpdate();
+
+
+ int totalVisibleCharacters = m_textMeshPro.textInfo.characterCount; // Get # of Visible Character in text object
+ int counter = 0;
+ int visibleCount = 0;
+
+ while (true)
+ {
+ visibleCount = counter % (totalVisibleCharacters + 1);
+
+ m_textMeshPro.maxVisibleCharacters = visibleCount; // How many characters should TextMeshPro display?
+
+ // Once the last character has been revealed, wait 1.0 second and start over.
+ if (visibleCount >= totalVisibleCharacters)
+ {
+ yield return new WaitForSeconds(1.0f);
+ m_textMeshPro.text = label02;
+ yield return new WaitForSeconds(1.0f);
+ m_textMeshPro.text = label01;
+ yield return new WaitForSeconds(1.0f);
+ }
+
+ counter += 1;
+
+ yield return new WaitForSeconds(0.05f);
+ }
+
+ //Debug.Log("Done revealing the text.");
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TeleType.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TeleType.cs.meta
new file mode 100644
index 0000000..562609b
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TeleType.cs.meta
@@ -0,0 +1,10 @@
+fileFormatVersion: 2
+guid: e32c266ee6204b21a427753cb0694c81
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs
new file mode 100644
index 0000000..883990e
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs
@@ -0,0 +1,121 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+ public class TextConsoleSimulator : MonoBehaviour
+ {
+ private TMP_Text m_TextComponent;
+ private bool hasTextChanged;
+
+ void Awake()
+ {
+ m_TextComponent = gameObject.GetComponent();
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(RevealCharacters(m_TextComponent));
+ //StartCoroutine(RevealWords(m_TextComponent));
+ }
+
+
+ void OnEnable()
+ {
+ // Subscribe to event fired when text object has been regenerated.
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
+ }
+
+ void OnDisable()
+ {
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
+ }
+
+
+ // Event received when the text object has changed.
+ void ON_TEXT_CHANGED(Object obj)
+ {
+ hasTextChanged = true;
+ }
+
+
+ ///
+ /// Method revealing the text one character at a time.
+ ///
+ ///
+ IEnumerator RevealCharacters(TMP_Text textComponent)
+ {
+ textComponent.ForceMeshUpdate();
+
+ TMP_TextInfo textInfo = textComponent.textInfo;
+
+ int totalVisibleCharacters = textInfo.characterCount; // Get # of Visible Character in text object
+ int visibleCount = 0;
+
+ while (true)
+ {
+ if (hasTextChanged)
+ {
+ totalVisibleCharacters = textInfo.characterCount; // Update visible character count.
+ hasTextChanged = false;
+ }
+
+ if (visibleCount > totalVisibleCharacters)
+ {
+ yield return new WaitForSeconds(1.0f);
+ visibleCount = 0;
+ }
+
+ textComponent.maxVisibleCharacters = visibleCount; // How many characters should TextMeshPro display?
+
+ visibleCount += 1;
+
+ yield return null;
+ }
+ }
+
+
+ ///
+ /// Method revealing the text one word at a time.
+ ///
+ ///
+ IEnumerator RevealWords(TMP_Text textComponent)
+ {
+ textComponent.ForceMeshUpdate();
+
+ int totalWordCount = textComponent.textInfo.wordCount;
+ int totalVisibleCharacters = textComponent.textInfo.characterCount; // Get # of Visible Character in text object
+ int counter = 0;
+ int currentWord = 0;
+ int visibleCount = 0;
+
+ while (true)
+ {
+ currentWord = counter % (totalWordCount + 1);
+
+ // Get last character index for the current word.
+ if (currentWord == 0) // Display no words.
+ visibleCount = 0;
+ else if (currentWord < totalWordCount) // Display all other words with the exception of the last one.
+ visibleCount = textComponent.textInfo.wordInfo[currentWord - 1].lastCharacterIndex + 1;
+ else if (currentWord == totalWordCount) // Display last word and all remaining characters.
+ visibleCount = totalVisibleCharacters;
+
+ textComponent.maxVisibleCharacters = visibleCount; // How many characters should TextMeshPro display?
+
+ // Once the last character has been revealed, wait 1.0 second and start over.
+ if (visibleCount >= totalVisibleCharacters)
+ {
+ yield return new WaitForSeconds(1.0f);
+ }
+
+ counter += 1;
+
+ yield return new WaitForSeconds(0.1f);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs.meta
new file mode 100644
index 0000000..3d83e76
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextConsoleSimulator.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 43bcd35a1c0c40ccb6d472893fe2093f
+timeCreated: 1435298333
+licenseType: Store
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs
new file mode 100644
index 0000000..f961113
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs
@@ -0,0 +1,223 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class TextMeshProFloatingText : MonoBehaviour
+ {
+ public Font TheFont;
+
+ private GameObject m_floatingText;
+ private TextMeshPro m_textMeshPro;
+ private TextMesh m_textMesh;
+
+ private Transform m_transform;
+ private Transform m_floatingText_Transform;
+ private Transform m_cameraTransform;
+
+ Vector3 lastPOS = Vector3.zero;
+ Quaternion lastRotation = Quaternion.identity;
+
+ public int SpawnType;
+ public bool IsTextObjectScaleStatic;
+
+ //private int m_frame = 0;
+
+ static WaitForEndOfFrame k_WaitForEndOfFrame = new WaitForEndOfFrame();
+ static WaitForSeconds[] k_WaitForSecondsRandom = new WaitForSeconds[]
+ {
+ new WaitForSeconds(0.05f), new WaitForSeconds(0.1f), new WaitForSeconds(0.15f), new WaitForSeconds(0.2f), new WaitForSeconds(0.25f),
+ new WaitForSeconds(0.3f), new WaitForSeconds(0.35f), new WaitForSeconds(0.4f), new WaitForSeconds(0.45f), new WaitForSeconds(0.5f),
+ new WaitForSeconds(0.55f), new WaitForSeconds(0.6f), new WaitForSeconds(0.65f), new WaitForSeconds(0.7f), new WaitForSeconds(0.75f),
+ new WaitForSeconds(0.8f), new WaitForSeconds(0.85f), new WaitForSeconds(0.9f), new WaitForSeconds(0.95f), new WaitForSeconds(1.0f),
+ };
+
+ void Awake()
+ {
+ m_transform = transform;
+ m_floatingText = new GameObject(this.name + " floating text");
+
+ // Reference to Transform is lost when TMP component is added since it replaces it by a RectTransform.
+ //m_floatingText_Transform = m_floatingText.transform;
+ //m_floatingText_Transform.position = m_transform.position + new Vector3(0, 15f, 0);
+
+ m_cameraTransform = Camera.main.transform;
+ }
+
+ void Start()
+ {
+ if (SpawnType == 0)
+ {
+ // TextMesh Pro Implementation
+ m_textMeshPro = m_floatingText.AddComponent();
+ m_textMeshPro.rectTransform.sizeDelta = new Vector2(3, 3);
+
+ m_floatingText_Transform = m_floatingText.transform;
+ m_floatingText_Transform.position = m_transform.position + new Vector3(0, 15f, 0);
+
+ //m_textMeshPro.fontAsset = Resources.Load("Fonts & Materials/JOKERMAN SDF", typeof(TextMeshProFont)) as TextMeshProFont; // User should only provide a string to the resource.
+ //m_textMeshPro.fontSharedMaterial = Resources.Load("Fonts & Materials/LiberationSans SDF", typeof(Material)) as Material;
+
+ m_textMeshPro.alignment = TextAlignmentOptions.Center;
+ m_textMeshPro.color = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 255);
+ m_textMeshPro.fontSize = 24;
+ //m_textMeshPro.enableExtraPadding = true;
+ //m_textMeshPro.enableShadows = false;
+ m_textMeshPro.enableKerning = false;
+ m_textMeshPro.text = string.Empty;
+ m_textMeshPro.isTextObjectScaleStatic = IsTextObjectScaleStatic;
+
+ StartCoroutine(DisplayTextMeshProFloatingText());
+ }
+ else if (SpawnType == 1)
+ {
+ //Debug.Log("Spawning TextMesh Objects.");
+
+ m_floatingText_Transform = m_floatingText.transform;
+ m_floatingText_Transform.position = m_transform.position + new Vector3(0, 15f, 0);
+
+ m_textMesh = m_floatingText.AddComponent();
+ m_textMesh.font = Resources.Load("Fonts/ARIAL");
+ m_textMesh.GetComponent().sharedMaterial = m_textMesh.font.material;
+ m_textMesh.color = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 255);
+ m_textMesh.anchor = TextAnchor.LowerCenter;
+ m_textMesh.fontSize = 24;
+
+ StartCoroutine(DisplayTextMeshFloatingText());
+ }
+ else if (SpawnType == 2)
+ {
+
+ }
+
+ }
+
+
+ //void Update()
+ //{
+ // if (SpawnType == 0)
+ // {
+ // m_textMeshPro.SetText("{0}", m_frame);
+ // }
+ // else
+ // {
+ // m_textMesh.text = m_frame.ToString();
+ // }
+ // m_frame = (m_frame + 1) % 1000;
+
+ //}
+
+
+ public IEnumerator DisplayTextMeshProFloatingText()
+ {
+ float CountDuration = 2.0f; // How long is the countdown alive.
+ float starting_Count = Random.Range(5f, 20f); // At what number is the counter starting at.
+ float current_Count = starting_Count;
+
+ Vector3 start_pos = m_floatingText_Transform.position;
+ Color32 start_color = m_textMeshPro.color;
+ float alpha = 255;
+ int int_counter = 0;
+
+
+ float fadeDuration = 3 / starting_Count * CountDuration;
+
+ while (current_Count > 0)
+ {
+ current_Count -= (Time.deltaTime / CountDuration) * starting_Count;
+
+ if (current_Count <= 3)
+ {
+ //Debug.Log("Fading Counter ... " + current_Count.ToString("f2"));
+ alpha = Mathf.Clamp(alpha - (Time.deltaTime / fadeDuration) * 255, 0, 255);
+ }
+
+ int_counter = (int)current_Count;
+ m_textMeshPro.text = int_counter.ToString();
+ //m_textMeshPro.SetText("{0}", (int)current_Count);
+
+ m_textMeshPro.color = new Color32(start_color.r, start_color.g, start_color.b, (byte)alpha);
+
+ // Move the floating text upward each update
+ m_floatingText_Transform.position += new Vector3(0, starting_Count * Time.deltaTime, 0);
+
+ // Align floating text perpendicular to Camera.
+ if (!lastPOS.Compare(m_cameraTransform.position, 1000) || !lastRotation.Compare(m_cameraTransform.rotation, 1000))
+ {
+ lastPOS = m_cameraTransform.position;
+ lastRotation = m_cameraTransform.rotation;
+ m_floatingText_Transform.rotation = lastRotation;
+ Vector3 dir = m_transform.position - lastPOS;
+ m_transform.forward = new Vector3(dir.x, 0, dir.z);
+ }
+
+ yield return k_WaitForEndOfFrame;
+ }
+
+ //Debug.Log("Done Counting down.");
+
+ yield return k_WaitForSecondsRandom[Random.Range(0, 19)];
+
+ m_floatingText_Transform.position = start_pos;
+
+ StartCoroutine(DisplayTextMeshProFloatingText());
+ }
+
+
+ public IEnumerator DisplayTextMeshFloatingText()
+ {
+ float CountDuration = 2.0f; // How long is the countdown alive.
+ float starting_Count = Random.Range(5f, 20f); // At what number is the counter starting at.
+ float current_Count = starting_Count;
+
+ Vector3 start_pos = m_floatingText_Transform.position;
+ Color32 start_color = m_textMesh.color;
+ float alpha = 255;
+ int int_counter = 0;
+
+ float fadeDuration = 3 / starting_Count * CountDuration;
+
+ while (current_Count > 0)
+ {
+ current_Count -= (Time.deltaTime / CountDuration) * starting_Count;
+
+ if (current_Count <= 3)
+ {
+ //Debug.Log("Fading Counter ... " + current_Count.ToString("f2"));
+ alpha = Mathf.Clamp(alpha - (Time.deltaTime / fadeDuration) * 255, 0, 255);
+ }
+
+ int_counter = (int)current_Count;
+ m_textMesh.text = int_counter.ToString();
+ //Debug.Log("Current Count:" + current_Count.ToString("f2"));
+
+ m_textMesh.color = new Color32(start_color.r, start_color.g, start_color.b, (byte)alpha);
+
+ // Move the floating text upward each update
+ m_floatingText_Transform.position += new Vector3(0, starting_Count * Time.deltaTime, 0);
+
+ // Align floating text perpendicular to Camera.
+ if (!lastPOS.Compare(m_cameraTransform.position, 1000) || !lastRotation.Compare(m_cameraTransform.rotation, 1000))
+ {
+ lastPOS = m_cameraTransform.position;
+ lastRotation = m_cameraTransform.rotation;
+ m_floatingText_Transform.rotation = lastRotation;
+ Vector3 dir = m_transform.position - lastPOS;
+ m_transform.forward = new Vector3(dir.x, 0, dir.z);
+ }
+
+ yield return k_WaitForEndOfFrame;
+ }
+
+ //Debug.Log("Done Counting down.");
+
+ yield return k_WaitForSecondsRandom[Random.Range(0, 20)];
+
+ m_floatingText_Transform.position = start_pos;
+
+ StartCoroutine(DisplayTextMeshFloatingText());
+ }
+ }
+}
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs.meta
new file mode 100644
index 0000000..da60e2f
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshProFloatingText.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a4d4c76e63944cba8c7d00f56334b98c
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences:
+ - TheFont: {instanceID: 0}
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs
new file mode 100644
index 0000000..0aa450d
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs
@@ -0,0 +1,79 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class TextMeshSpawner : MonoBehaviour
+ {
+
+ public int SpawnType = 0;
+ public int NumberOfNPC = 12;
+
+ public Font TheFont;
+
+ private TextMeshProFloatingText floatingText_Script;
+
+ void Awake()
+ {
+
+ }
+
+ void Start()
+ {
+
+ for (int i = 0; i < NumberOfNPC; i++)
+ {
+ if (SpawnType == 0)
+ {
+ // TextMesh Pro Implementation
+ //go.transform.localScale = new Vector3(2, 2, 2);
+ GameObject go = new GameObject(); //"NPC " + i);
+ go.transform.position = new Vector3(Random.Range(-95f, 95f), 0.5f, Random.Range(-95f, 95f));
+
+ //go.transform.position = new Vector3(0, 1.01f, 0);
+ //go.renderer.castShadows = false;
+ //go.renderer.receiveShadows = false;
+ //go.transform.rotation = Quaternion.Euler(0, Random.Range(0, 360), 0);
+
+ TextMeshPro textMeshPro = go.AddComponent();
+ //textMeshPro.FontAsset = Resources.Load("Fonts & Materials/LiberationSans SDF", typeof(TextMeshProFont)) as TextMeshProFont;
+ //textMeshPro.anchor = AnchorPositions.Bottom;
+ textMeshPro.fontSize = 96;
+
+ textMeshPro.text = "!";
+ textMeshPro.color = new Color32(255, 255, 0, 255);
+ //textMeshPro.Text = "!";
+
+
+ // Spawn Floating Text
+ floatingText_Script = go.AddComponent();
+ floatingText_Script.SpawnType = 0;
+ }
+ else
+ {
+ // TextMesh Implementation
+ GameObject go = new GameObject(); //"NPC " + i);
+ go.transform.position = new Vector3(Random.Range(-95f, 95f), 0.5f, Random.Range(-95f, 95f));
+
+ //go.transform.position = new Vector3(0, 1.01f, 0);
+
+ TextMesh textMesh = go.AddComponent();
+ textMesh.GetComponent().sharedMaterial = TheFont.material;
+ textMesh.font = TheFont;
+ textMesh.anchor = TextAnchor.LowerCenter;
+ textMesh.fontSize = 96;
+
+ textMesh.color = new Color32(255, 255, 0, 255);
+ textMesh.text = "!";
+
+ // Spawn Floating Text
+ floatingText_Script = go.AddComponent();
+ floatingText_Script.SpawnType = 1;
+ }
+ }
+ }
+
+ }
+}
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs.meta
new file mode 100644
index 0000000..dd5a8cb
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/TextMeshSpawner.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 76c11bbcfddf44e0ba17d6c2751c8d84
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences:
+ - TheFont: {instanceID: 0}
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs
new file mode 100644
index 0000000..ac66647
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs
@@ -0,0 +1,84 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class VertexColorCycler : MonoBehaviour
+ {
+
+ private TMP_Text m_TextComponent;
+
+ void Awake()
+ {
+ m_TextComponent = GetComponent();
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(AnimateVertexColors());
+ }
+
+
+ ///
+ /// Method to animate vertex colors of a TMP Text object.
+ ///
+ ///
+ IEnumerator AnimateVertexColors()
+ {
+ // Force the text object to update right away so we can have geometry to modify right from the start.
+ m_TextComponent.ForceMeshUpdate();
+
+ TMP_TextInfo textInfo = m_TextComponent.textInfo;
+ int currentCharacter = 0;
+
+ Color32[] newVertexColors;
+ Color32 c0 = m_TextComponent.color;
+
+ while (true)
+ {
+ int characterCount = textInfo.characterCount;
+
+ // If No Characters then just yield and wait for some text to be added
+ if (characterCount == 0)
+ {
+ yield return new WaitForSeconds(0.25f);
+ continue;
+ }
+
+ // Get the index of the material used by the current character.
+ int materialIndex = textInfo.characterInfo[currentCharacter].materialReferenceIndex;
+
+ // Get the vertex colors of the mesh used by this text element (character or sprite).
+ newVertexColors = textInfo.meshInfo[materialIndex].colors32;
+
+ // Get the index of the first vertex used by this text element.
+ int vertexIndex = textInfo.characterInfo[currentCharacter].vertexIndex;
+
+ // Only change the vertex color if the text element is visible.
+ if (textInfo.characterInfo[currentCharacter].isVisible)
+ {
+ c0 = new Color32((byte)Random.Range(0, 255), (byte)Random.Range(0, 255), (byte)Random.Range(0, 255), 255);
+
+ newVertexColors[vertexIndex + 0] = c0;
+ newVertexColors[vertexIndex + 1] = c0;
+ newVertexColors[vertexIndex + 2] = c0;
+ newVertexColors[vertexIndex + 3] = c0;
+
+ // New function which pushes (all) updated vertex data to the appropriate meshes when using either the Mesh Renderer or CanvasRenderer.
+ m_TextComponent.UpdateVertexData(TMP_VertexDataUpdateFlags.Colors32);
+
+ // This last process could be done to only update the vertex data that has changed as opposed to all of the vertex data but it would require extra steps and knowing what type of renderer is used.
+ // These extra steps would be a performance optimization but it is unlikely that such optimization will be necessary.
+ }
+
+ currentCharacter = (currentCharacter + 1) % characterCount;
+
+ yield return new WaitForSeconds(0.05f);
+ }
+ }
+
+ }
+}
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs.meta
new file mode 100644
index 0000000..7ba50b8
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexColorCycler.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 91b8ba3d52e041fab2d0e0f169855539
+timeCreated: 1457047157
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs
new file mode 100644
index 0000000..7ed8230
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs
@@ -0,0 +1,175 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class VertexJitter : MonoBehaviour
+ {
+
+ public float AngleMultiplier = 1.0f;
+ public float SpeedMultiplier = 1.0f;
+ public float CurveScale = 1.0f;
+
+ private TMP_Text m_TextComponent;
+ private bool hasTextChanged;
+
+ ///
+ /// Structure to hold pre-computed animation data.
+ ///
+ private struct VertexAnim
+ {
+ public float angleRange;
+ public float angle;
+ public float speed;
+ }
+
+ void Awake()
+ {
+ m_TextComponent = GetComponent();
+ }
+
+ void OnEnable()
+ {
+ // Subscribe to event fired when text object has been regenerated.
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
+ }
+
+ void OnDisable()
+ {
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(AnimateVertexColors());
+ }
+
+
+ void ON_TEXT_CHANGED(Object obj)
+ {
+ if (obj == m_TextComponent)
+ hasTextChanged = true;
+ }
+
+ ///
+ /// Method to animate vertex colors of a TMP Text object.
+ ///
+ ///
+ IEnumerator AnimateVertexColors()
+ {
+
+ // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
+ // Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
+ m_TextComponent.ForceMeshUpdate();
+
+ TMP_TextInfo textInfo = m_TextComponent.textInfo;
+
+ Matrix4x4 matrix;
+
+ int loopCount = 0;
+ hasTextChanged = true;
+
+ // Create an Array which contains pre-computed Angle Ranges and Speeds for a bunch of characters.
+ VertexAnim[] vertexAnim = new VertexAnim[1024];
+ for (int i = 0; i < 1024; i++)
+ {
+ vertexAnim[i].angleRange = Random.Range(10f, 25f);
+ vertexAnim[i].speed = Random.Range(1f, 3f);
+ }
+
+ // Cache the vertex data of the text object as the Jitter FX is applied to the original position of the characters.
+ TMP_MeshInfo[] cachedMeshInfo = textInfo.CopyMeshInfoVertexData();
+
+ while (true)
+ {
+ // Get new copy of vertex data if the text has changed.
+ if (hasTextChanged)
+ {
+ // Update the copy of the vertex data for the text object.
+ cachedMeshInfo = textInfo.CopyMeshInfoVertexData();
+
+ hasTextChanged = false;
+ }
+
+ int characterCount = textInfo.characterCount;
+
+ // If No Characters then just yield and wait for some text to be added
+ if (characterCount == 0)
+ {
+ yield return new WaitForSeconds(0.25f);
+ continue;
+ }
+
+
+ for (int i = 0; i < characterCount; i++)
+ {
+ TMP_CharacterInfo charInfo = textInfo.characterInfo[i];
+
+ // Skip characters that are not visible and thus have no geometry to manipulate.
+ if (!charInfo.isVisible)
+ continue;
+
+ // Retrieve the pre-computed animation data for the given character.
+ VertexAnim vertAnim = vertexAnim[i];
+
+ // Get the index of the material used by the current character.
+ int materialIndex = textInfo.characterInfo[i].materialReferenceIndex;
+
+ // Get the index of the first vertex used by this text element.
+ int vertexIndex = textInfo.characterInfo[i].vertexIndex;
+
+ // Get the cached vertices of the mesh used by this text element (character or sprite).
+ Vector3[] sourceVertices = cachedMeshInfo[materialIndex].vertices;
+
+ // Determine the center point of each character at the baseline.
+ //Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine);
+ // Determine the center point of each character.
+ Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2;
+
+ // Need to translate all 4 vertices of each quad to aligned with middle of character / baseline.
+ // This is needed so the matrix TRS is applied at the origin for each character.
+ Vector3 offset = charMidBasline;
+
+ Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices;
+
+ destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset;
+ destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset;
+ destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset;
+ destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset;
+
+ vertAnim.angle = Mathf.SmoothStep(-vertAnim.angleRange, vertAnim.angleRange, Mathf.PingPong(loopCount / 25f * vertAnim.speed, 1f));
+ Vector3 jitterOffset = new Vector3(Random.Range(-.25f, .25f), Random.Range(-.25f, .25f), 0);
+
+ matrix = Matrix4x4.TRS(jitterOffset * CurveScale, Quaternion.Euler(0, 0, Random.Range(-5f, 5f) * AngleMultiplier), Vector3.one);
+
+ destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]);
+ destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]);
+ destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]);
+ destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]);
+
+ destinationVertices[vertexIndex + 0] += offset;
+ destinationVertices[vertexIndex + 1] += offset;
+ destinationVertices[vertexIndex + 2] += offset;
+ destinationVertices[vertexIndex + 3] += offset;
+
+ vertexAnim[i] = vertAnim;
+ }
+
+ // Push changes into meshes
+ for (int i = 0; i < textInfo.meshInfo.Length; i++)
+ {
+ textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices;
+ m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
+ }
+
+ loopCount += 1;
+
+ yield return new WaitForSeconds(0.1f);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs.meta
new file mode 100644
index 0000000..2ba768c
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexJitter.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 2ed57967c52645d390a89dcf8f61ba73
+timeCreated: 1461286718
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs
new file mode 100644
index 0000000..a4022a5
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs
@@ -0,0 +1,161 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class VertexShakeA : MonoBehaviour
+ {
+
+ public float AngleMultiplier = 1.0f;
+ public float SpeedMultiplier = 1.0f;
+ public float ScaleMultiplier = 1.0f;
+ public float RotationMultiplier = 1.0f;
+
+ private TMP_Text m_TextComponent;
+ private bool hasTextChanged;
+
+
+ void Awake()
+ {
+ m_TextComponent = GetComponent();
+ }
+
+ void OnEnable()
+ {
+ // Subscribe to event fired when text object has been regenerated.
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
+ }
+
+ void OnDisable()
+ {
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(AnimateVertexColors());
+ }
+
+
+ void ON_TEXT_CHANGED(Object obj)
+ {
+ if (obj = m_TextComponent)
+ hasTextChanged = true;
+ }
+
+ ///
+ /// Method to animate vertex colors of a TMP Text object.
+ ///
+ ///
+ IEnumerator AnimateVertexColors()
+ {
+
+ // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
+ // Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
+ m_TextComponent.ForceMeshUpdate();
+
+ TMP_TextInfo textInfo = m_TextComponent.textInfo;
+
+ Matrix4x4 matrix;
+ Vector3[][] copyOfVertices = new Vector3[0][];
+
+ hasTextChanged = true;
+
+ while (true)
+ {
+ // Allocate new vertices
+ if (hasTextChanged)
+ {
+ if (copyOfVertices.Length < textInfo.meshInfo.Length)
+ copyOfVertices = new Vector3[textInfo.meshInfo.Length][];
+
+ for (int i = 0; i < textInfo.meshInfo.Length; i++)
+ {
+ int length = textInfo.meshInfo[i].vertices.Length;
+ copyOfVertices[i] = new Vector3[length];
+ }
+
+ hasTextChanged = false;
+ }
+
+ int characterCount = textInfo.characterCount;
+
+ // If No Characters then just yield and wait for some text to be added
+ if (characterCount == 0)
+ {
+ yield return new WaitForSeconds(0.25f);
+ continue;
+ }
+
+ int lineCount = textInfo.lineCount;
+
+ // Iterate through each line of the text.
+ for (int i = 0; i < lineCount; i++)
+ {
+
+ int first = textInfo.lineInfo[i].firstCharacterIndex;
+ int last = textInfo.lineInfo[i].lastCharacterIndex;
+
+ // Determine the center of each line
+ Vector3 centerOfLine = (textInfo.characterInfo[first].bottomLeft + textInfo.characterInfo[last].topRight) / 2;
+ Quaternion rotation = Quaternion.Euler(0, 0, Random.Range(-0.25f, 0.25f) * RotationMultiplier);
+
+ // Iterate through each character of the line.
+ for (int j = first; j <= last; j++)
+ {
+ // Skip characters that are not visible and thus have no geometry to manipulate.
+ if (!textInfo.characterInfo[j].isVisible)
+ continue;
+
+ // Get the index of the material used by the current character.
+ int materialIndex = textInfo.characterInfo[j].materialReferenceIndex;
+
+ // Get the index of the first vertex used by this text element.
+ int vertexIndex = textInfo.characterInfo[j].vertexIndex;
+
+ // Get the vertices of the mesh used by this text element (character or sprite).
+ Vector3[] sourceVertices = textInfo.meshInfo[materialIndex].vertices;
+
+ // Need to translate all 4 vertices of each quad to aligned with center of character.
+ // This is needed so the matrix TRS is applied at the origin for each character.
+ copyOfVertices[materialIndex][vertexIndex + 0] = sourceVertices[vertexIndex + 0] - centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 1] = sourceVertices[vertexIndex + 1] - centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 2] = sourceVertices[vertexIndex + 2] - centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 3] = sourceVertices[vertexIndex + 3] - centerOfLine;
+
+ // Determine the random scale change for each character.
+ float randomScale = Random.Range(0.995f - 0.001f * ScaleMultiplier, 1.005f + 0.001f * ScaleMultiplier);
+
+ // Setup the matrix rotation.
+ matrix = Matrix4x4.TRS(Vector3.one, rotation, Vector3.one * randomScale);
+
+ // Apply the matrix TRS to the individual characters relative to the center of the current line.
+ copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]);
+ copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]);
+ copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]);
+ copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]);
+
+ // Revert the translation change.
+ copyOfVertices[materialIndex][vertexIndex + 0] += centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 1] += centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 2] += centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 3] += centerOfLine;
+ }
+ }
+
+ // Push changes into meshes
+ for (int i = 0; i < textInfo.meshInfo.Length; i++)
+ {
+ textInfo.meshInfo[i].mesh.vertices = copyOfVertices[i];
+ m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
+ }
+
+ yield return new WaitForSeconds(0.1f);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs.meta
new file mode 100644
index 0000000..25aceb5
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeA.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: f7cfa58e417a46ea8889989684c2522e
+timeCreated: 1462089320
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs
new file mode 100644
index 0000000..fd3b1c4
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs
@@ -0,0 +1,185 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class VertexShakeB : MonoBehaviour
+ {
+
+ public float AngleMultiplier = 1.0f;
+ public float SpeedMultiplier = 1.0f;
+ public float CurveScale = 1.0f;
+
+ private TMP_Text m_TextComponent;
+ private bool hasTextChanged;
+
+
+ void Awake()
+ {
+ m_TextComponent = GetComponent();
+ }
+
+ void OnEnable()
+ {
+ // Subscribe to event fired when text object has been regenerated.
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
+ }
+
+ void OnDisable()
+ {
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(AnimateVertexColors());
+ }
+
+
+ void ON_TEXT_CHANGED(Object obj)
+ {
+ if (obj = m_TextComponent)
+ hasTextChanged = true;
+ }
+
+ ///
+ /// Method to animate vertex colors of a TMP Text object.
+ ///
+ ///
+ IEnumerator AnimateVertexColors()
+ {
+
+ // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
+ // Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
+ m_TextComponent.ForceMeshUpdate();
+
+ TMP_TextInfo textInfo = m_TextComponent.textInfo;
+
+ Matrix4x4 matrix;
+ Vector3[][] copyOfVertices = new Vector3[0][];
+
+ hasTextChanged = true;
+
+ while (true)
+ {
+ // Allocate new vertices
+ if (hasTextChanged)
+ {
+ if (copyOfVertices.Length < textInfo.meshInfo.Length)
+ copyOfVertices = new Vector3[textInfo.meshInfo.Length][];
+
+ for (int i = 0; i < textInfo.meshInfo.Length; i++)
+ {
+ int length = textInfo.meshInfo[i].vertices.Length;
+ copyOfVertices[i] = new Vector3[length];
+ }
+
+ hasTextChanged = false;
+ }
+
+ int characterCount = textInfo.characterCount;
+
+ // If No Characters then just yield and wait for some text to be added
+ if (characterCount == 0)
+ {
+ yield return new WaitForSeconds(0.25f);
+ continue;
+ }
+
+ int lineCount = textInfo.lineCount;
+
+ // Iterate through each line of the text.
+ for (int i = 0; i < lineCount; i++)
+ {
+
+ int first = textInfo.lineInfo[i].firstCharacterIndex;
+ int last = textInfo.lineInfo[i].lastCharacterIndex;
+
+ // Determine the center of each line
+ Vector3 centerOfLine = (textInfo.characterInfo[first].bottomLeft + textInfo.characterInfo[last].topRight) / 2;
+ Quaternion rotation = Quaternion.Euler(0, 0, Random.Range(-0.25f, 0.25f));
+
+ // Iterate through each character of the line.
+ for (int j = first; j <= last; j++)
+ {
+ // Skip characters that are not visible and thus have no geometry to manipulate.
+ if (!textInfo.characterInfo[j].isVisible)
+ continue;
+
+ // Get the index of the material used by the current character.
+ int materialIndex = textInfo.characterInfo[j].materialReferenceIndex;
+
+ // Get the index of the first vertex used by this text element.
+ int vertexIndex = textInfo.characterInfo[j].vertexIndex;
+
+ // Get the vertices of the mesh used by this text element (character or sprite).
+ Vector3[] sourceVertices = textInfo.meshInfo[materialIndex].vertices;
+
+ // Determine the center point of each character at the baseline.
+ Vector3 charCenter = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2;
+
+ // Need to translate all 4 vertices of each quad to aligned with center of character.
+ // This is needed so the matrix TRS is applied at the origin for each character.
+ copyOfVertices[materialIndex][vertexIndex + 0] = sourceVertices[vertexIndex + 0] - charCenter;
+ copyOfVertices[materialIndex][vertexIndex + 1] = sourceVertices[vertexIndex + 1] - charCenter;
+ copyOfVertices[materialIndex][vertexIndex + 2] = sourceVertices[vertexIndex + 2] - charCenter;
+ copyOfVertices[materialIndex][vertexIndex + 3] = sourceVertices[vertexIndex + 3] - charCenter;
+
+ // Determine the random scale change for each character.
+ float randomScale = Random.Range(0.95f, 1.05f);
+
+ // Setup the matrix for the scale change.
+ matrix = Matrix4x4.TRS(Vector3.one, Quaternion.identity, Vector3.one * randomScale);
+
+ // Apply the scale change relative to the center of each character.
+ copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]);
+ copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]);
+ copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]);
+ copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]);
+
+ // Revert the translation change.
+ copyOfVertices[materialIndex][vertexIndex + 0] += charCenter;
+ copyOfVertices[materialIndex][vertexIndex + 1] += charCenter;
+ copyOfVertices[materialIndex][vertexIndex + 2] += charCenter;
+ copyOfVertices[materialIndex][vertexIndex + 3] += charCenter;
+
+ // Need to translate all 4 vertices of each quad to aligned with the center of the line.
+ // This is needed so the matrix TRS is applied from the center of the line.
+ copyOfVertices[materialIndex][vertexIndex + 0] -= centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 1] -= centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 2] -= centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 3] -= centerOfLine;
+
+ // Setup the matrix rotation.
+ matrix = Matrix4x4.TRS(Vector3.one, rotation, Vector3.one);
+
+ // Apply the matrix TRS to the individual characters relative to the center of the current line.
+ copyOfVertices[materialIndex][vertexIndex + 0] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 0]);
+ copyOfVertices[materialIndex][vertexIndex + 1] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 1]);
+ copyOfVertices[materialIndex][vertexIndex + 2] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 2]);
+ copyOfVertices[materialIndex][vertexIndex + 3] = matrix.MultiplyPoint3x4(copyOfVertices[materialIndex][vertexIndex + 3]);
+
+ // Revert the translation change.
+ copyOfVertices[materialIndex][vertexIndex + 0] += centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 1] += centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 2] += centerOfLine;
+ copyOfVertices[materialIndex][vertexIndex + 3] += centerOfLine;
+ }
+ }
+
+ // Push changes into meshes
+ for (int i = 0; i < textInfo.meshInfo.Length; i++)
+ {
+ textInfo.meshInfo[i].mesh.vertices = copyOfVertices[i];
+ m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
+ }
+
+ yield return new WaitForSeconds(0.1f);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs.meta
new file mode 100644
index 0000000..f1fcf32
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexShakeB.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: e4e0d9ccee5f4950be8979268c9014e0
+timeCreated: 1462093319
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs
new file mode 100644
index 0000000..c4973fb
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs
@@ -0,0 +1,192 @@
+using UnityEngine;
+using System.Linq;
+using System.Collections;
+using System.Collections.Generic;
+
+
+namespace TMPro.Examples
+{
+
+ public class VertexZoom : MonoBehaviour
+ {
+ public float AngleMultiplier = 1.0f;
+ public float SpeedMultiplier = 1.0f;
+ public float CurveScale = 1.0f;
+
+ private TMP_Text m_TextComponent;
+ private bool hasTextChanged;
+
+
+ void Awake()
+ {
+ m_TextComponent = GetComponent();
+ }
+
+ void OnEnable()
+ {
+ // Subscribe to event fired when text object has been regenerated.
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Add(ON_TEXT_CHANGED);
+ }
+
+ void OnDisable()
+ {
+ // UnSubscribe to event fired when text object has been regenerated.
+ TMPro_EventManager.TEXT_CHANGED_EVENT.Remove(ON_TEXT_CHANGED);
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(AnimateVertexColors());
+ }
+
+
+ void ON_TEXT_CHANGED(Object obj)
+ {
+ if (obj == m_TextComponent)
+ hasTextChanged = true;
+ }
+
+ ///
+ /// Method to animate vertex colors of a TMP Text object.
+ ///
+ ///
+ IEnumerator AnimateVertexColors()
+ {
+
+ // We force an update of the text object since it would only be updated at the end of the frame. Ie. before this code is executed on the first frame.
+ // Alternatively, we could yield and wait until the end of the frame when the text object will be generated.
+ m_TextComponent.ForceMeshUpdate();
+
+ TMP_TextInfo textInfo = m_TextComponent.textInfo;
+
+ Matrix4x4 matrix;
+ TMP_MeshInfo[] cachedMeshInfoVertexData = textInfo.CopyMeshInfoVertexData();
+
+ // Allocations for sorting of the modified scales
+ List modifiedCharScale = new List();
+ List scaleSortingOrder = new List();
+
+ hasTextChanged = true;
+
+ while (true)
+ {
+ // Allocate new vertices
+ if (hasTextChanged)
+ {
+ // Get updated vertex data
+ cachedMeshInfoVertexData = textInfo.CopyMeshInfoVertexData();
+
+ hasTextChanged = false;
+ }
+
+ int characterCount = textInfo.characterCount;
+
+ // If No Characters then just yield and wait for some text to be added
+ if (characterCount == 0)
+ {
+ yield return new WaitForSeconds(0.25f);
+ continue;
+ }
+
+ // Clear list of character scales
+ modifiedCharScale.Clear();
+ scaleSortingOrder.Clear();
+
+ for (int i = 0; i < characterCount; i++)
+ {
+ TMP_CharacterInfo charInfo = textInfo.characterInfo[i];
+
+ // Skip characters that are not visible and thus have no geometry to manipulate.
+ if (!charInfo.isVisible)
+ continue;
+
+ // Get the index of the material used by the current character.
+ int materialIndex = textInfo.characterInfo[i].materialReferenceIndex;
+
+ // Get the index of the first vertex used by this text element.
+ int vertexIndex = textInfo.characterInfo[i].vertexIndex;
+
+ // Get the cached vertices of the mesh used by this text element (character or sprite).
+ Vector3[] sourceVertices = cachedMeshInfoVertexData[materialIndex].vertices;
+
+ // Determine the center point of each character at the baseline.
+ //Vector2 charMidBasline = new Vector2((sourceVertices[vertexIndex + 0].x + sourceVertices[vertexIndex + 2].x) / 2, charInfo.baseLine);
+ // Determine the center point of each character.
+ Vector2 charMidBasline = (sourceVertices[vertexIndex + 0] + sourceVertices[vertexIndex + 2]) / 2;
+
+ // Need to translate all 4 vertices of each quad to aligned with middle of character / baseline.
+ // This is needed so the matrix TRS is applied at the origin for each character.
+ Vector3 offset = charMidBasline;
+
+ Vector3[] destinationVertices = textInfo.meshInfo[materialIndex].vertices;
+
+ destinationVertices[vertexIndex + 0] = sourceVertices[vertexIndex + 0] - offset;
+ destinationVertices[vertexIndex + 1] = sourceVertices[vertexIndex + 1] - offset;
+ destinationVertices[vertexIndex + 2] = sourceVertices[vertexIndex + 2] - offset;
+ destinationVertices[vertexIndex + 3] = sourceVertices[vertexIndex + 3] - offset;
+
+ //Vector3 jitterOffset = new Vector3(Random.Range(-.25f, .25f), Random.Range(-.25f, .25f), 0);
+
+ // Determine the random scale change for each character.
+ float randomScale = Random.Range(1f, 1.5f);
+
+ // Add modified scale and index
+ modifiedCharScale.Add(randomScale);
+ scaleSortingOrder.Add(modifiedCharScale.Count - 1);
+
+ // Setup the matrix for the scale change.
+ //matrix = Matrix4x4.TRS(jitterOffset, Quaternion.Euler(0, 0, Random.Range(-5f, 5f)), Vector3.one * randomScale);
+ matrix = Matrix4x4.TRS(new Vector3(0, 0, 0), Quaternion.identity, Vector3.one * randomScale);
+
+ destinationVertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 0]);
+ destinationVertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 1]);
+ destinationVertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 2]);
+ destinationVertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(destinationVertices[vertexIndex + 3]);
+
+ destinationVertices[vertexIndex + 0] += offset;
+ destinationVertices[vertexIndex + 1] += offset;
+ destinationVertices[vertexIndex + 2] += offset;
+ destinationVertices[vertexIndex + 3] += offset;
+
+ // Restore Source UVS which have been modified by the sorting
+ Vector2[] sourceUVs0 = cachedMeshInfoVertexData[materialIndex].uvs0;
+ Vector2[] destinationUVs0 = textInfo.meshInfo[materialIndex].uvs0;
+
+ destinationUVs0[vertexIndex + 0] = sourceUVs0[vertexIndex + 0];
+ destinationUVs0[vertexIndex + 1] = sourceUVs0[vertexIndex + 1];
+ destinationUVs0[vertexIndex + 2] = sourceUVs0[vertexIndex + 2];
+ destinationUVs0[vertexIndex + 3] = sourceUVs0[vertexIndex + 3];
+
+ // Restore Source Vertex Colors
+ Color32[] sourceColors32 = cachedMeshInfoVertexData[materialIndex].colors32;
+ Color32[] destinationColors32 = textInfo.meshInfo[materialIndex].colors32;
+
+ destinationColors32[vertexIndex + 0] = sourceColors32[vertexIndex + 0];
+ destinationColors32[vertexIndex + 1] = sourceColors32[vertexIndex + 1];
+ destinationColors32[vertexIndex + 2] = sourceColors32[vertexIndex + 2];
+ destinationColors32[vertexIndex + 3] = sourceColors32[vertexIndex + 3];
+ }
+
+ // Push changes into meshes
+ for (int i = 0; i < textInfo.meshInfo.Length; i++)
+ {
+ //// Sort Quads based modified scale
+ scaleSortingOrder.Sort((a, b) => modifiedCharScale[a].CompareTo(modifiedCharScale[b]));
+
+ textInfo.meshInfo[i].SortGeometry(scaleSortingOrder);
+
+ // Updated modified vertex attributes
+ textInfo.meshInfo[i].mesh.vertices = textInfo.meshInfo[i].vertices;
+ textInfo.meshInfo[i].mesh.uv = textInfo.meshInfo[i].uvs0;
+ textInfo.meshInfo[i].mesh.colors32 = textInfo.meshInfo[i].colors32;
+
+ m_TextComponent.UpdateGeometry(textInfo.meshInfo[i].mesh, i);
+ }
+
+ yield return new WaitForSeconds(0.1f);
+ }
+ }
+
+ }
+}
\ No newline at end of file
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs.meta
new file mode 100644
index 0000000..d9e3f96
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/VertexZoom.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 52ec835d14bd486f900952b77698b7eb
+timeCreated: 1466280202
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs
new file mode 100644
index 0000000..18dba4c
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs
@@ -0,0 +1,144 @@
+using UnityEngine;
+using System.Collections;
+
+
+namespace TMPro.Examples
+{
+
+ public class WarpTextExample : MonoBehaviour
+ {
+
+ private TMP_Text m_TextComponent;
+
+ public AnimationCurve VertexCurve = new AnimationCurve(new Keyframe(0, 0), new Keyframe(0.25f, 2.0f), new Keyframe(0.5f, 0), new Keyframe(0.75f, 2.0f), new Keyframe(1, 0f));
+ public float AngleMultiplier = 1.0f;
+ public float SpeedMultiplier = 1.0f;
+ public float CurveScale = 1.0f;
+
+ void Awake()
+ {
+ m_TextComponent = gameObject.GetComponent();
+ }
+
+
+ void Start()
+ {
+ StartCoroutine(WarpText());
+ }
+
+
+ private AnimationCurve CopyAnimationCurve(AnimationCurve curve)
+ {
+ AnimationCurve newCurve = new AnimationCurve();
+
+ newCurve.keys = curve.keys;
+
+ return newCurve;
+ }
+
+
+ ///
+ /// Method to curve text along a Unity animation curve.
+ ///
+ ///
+ ///
+ IEnumerator WarpText()
+ {
+ VertexCurve.preWrapMode = WrapMode.Clamp;
+ VertexCurve.postWrapMode = WrapMode.Clamp;
+
+ //Mesh mesh = m_TextComponent.textInfo.meshInfo[0].mesh;
+
+ Vector3[] vertices;
+ Matrix4x4 matrix;
+
+ m_TextComponent.havePropertiesChanged = true; // Need to force the TextMeshPro Object to be updated.
+ CurveScale *= 10;
+ float old_CurveScale = CurveScale;
+ AnimationCurve old_curve = CopyAnimationCurve(VertexCurve);
+
+ while (true)
+ {
+ if (!m_TextComponent.havePropertiesChanged && old_CurveScale == CurveScale && old_curve.keys[1].value == VertexCurve.keys[1].value)
+ {
+ yield return null;
+ continue;
+ }
+
+ old_CurveScale = CurveScale;
+ old_curve = CopyAnimationCurve(VertexCurve);
+
+ m_TextComponent.ForceMeshUpdate(); // Generate the mesh and populate the textInfo with data we can use and manipulate.
+
+ TMP_TextInfo textInfo = m_TextComponent.textInfo;
+ int characterCount = textInfo.characterCount;
+
+
+ if (characterCount == 0) continue;
+
+ //vertices = textInfo.meshInfo[0].vertices;
+ //int lastVertexIndex = textInfo.characterInfo[characterCount - 1].vertexIndex;
+
+ float boundsMinX = m_TextComponent.bounds.min.x; //textInfo.meshInfo[0].mesh.bounds.min.x;
+ float boundsMaxX = m_TextComponent.bounds.max.x; //textInfo.meshInfo[0].mesh.bounds.max.x;
+
+
+
+ for (int i = 0; i < characterCount; i++)
+ {
+ if (!textInfo.characterInfo[i].isVisible)
+ continue;
+
+ int vertexIndex = textInfo.characterInfo[i].vertexIndex;
+
+ // Get the index of the mesh used by this character.
+ int materialIndex = textInfo.characterInfo[i].materialReferenceIndex;
+
+ vertices = textInfo.meshInfo[materialIndex].vertices;
+
+ // Compute the baseline mid point for each character
+ Vector3 offsetToMidBaseline = new Vector2((vertices[vertexIndex + 0].x + vertices[vertexIndex + 2].x) / 2, textInfo.characterInfo[i].baseLine);
+ //float offsetY = VertexCurve.Evaluate((float)i / characterCount + loopCount / 50f); // Random.Range(-0.25f, 0.25f);
+
+ // Apply offset to adjust our pivot point.
+ vertices[vertexIndex + 0] += -offsetToMidBaseline;
+ vertices[vertexIndex + 1] += -offsetToMidBaseline;
+ vertices[vertexIndex + 2] += -offsetToMidBaseline;
+ vertices[vertexIndex + 3] += -offsetToMidBaseline;
+
+ // Compute the angle of rotation for each character based on the animation curve
+ float x0 = (offsetToMidBaseline.x - boundsMinX) / (boundsMaxX - boundsMinX); // Character's position relative to the bounds of the mesh.
+ float x1 = x0 + 0.0001f;
+ float y0 = VertexCurve.Evaluate(x0) * CurveScale;
+ float y1 = VertexCurve.Evaluate(x1) * CurveScale;
+
+ Vector3 horizontal = new Vector3(1, 0, 0);
+ //Vector3 normal = new Vector3(-(y1 - y0), (x1 * (boundsMaxX - boundsMinX) + boundsMinX) - offsetToMidBaseline.x, 0);
+ Vector3 tangent = new Vector3(x1 * (boundsMaxX - boundsMinX) + boundsMinX, y1) - new Vector3(offsetToMidBaseline.x, y0);
+
+ float dot = Mathf.Acos(Vector3.Dot(horizontal, tangent.normalized)) * 57.2957795f;
+ Vector3 cross = Vector3.Cross(horizontal, tangent);
+ float angle = cross.z > 0 ? dot : 360 - dot;
+
+ matrix = Matrix4x4.TRS(new Vector3(0, y0, 0), Quaternion.Euler(0, 0, angle), Vector3.one);
+
+ vertices[vertexIndex + 0] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 0]);
+ vertices[vertexIndex + 1] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 1]);
+ vertices[vertexIndex + 2] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 2]);
+ vertices[vertexIndex + 3] = matrix.MultiplyPoint3x4(vertices[vertexIndex + 3]);
+
+ vertices[vertexIndex + 0] += offsetToMidBaseline;
+ vertices[vertexIndex + 1] += offsetToMidBaseline;
+ vertices[vertexIndex + 2] += offsetToMidBaseline;
+ vertices[vertexIndex + 3] += offsetToMidBaseline;
+ }
+
+
+ // Upload the mesh with the revised information
+ m_TextComponent.UpdateVertexData();
+
+ yield return new WaitForSeconds(0.025f);
+ }
+ }
+ }
+}
diff --git a/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs.meta b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs.meta
new file mode 100644
index 0000000..7b7958a
--- /dev/null
+++ b/Pathfinding Visualizer/Assets/TextMesh Pro/Examples & Extras/Scripts/WarpTextExample.cs.meta
@@ -0,0 +1,12 @@
+fileFormatVersion: 2
+guid: 790744c462254b7ba8038e6ed28b3db2
+timeCreated: 1458801336
+licenseType: Pro
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
--
cgit v1.3.1-4-g156e