From 61f04ff3f33373066fe1fb42e34b1994b945094d Mon Sep 17 00:00:00 2001 From: kanonji Date: Wed, 13 Dec 2017 00:48:42 +0900 Subject: [PATCH] Initialize TemplatePath when ScriptableObject asset created --- .../ExcelPlugin/Editor/ExcelMachine.cs | 17 +++++++---------- .../GDataPlugin/Editor/GoogleMachine.cs | 11 ++++------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs b/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs index 8a0ff82..d493bfe 100644 --- a/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs +++ b/Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////// /// /// ExcelMachine.cs -/// +/// /// (c)2014 Kim, Hyoun Woo /// /////////////////////////////////////////////////////////////////////////////// @@ -17,32 +17,29 @@ namespace UnityQuickSheet internal class ExcelMachine : BaseMachine { /// - /// where the .xls or .xlsx file is. The path should start with "Assets/". + /// where the .xls or .xlsx file is. The path should start with "Assets/". /// public string excelFilePath; // both are needed for popup editor control. public string[] SheetNames = { "" }; - public int CurrentSheetIndex + public int CurrentSheetIndex { get { return currentSelectedSheet; } - set { currentSelectedSheet = value;} + set { currentSelectedSheet = value;} } [SerializeField] protected int currentSelectedSheet = 0; - // excel and google plugin have its own template files, + // 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 selected. + /// Note: Called when the asset file is created. /// - protected new void OnEnable() - { - base.OnEnable(); - + private void Awake() { TemplatePath = excelTemplatePath; } diff --git a/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs b/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs index 5a1ef8b..20a64b0 100644 --- a/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs +++ b/Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////// /// /// GoogleMachine.cs -/// +/// /// (c)2013 Kim, Hyoun Woo /// /////////////////////////////////////////////////////////////////////////////// @@ -23,19 +23,16 @@ internal class GoogleMachine : BaseMachine [SerializeField] public static string assetFileName = "GoogleMachine.asset"; - // excel and google plugin have its own template files, + // 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 selected. + /// Note: Called when the asset file is created. /// - protected new void OnEnable() - { - base.OnEnable(); - + private void Awake() { TemplatePath = gDataTemplatePath; }