Skip to content

Commit

Permalink
Merge branch 'master' into HEAD
Browse files Browse the repository at this point in the history
Conflicts:
	Assets/QuickSheet/ExcelPlugin/Editor/Excel Settings.asset
	Assets/QuickSheet/GDataPlugin/Editor/Google Data Settings.asset
	Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettingsEditor.cs
  • Loading branch information
kimsama committed Dec 24, 2017
1 parent 542387a commit 35c1f9d
Show file tree
Hide file tree
Showing 58 changed files with 678 additions and 671 deletions.
46 changes: 45 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,46 @@
**/.DS_Store
# Supyrb .gitignore standalone v0.1.4

# Unity generated
/Temp/**
/Library/**
/obj/**

# Visual Studio / MonoDevelop generated
/ExportedObj/**
/obj
/.vs/**
*.svd
*.userprefs
*.csproj
*.pidb
*.suo
*.sln
*.user
*.unityproj
*.booproj

*.csproj
*.cache
*Resharper*
*ReSharper*
*.orig
*.orig.*
*sln*
.idea/**

# OS generated
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
report.xml
~$*

# Custom
/Builds/**
/Data/**
/Assets/Temp/**
/Assets/Temp.meta
14 changes: 7 additions & 7 deletions Assets/QuickSheet/Editor/BaseEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class BaseEditor<T> : Editor where T : ScriptableObject
protected SerializedProperty worksheetProp;
protected SerializedProperty serializedData;

protected GUIStyle brown;
protected GUIStyle box;
protected bool isGUISkinInitialized = false;

/// <summary>
Expand Down Expand Up @@ -54,11 +54,11 @@ public virtual void OnEnable()
/// </summary>
protected void InitGUIStyle()
{
brown = new GUIStyle("box");
brown.normal.background = Resources.Load("brown", typeof(Texture2D)) as Texture2D;
brown.border = new RectOffset(4, 4, 4, 4);
brown.margin = new RectOffset(3, 3, 3, 3);
brown.padding = new RectOffset(4, 4, 4, 4);
box = new GUIStyle("box");
box.normal.background = Resources.Load(EditorGUIUtility.isProSkin ? "brown" : "lightSkinBox", typeof(Texture2D)) as Texture2D;
box.border = new RectOffset(4, 4, 4, 4);
box.margin = new RectOffset(3, 3, 3, 3);
box.padding = new RectOffset(4, 4, 4, 4);
}

/// <summary>
Expand All @@ -79,7 +79,7 @@ protected void DrawInspector(bool useGUIStyle = true)
}

if (useGUIStyle)
GUIHelper.DrawSerializedProperty(serializedData, brown);
GUIHelper.DrawSerializedProperty(serializedData, box);
else
GUIHelper.DrawSerializedProperty(serializedData);
}
Expand Down
43 changes: 21 additions & 22 deletions Assets/QuickSheet/Editor/GUIHelper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////////
///
/// GUIHelper.cs
///
///
/// (c)2015 Kim, Hyoun Woo
///
///////////////////////////////////////////////////////////////////////////////
Expand All @@ -26,7 +26,7 @@ public static GUIStyle MakeHeader()
/// </summary>
public static void HelpBox(string message, MessageType msgType)
{
EditorGUILayout.HelpBox(message, msgType);
EditorGUILayout.HelpBox(message, msgType);
}

const int defaultVisibleArrayElements = 20;
Expand All @@ -41,7 +41,7 @@ public static void DrawSerializedProperty(SerializedProperty prop, GUIStyle guiS
{
case SerializedPropertyType.Generic:
// make Array and Object to be fold
prop.isExpanded = EditorGUILayout.Foldout(prop.isExpanded, prop.name);
prop.isExpanded = EditorGUILayout.Foldout(prop.isExpanded, prop.displayName);
if (!prop.isExpanded)
break;

Expand All @@ -64,7 +64,7 @@ public static void DrawSerializedProperty(SerializedProperty prop, GUIStyle guiS
}
else
{
// Handles array type with separate way due to SerializedProperty provides
// Handles array type with separate way due to SerializedProperty provides
// its own method for array type.
prop.arraySize = EditorGUILayout.IntField("Length", prop.arraySize);
var showCount = Mathf.Min(prop.arraySize, maxVisibleArrayElements);
Expand Down Expand Up @@ -101,66 +101,65 @@ public static void DrawSerializedProperty(SerializedProperty prop, GUIStyle guiS
EditorGUI.indentLevel--;
break;
case SerializedPropertyType.Integer:
prop.intValue = EditorGUILayout.IntField(prop.name, prop.intValue);
prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue);
break;
case SerializedPropertyType.Boolean:
prop.boolValue = EditorGUILayout.Toggle(prop.name, prop.boolValue);
prop.boolValue = EditorGUILayout.Toggle(prop.displayName, prop.boolValue);
break;
case SerializedPropertyType.Float:
prop.floatValue = EditorGUILayout.FloatField(prop.name, prop.floatValue);
prop.floatValue = EditorGUILayout.FloatField(prop.displayName, prop.floatValue);
break;
case SerializedPropertyType.String:
prop.stringValue = EditorGUILayout.TextField(prop.name, prop.stringValue);
prop.stringValue = EditorGUILayout.TextField(prop.displayName, prop.stringValue);
break;
case SerializedPropertyType.Color:
prop.colorValue = EditorGUILayout.ColorField(prop.name, prop.colorValue);
prop.colorValue = EditorGUILayout.ColorField(prop.displayName, prop.colorValue);
break;
case SerializedPropertyType.ObjectReference:
prop.objectReferenceValue = EditorGUILayout.ObjectField(
prop.name, prop.objectReferenceValue, typeof(Object), true);
prop.displayName, prop.objectReferenceValue, typeof(Object), true);
EditorGUI.indentLevel++;
EditorGUILayout.LabelField("Type", prop.type);
EditorGUI.indentLevel--;
break;
case SerializedPropertyType.LayerMask:
prop.intValue = EditorGUILayout.IntField(prop.name, prop.intValue);
prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue);
break;
case SerializedPropertyType.Enum:
// Both of Mask and normal status are shown
EditorGUILayout.PropertyField(prop);
prop.enumValueIndex = EditorGUILayout.IntField(prop.name, prop.enumValueIndex);
EditorGUI.indentLevel++;
prop.enumValueIndex = EditorGUILayout.Popup("< Enum >", prop.enumValueIndex, prop.enumNames);
prop.enumValueIndex = EditorGUILayout.MaskField("< Mask >", prop.enumValueIndex, prop.enumNames);
EditorGUI.BeginDisabledGroup(true);
prop.enumValueIndex = EditorGUILayout.IntField(prop.name, prop.enumValueIndex);
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
break;
case SerializedPropertyType.Vector2:
prop.vector2Value = EditorGUILayout.Vector2Field(prop.name, prop.vector2Value);
prop.vector2Value = EditorGUILayout.Vector2Field(prop.displayName, prop.vector2Value);
break;
case SerializedPropertyType.Vector3:
prop.vector3Value = EditorGUILayout.Vector3Field(prop.name, prop.vector3Value);
prop.vector3Value = EditorGUILayout.Vector3Field(prop.displayName, prop.vector3Value);
break;
case SerializedPropertyType.Rect:
prop.rectValue = EditorGUILayout.RectField(prop.name, prop.rectValue);
prop.rectValue = EditorGUILayout.RectField(prop.displayName, prop.rectValue);
break;
case SerializedPropertyType.ArraySize:
prop.intValue = EditorGUILayout.IntField(prop.name, prop.intValue);
prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue);
break;
case SerializedPropertyType.Character:
EditorGUILayout.PropertyField(prop);
break;
case SerializedPropertyType.AnimationCurve:
prop.animationCurveValue = EditorGUILayout.CurveField(prop.name, prop.animationCurveValue);
prop.animationCurveValue = EditorGUILayout.CurveField(prop.displayName, prop.animationCurveValue);
break;
case SerializedPropertyType.Bounds:
prop.boundsValue = EditorGUILayout.BoundsField(prop.name, prop.boundsValue);
prop.boundsValue = EditorGUILayout.BoundsField(prop.displayName, prop.boundsValue);
break;
case SerializedPropertyType.Gradient:
EditorGUILayout.PropertyField(prop);
break;
case SerializedPropertyType.Quaternion:
prop.quaternionValue = Quaternion.Euler(
EditorGUILayout.Vector3Field(prop.name, prop.quaternionValue.eulerAngles));
EditorGUILayout.Vector3Field(prop.displayName, prop.quaternionValue.eulerAngles));
break;
}
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
98 changes: 98 additions & 0 deletions Assets/QuickSheet/Editor/Resources/lightSkinBox.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/QuickSheet/Example.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/QuickSheet/Example/Data.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Assets/QuickSheet/Example/Data/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.IO;
using UnityQuickSheet;

///
/// !!! Machine generated code !!!
///
public class ExcelExampleAssetPostprocessor : AssetPostprocessor
{
private static readonly string filePath = "Assets/QuickSheet/Example/Excel/Example.xlsx";
private static readonly string assetFilePath = "Assets/QuickSheet/Example/Excel/ExcelExample.asset";
private static readonly string sheetName = "ExcelExample";

static void OnPostprocessAllAssets (string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths)
{
foreach (string asset in importedAssets)
{
if (!filePath.Equals (asset))
continue;

ExcelExample data = (ExcelExample)AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ExcelExample));
if (data == null) {
data = ScriptableObject.CreateInstance<ExcelExample> ();
data.SheetName = filePath;
data.WorksheetName = sheetName;
AssetDatabase.CreateAsset ((ScriptableObject)data, assetFilePath);
//data.hideFlags = HideFlags.NotEditable;
}

//data.dataArray = new ExcelQuery(filePath, sheetName).Deserialize<ExcelExampleData>().ToArray();

//ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject;
//EditorUtility.SetDirty (obj);

ExcelQuery query = new ExcelQuery(filePath, sheetName);
if (query != null && query.IsValid())
{
data.dataArray = query.Deserialize<ExcelExampleData>().ToArray();
ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject;
EditorUtility.SetDirty (obj);
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 35c1f9d

Please sign in to comment.