From aba7f1d050b8ff1c74c6525106dadc379081e8dd Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Thu, 19 Feb 2015 16:37:52 +0000 Subject: [PATCH] Added FormatEnumNames() & SplitCamelCase() to StringFormatter #84 --- .../FungusScript/Scripts/StringFormatter.cs | 52 ++++ .../Scripts/StringFormatter.cs.meta | 8 + .../FungusExamples/TheHunter/TheHunter.unity | 243 +++++++++++++++--- 3 files changed, 266 insertions(+), 37 deletions(-) create mode 100644 Assets/Fungus/FungusScript/Scripts/StringFormatter.cs create mode 100644 Assets/Fungus/FungusScript/Scripts/StringFormatter.cs.meta diff --git a/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs b/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs new file mode 100644 index 00000000..171d413b --- /dev/null +++ b/Assets/Fungus/FungusScript/Scripts/StringFormatter.cs @@ -0,0 +1,52 @@ +using UnityEngine; +using UnityEditor; +using System.IO; +using System.Collections; +using System.Text; +using System; + +namespace Fungus +{ + public class StringFormatter + { + public static string[] FormatEnumNames(Enum e, string firstLabel) + { + string[] enumLabels = Enum.GetNames(e.GetType()); + enumLabels[0] = firstLabel; + for (int i=0; i