Skip to content

Commit

Permalink
Merge pull request #51 from kanonji/patch-4
Browse files Browse the repository at this point in the history
Initialize TemplatePath when ScriptableObject asset created
  • Loading branch information
kimsama authored Dec 15, 2017
2 parents ea1da26 + 61f04ff commit f434e7e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
17 changes: 7 additions & 10 deletions Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////
///
/// ExcelMachine.cs
///
///
/// (c)2014 Kim, Hyoun Woo
///
///////////////////////////////////////////////////////////////////////////////
Expand All @@ -17,32 +17,29 @@ namespace UnityQuickSheet
internal class ExcelMachine : BaseMachine
{
/// <summary>
/// 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/".
/// </summary>
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";

/// <summary>
/// Note: Called when the asset file is selected.
/// Note: Called when the asset file is created.
/// </summary>
protected new void OnEnable()
{
base.OnEnable();

private void Awake() {
TemplatePath = excelTemplatePath;
}

Expand Down
11 changes: 4 additions & 7 deletions Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////
///
/// GoogleMachine.cs
///
///
/// (c)2013 Kim, Hyoun Woo
///
///////////////////////////////////////////////////////////////////////////////
Expand All @@ -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 = "";

/// <summary>
/// Note: Called when the asset file is selected.
/// Note: Called when the asset file is created.
/// </summary>
protected new void OnEnable()
{
base.OnEnable();

private void Awake() {
TemplatePath = gDataTemplatePath;
}

Expand Down

0 comments on commit f434e7e

Please sign in to comment.