diff --git a/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs b/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs index d493bfe..efb89a4 100644 --- a/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs +++ b/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs @@ -32,15 +32,13 @@ public int CurrentSheetIndex [SerializeField] protected int currentSelectedSheet = 0; - // excel and google plugin have its own template files, - // so we need to set the different path when the asset file is created. - private readonly string excelTemplatePath = "QuickSheet/ExcelPlugin/Templates"; - /// /// Note: Called when the asset file is created. /// private void Awake() { - TemplatePath = excelTemplatePath; + // excel and google plugin have its own template files, + // so we need to set the different path when the asset file is created. + TemplatePath = ExcelSettings.Instance.TemplatePath; } /// diff --git a/Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettings.cs b/Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettings.cs index 44d3ed2..6b427bd 100644 --- a/Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettings.cs +++ b/Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettings.cs @@ -19,7 +19,7 @@ namespace UnityQuickSheet public class ExcelSettings : SingletonScriptableObject { /// - /// A path where template .txt files are. + /// A default path where .txt template files are. /// public string TemplatePath = "QuickSheet/ExcelPlugin/Templates"; diff --git a/Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs b/Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs index 1c41fab..e1b8191 100644 --- a/Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs +++ b/Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs @@ -20,12 +20,12 @@ public ListEntry Serialize(T e) { public ListEntry Serialize(T e, ListEntry record) { foreach (var p in typeof (T).GetProperties()) { - if (p.CanRead) { - record.Elements.Add(new ListEntry.Custom { - LocalName = p.Name.ToLowerInvariant(), // for some reason this HAS to be lowercase or it throws - Value = ToNullOrString(p.GetValue(e, null)), - }); - } + if (p.CanRead) { + record.Elements.Add(new ListEntry.Custom { + LocalName = p.Name.ToLowerInvariant(), // for some reason this HAS to be lowercase or it throws + Value = ToNullOrString(p.GetValue(e, null)), + }); + } } return record; } @@ -41,14 +41,14 @@ public object ConvertFrom(object value, Type t) { var nc = new NullableConverter(t); return nc.ConvertFrom(value); } - - //HACK: modified to return enum. - if (t.IsEnum) - { - return Enum.Parse(t, value.ToString(), true); - } - else - return Convert.ChangeType(value, t); + + //HACK: modified to return enum. + if (t.IsEnum) + { + return Enum.Parse(t, value.ToString(), true); + } + else + return Convert.ChangeType(value, t); } public T Deserialize(ListEntry e) { @@ -58,10 +58,10 @@ public T Deserialize(ListEntry e) { var property = t.GetProperty(c.LocalName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public); if (property == null) continue; - if (property.CanWrite) { - - try - { + if (property.CanWrite) { + + try + { if (property.PropertyType.IsArray) { const char DELIMETER = ','; // '\n' @@ -123,12 +123,12 @@ public T Deserialize(ListEntry e) { property.SetValue(r, value, null); } - } - catch(Exception exc) - { - Debug.LogError ("GDataDB Serialization Exception: " + exc.Message + " ListEntry LocalName: " + c.LocalName); - } - } + } + catch(Exception exc) + { + Debug.LogError ("GDataDB Serialization Exception: " + exc.Message + " ListEntry LocalName: " + c.LocalName); + } + } } return r; } diff --git a/Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.cs b/Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.cs index ee652c9..2946362 100644 --- a/Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.cs +++ b/Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.cs @@ -34,7 +34,7 @@ public string JsonFilePath private string jsonFilePath = string.Empty; /// - /// A path where template .txt files are. + /// A default path where .txt template files are. /// public string TemplatePath = "QuickSheet/GDataPlugin/Templates"; diff --git a/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs b/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs index 20a64b0..c053768 100644 --- a/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs +++ b/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs @@ -23,17 +23,15 @@ internal class GoogleMachine : BaseMachine [SerializeField] public static string assetFileName = "GoogleMachine.asset"; - // excel and google plugin have its own template files, - // so we need to set the different path when the asset file is created. - private readonly string gDataTemplatePath = "QuickSheet/GDataPlugin/Templates"; - public string AccessCode = ""; /// /// Note: Called when the asset file is created. /// private void Awake() { - TemplatePath = gDataTemplatePath; + // excel and google plugin have its own template files, + // so we need to set the different path when the asset file is created. + TemplatePath = GoogleDataSettings.Instance.TemplatePath; } ///