Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize TemplatePath when ScriptableObject asset created #51

Merged
merged 1 commit into from
Dec 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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