├── .gitignore ├── Assets ├── QuickSheet.meta └── QuickSheet │ ├── Doc.meta │ ├── Doc │ ├── Unity-Quicksheet.pdf │ └── Unity-Quicksheet.pdf.meta │ ├── Editor.meta │ ├── Editor │ ├── BaseEditor.cs │ ├── BaseEditor.cs.meta │ ├── BaseMachine.cs │ ├── BaseMachine.cs.meta │ ├── BaseMachineEditor.cs │ ├── BaseMachineEditor.cs.meta │ ├── CustomAssetUtility.cs │ ├── CustomAssetUtility.cs.meta │ ├── GUIHelper.cs │ ├── GUIHelper.cs.meta │ ├── Resources.meta │ ├── Resources │ │ ├── brown.png │ │ ├── brown.png.meta │ │ ├── lightSkinBox.png │ │ └── lightSkinBox.png.meta │ ├── ScriptGenerator.cs │ ├── ScriptGenerator.cs.meta │ ├── ScriptPrescription.cs │ ├── ScriptPrescription.cs.meta │ ├── Util.meta │ └── Util │ │ ├── Cloner.cs │ │ ├── Cloner.cs.meta │ │ ├── CsvParser.cs │ │ ├── CsvParser.cs.meta │ │ ├── Singleton.cs │ │ ├── Singleton.cs.meta │ │ ├── SingletonScriptableObject.cs │ │ ├── SingletonScriptableObject.cs.meta │ │ ├── Util.cs │ │ └── Util.cs.meta │ ├── Example.meta │ ├── Example │ ├── Data.meta │ ├── Data │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── ExcelExampleAssetPostProcessor.cs │ │ │ ├── ExcelExampleAssetPostProcessor.cs.meta │ │ │ ├── ExcelExampleEditor.cs │ │ │ └── ExcelExampleEditor.cs.meta │ │ ├── Runtime.meta │ │ └── Runtime │ │ │ ├── ExcelExample.cs │ │ │ ├── ExcelExample.cs.meta │ │ │ ├── ExcelExampleData.cs │ │ │ └── ExcelExampleData.cs.meta │ ├── Difficulty.cs │ ├── Difficulty.cs.meta │ ├── Excel.meta │ ├── Excel │ │ ├── Example.xlsx │ │ ├── Example.xlsx.meta │ │ ├── ExcelExample.asset │ │ └── ExcelExample.asset.meta │ ├── ExcelExampleImporter.asset │ └── ExcelExampleImporter.asset.meta │ ├── ExcelPlugin.meta │ ├── ExcelPlugin │ ├── Editor.meta │ ├── Editor │ │ ├── BaseExcelEditor.cs │ │ ├── BaseExcelEditor.cs.meta │ │ ├── Excel Settings.asset │ │ ├── Excel Settings.asset.meta │ │ ├── ExcelMachine.cs │ │ ├── ExcelMachine.cs.meta │ │ ├── ExcelMachineEditor.cs │ │ ├── ExcelMachineEditor.cs.meta │ │ ├── ExcelQuery.cs │ │ ├── ExcelQuery.cs.meta │ │ ├── ExcelSettings.cs │ │ ├── ExcelSettings.cs.meta │ │ ├── ExcelSettingsEditor.cs │ │ ├── ExcelSettingsEditor.cs.meta │ │ ├── Library.meta │ │ └── Library │ │ │ ├── ICSharpCode.SharpZipLib.dll │ │ │ ├── ICSharpCode.SharpZipLib.dll.meta │ │ │ ├── NPOI.2.1.1.txt │ │ │ ├── NPOI.2.1.1.txt.meta │ │ │ ├── NPOI.OOXML.dll │ │ │ ├── NPOI.OOXML.dll.meta │ │ │ ├── NPOI.OpenXml4Net.dll │ │ │ ├── NPOI.OpenXml4Net.dll.meta │ │ │ ├── NPOI.OpenXmlFormats.dll │ │ │ ├── NPOI.OpenXmlFormats.dll.meta │ │ │ ├── NPOI.XML │ │ │ ├── NPOI.XML.meta │ │ │ ├── NPOI.dll │ │ │ ├── NPOI.dll.meta │ │ │ ├── Release Notes.txt │ │ │ └── Release Notes.txt.meta │ ├── Templates.meta │ └── Templates │ │ ├── DataClass.txt │ │ ├── DataClass.txt.meta │ │ ├── PostProcessor.txt │ │ ├── PostProcessor.txt.meta │ │ ├── ScriptableObjectClass.txt │ │ ├── ScriptableObjectClass.txt.meta │ │ ├── ScriptableObjectEditorClass.txt │ │ └── ScriptableObjectEditorClass.txt.meta │ ├── GDataPlugin.meta │ ├── GDataPlugin │ ├── Editor.meta │ ├── Editor │ │ ├── BaseGoogleEditor.cs │ │ ├── BaseGoogleEditor.cs.meta │ │ ├── GDataDB.meta │ │ ├── GDataDB │ │ │ ├── GDataDB.Linq.meta │ │ │ ├── GDataDB.Linq │ │ │ │ ├── ITableExtensions.cs │ │ │ │ ├── ITableExtensions.cs.meta │ │ │ │ ├── Impl.meta │ │ │ │ └── Impl │ │ │ │ │ ├── Evaluator.cs │ │ │ │ │ ├── Evaluator.cs.meta │ │ │ │ │ ├── ExpressionVisitor.cs │ │ │ │ │ ├── ExpressionVisitor.cs.meta │ │ │ │ │ ├── GDataDBQueryProvider.cs │ │ │ │ │ ├── GDataDBQueryProvider.cs.meta │ │ │ │ │ ├── OrderTranslator.cs │ │ │ │ │ ├── OrderTranslator.cs.meta │ │ │ │ │ ├── Query.cs │ │ │ │ │ ├── Query.cs.meta │ │ │ │ │ ├── QueryProvider.cs │ │ │ │ │ ├── QueryProvider.cs.meta │ │ │ │ │ ├── QueryTranslator.cs │ │ │ │ │ ├── QueryTranslator.cs.meta │ │ │ │ │ ├── TypeSystem.cs │ │ │ │ │ ├── TypeSystem.cs.meta │ │ │ │ │ ├── WhereTranslator.cs │ │ │ │ │ └── WhereTranslator.cs.meta │ │ │ ├── GDataDB.meta │ │ │ ├── GDataDB │ │ │ │ ├── DatabaseClient.cs │ │ │ │ ├── DatabaseClient.cs.meta │ │ │ │ ├── IDatabase.cs │ │ │ │ ├── IDatabase.cs.meta │ │ │ │ ├── IDatabaseClient.cs │ │ │ │ ├── IDatabaseClient.cs.meta │ │ │ │ ├── IRow.cs │ │ │ │ ├── IRow.cs.meta │ │ │ │ ├── ITable.cs │ │ │ │ ├── ITable.cs.meta │ │ │ │ ├── Impl.meta │ │ │ │ ├── Impl │ │ │ │ │ ├── Database.cs │ │ │ │ │ ├── Database.cs.meta │ │ │ │ │ ├── GDataDBRequestFactory.cs │ │ │ │ │ ├── GDataDBRequestFactory.cs.meta │ │ │ │ │ ├── Row.cs │ │ │ │ │ ├── Row.cs.meta │ │ │ │ │ ├── Serializer.cs │ │ │ │ │ ├── Serializer.cs.meta │ │ │ │ │ ├── Table.cs │ │ │ │ │ └── Table.cs.meta │ │ │ │ ├── Order.cs │ │ │ │ ├── Order.cs.meta │ │ │ │ ├── Query.cs │ │ │ │ └── Query.cs.meta │ │ │ ├── README.md │ │ │ ├── README.md.meta │ │ │ ├── license.txt │ │ │ └── license.txt.meta │ │ ├── Google Data Settings.asset │ │ ├── Google Data Settings.asset.meta │ │ ├── Google.meta │ │ ├── Google │ │ │ ├── Google.GData.AccessControl.DLL │ │ │ ├── Google.GData.AccessControl.DLL.meta │ │ │ ├── Google.GData.Client.dll │ │ │ ├── Google.GData.Client.dll.meta │ │ │ ├── Google.GData.Documents.dll │ │ │ ├── Google.GData.Documents.dll.meta │ │ │ ├── Google.GData.Extensions.dll │ │ │ ├── Google.GData.Extensions.dll.meta │ │ │ ├── Google.GData.Spreadsheets.dll │ │ │ ├── Google.GData.Spreadsheets.dll.meta │ │ │ ├── Google.GData.license.txt │ │ │ ├── Google.GData.license.txt.meta │ │ │ ├── Newtonsoft.Json.dll │ │ │ ├── Newtonsoft.Json.dll.mdb │ │ │ ├── Newtonsoft.Json.dll.mdb.meta │ │ │ ├── Newtonsoft.Json.dll.meta │ │ │ ├── Newtonsoft.Json.pdb │ │ │ ├── Newtonsoft.Json.pdb.meta │ │ │ ├── Newtonsoft.Json.xml │ │ │ ├── Newtonsoft.Json.xml.meta │ │ │ ├── license.txt │ │ │ └── license.txt.meta │ │ ├── GoogleDataSettings.cs │ │ ├── GoogleDataSettings.cs.meta │ │ ├── GoogleDataSettingsEditor.cs │ │ ├── GoogleDataSettingsEditor.cs.meta │ │ ├── GoogleMachine.cs │ │ ├── GoogleMachine.cs.meta │ │ ├── GoogleMachineEditor.cs │ │ └── GoogleMachineEditor.cs.meta │ ├── Templates.meta │ └── Templates │ │ ├── AssetFileClass.txt │ │ ├── AssetFileClass.txt.meta │ │ ├── DataClass.txt │ │ ├── DataClass.txt.meta │ │ ├── ScriptableObjectClass.txt │ │ ├── ScriptableObjectClass.txt.meta │ │ ├── ScriptableObjectEditorClass.txt │ │ └── ScriptableObjectEditorClass.txt.meta │ ├── Runtime.meta │ └── Runtime │ ├── ExposePropertyAttribute.cs │ ├── ExposePropertyAttribute.cs.meta │ ├── Util.meta │ └── Util │ ├── ConvertExt.cs │ └── ConvertExt.cs.meta ├── LICENSE ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NavMeshLayers.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset ├── README.md └── images ├── array_cell.png ├── arraytype_setting.png ├── enum_type.png ├── google-accesscode-01.png ├── google-accesscode.png ├── google-setting.png └── quicksheet01.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Supyrb .gitignore standalone v0.1.4 2 | 3 | # Unity generated 4 | /Temp/** 5 | /Library/** 6 | /obj/** 7 | 8 | # Visual Studio / MonoDevelop generated 9 | /ExportedObj/** 10 | /obj 11 | /.vs/** 12 | *.svd 13 | *.userprefs 14 | *.csproj 15 | *.pidb 16 | *.suo 17 | *.sln 18 | *.user 19 | *.unityproj 20 | *.booproj 21 | 22 | *.csproj 23 | *.cache 24 | *Resharper* 25 | *ReSharper* 26 | *.orig 27 | *.orig.* 28 | *sln* 29 | .idea/** 30 | 31 | # OS generated 32 | .DS_Store 33 | .DS_Store? 34 | ._* 35 | .Spotlight-V100 36 | .Trashes 37 | ehthumbs.db 38 | Thumbs.db 39 | report.xml 40 | ~$* 41 | 42 | # Custom 43 | /Builds/** 44 | /Data/** 45 | /Assets/Temp/** 46 | /Assets/Temp.meta -------------------------------------------------------------------------------- /Assets/QuickSheet.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61e23f7de6db87d489968e0672655c0e 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Doc.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2316e22f5fdc1db4f8e2dbcaf3b2c035 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Doc/Unity-Quicksheet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/Doc/Unity-Quicksheet.pdf -------------------------------------------------------------------------------- /Assets/QuickSheet/Doc/Unity-Quicksheet.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e0586483ff811148825cfc35ac00e5d 3 | timeCreated: 1486463499 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a19c9b2a0f836c4fb795a958998b9d8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/BaseEditor.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// BaseEditor.cs 4 | /// 5 | /// (c)2016 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System; 11 | using System.Collections; 12 | 13 | namespace UnityQuickSheet 14 | { 15 | /// 16 | /// Base class which draws properties of the created scriptableobject. 17 | /// 18 | /// 19 | public abstract class BaseEditor : Editor where T : ScriptableObject 20 | { 21 | protected SerializedObject targetObject; 22 | protected SerializedProperty spreadsheetProp; 23 | protected SerializedProperty worksheetProp; 24 | protected SerializedProperty serializedData; 25 | 26 | protected GUIStyle box; 27 | protected bool isGUISkinInitialized = false; 28 | 29 | /// 30 | /// Create SerialliedObject and initialize related SerializedProperty objects 31 | /// which are needed to draw data on the Inspector view. 32 | /// 33 | public virtual void OnEnable() 34 | { 35 | T t = (T)target; 36 | targetObject = new SerializedObject(t); 37 | 38 | spreadsheetProp = targetObject.FindProperty("SheetName"); 39 | if (spreadsheetProp == null) 40 | Debug.LogError("Failed to find 'SheetName' property."); 41 | 42 | worksheetProp = targetObject.FindProperty("WorksheetName"); 43 | if (worksheetProp == null) 44 | Debug.LogError("Failed to find 'WorksheetName' property."); 45 | 46 | serializedData = targetObject.FindProperty("dataArray"); 47 | if (serializedData == null) 48 | Debug.LogError("Failed to find 'dataArray' member field."); 49 | } 50 | 51 | /// 52 | /// Create and initialize a new gui style which can be used for representing 53 | /// each element of dataArray. 54 | /// 55 | protected void InitGUIStyle() 56 | { 57 | box = new GUIStyle("box"); 58 | box.normal.background = Resources.Load(EditorGUIUtility.isProSkin ? "brown" : "lightSkinBox", typeof(Texture2D)) as Texture2D; 59 | box.border = new RectOffset(4, 4, 4, 4); 60 | box.margin = new RectOffset(3, 3, 3, 3); 61 | box.padding = new RectOffset(4, 4, 4, 4); 62 | } 63 | 64 | /// 65 | /// Draw serialized properties on the Inspector view. 66 | /// 67 | /// 68 | protected void DrawInspector(bool useGUIStyle = true) 69 | { 70 | // Draw 'spreadsheet' and 'worksheet' name. 71 | EditorGUILayout.TextField(spreadsheetProp.name, spreadsheetProp.stringValue); 72 | EditorGUILayout.TextField(worksheetProp.name, worksheetProp.stringValue); 73 | 74 | // Draw properties of the data class. 75 | if (useGUIStyle && !isGUISkinInitialized) 76 | { 77 | isGUISkinInitialized = true; 78 | InitGUIStyle(); 79 | } 80 | 81 | if (useGUIStyle) 82 | GUIHelper.DrawSerializedProperty(serializedData, box); 83 | else 84 | GUIHelper.DrawSerializedProperty(serializedData); 85 | } 86 | 87 | /// 88 | /// Called when 'Update'(or 'Download' for google data) button is pressed. 89 | /// It should be reimplemented in the derived class. 90 | /// 91 | public virtual bool Load() 92 | { 93 | throw new NotImplementedException(); 94 | } 95 | } 96 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/BaseEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f030d35c43bd0504dbf0c5777a503817 3 | timeCreated: 1470992163 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/BaseMachine.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// BaseMachine.cs 4 | /// 5 | /// (c)2014 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | 13 | namespace UnityQuickSheet 14 | { 15 | /// 16 | /// A class which represents column header on the worksheet. 17 | /// 18 | [System.Serializable] 19 | public class ColumnHeader 20 | { 21 | public CellType type; 22 | public string name; 23 | public bool isEnable; 24 | public bool isArray; 25 | public ColumnHeader nextArrayItem; 26 | 27 | // used to order columns by ascending. (only need on excel-plugin) 28 | public int OrderNO { get; set; } 29 | } 30 | 31 | /// 32 | /// A class which stores various settings for a worksheet which is imported. 33 | /// 34 | public class BaseMachine : ScriptableObject 35 | { 36 | protected readonly static string ImportSettingFilename = "New Import Setting.asset"; 37 | 38 | [SerializeField] 39 | private string templatePath = "QuickSheet/Templates"; 40 | public string TemplatePath 41 | { 42 | get { return templatePath; } 43 | set { templatePath = value; } 44 | } 45 | 46 | /// 47 | /// path the created ScriptableObject class file will be located. 48 | /// 49 | [SerializeField] 50 | private string scriptFilePath; 51 | public string RuntimeClassPath 52 | { 53 | get { return scriptFilePath; } 54 | set { scriptFilePath = value; } 55 | } 56 | 57 | /// 58 | /// path the created editor script files will be located. 59 | /// 60 | [SerializeField] 61 | private string editorScriptFilePath; 62 | public string EditorClassPath 63 | { 64 | get { return editorScriptFilePath; } 65 | set { editorScriptFilePath = value; } 66 | } 67 | 68 | [SerializeField] 69 | private string sheetName; 70 | public string SpreadSheetName 71 | { 72 | get { return sheetName; } 73 | set { sheetName = value; } 74 | } 75 | 76 | [SerializeField] 77 | private string workSheetName; 78 | public string WorkSheetName 79 | { 80 | get { return workSheetName; } 81 | set { workSheetName = value; } 82 | } 83 | 84 | [System.NonSerialized] 85 | public bool onlyCreateDataClass = false; 86 | 87 | public List ColumnHeaderList 88 | { 89 | get { return columnHeaderList; } 90 | set { columnHeaderList = value; } 91 | } 92 | 93 | [SerializeField] 94 | protected List columnHeaderList; 95 | 96 | /// 97 | /// Return true, if the list is instantiated and has any its item more than one. 98 | /// 99 | /// 100 | public bool HasColumnHeader() 101 | { 102 | if (columnHeaderList != null && columnHeaderList.Count > 0) 103 | return true; 104 | 105 | return false; 106 | } 107 | 108 | protected readonly string DEFAULT_CLASS_PATH = "Scripts/Runtime"; 109 | protected readonly string DEFAULT_EDITOR_PATH = "Scripts/Editor"; 110 | 111 | protected void OnEnable() 112 | { 113 | if (columnHeaderList == null) 114 | columnHeaderList = new List(); 115 | } 116 | 117 | /// 118 | /// Initialize with default value whenever the asset file is enabled. 119 | /// 120 | public void ReInitialize() 121 | { 122 | if (string.IsNullOrEmpty(RuntimeClassPath)) 123 | RuntimeClassPath = DEFAULT_CLASS_PATH; 124 | if (string.IsNullOrEmpty(EditorClassPath)) 125 | EditorClassPath = DEFAULT_EDITOR_PATH; 126 | 127 | // reinitialize. it does not need to be serialized. 128 | onlyCreateDataClass = false; 129 | } 130 | } 131 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/BaseMachine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a01705deb29facb459d44306e444e9d6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/BaseMachineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77e83da85ee340940941e84788d93b69 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/CustomAssetUtility.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// CustomAssetUtility.cs 4 | /// 5 | /// (c)2013 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.IO; 11 | 12 | public static class CustomAssetUtility 13 | { 14 | public static T CreateAsset () where T : ScriptableObject 15 | { 16 | T asset = ScriptableObject.CreateInstance (); 17 | 18 | string path = AssetDatabase.GetAssetPath (Selection.activeObject); 19 | if (path == "") 20 | { 21 | path = "Assets"; 22 | } 23 | else if (Path.GetExtension (path) != "") 24 | { 25 | path = path.Replace (Path.GetFileName (AssetDatabase.GetAssetPath (Selection.activeObject)), ""); 26 | } 27 | 28 | string assetPathAndName = AssetDatabase.GenerateUniqueAssetPath (path + "/New " + typeof(T).ToString() + ".asset"); 29 | 30 | AssetDatabase.CreateAsset (asset, assetPathAndName); 31 | 32 | AssetDatabase.SaveAssets (); 33 | EditorUtility.FocusProjectWindow (); 34 | Selection.activeObject = asset; 35 | 36 | return asset; 37 | } 38 | 39 | public static string GetUniqueAssetPathNameOrFallback(string filename) 40 | { 41 | string path; 42 | try 43 | { 44 | // Private implementation of a file naming function which puts the file at the selected path. 45 | System.Type assetdatabase = typeof(UnityEditor.AssetDatabase); 46 | path = (string)assetdatabase.GetMethod("GetUniquePathNameAtSelectedPath", 47 | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static).Invoke(assetdatabase, new object[] { filename }); 48 | } 49 | catch 50 | { 51 | // Protection against implementation changes. 52 | path = UnityEditor.AssetDatabase.GenerateUniqueAssetPath("Assets/" + filename); 53 | } 54 | return path; 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/CustomAssetUtility.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 197163b50bd708a45b2fe8b77572299f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/GUIHelper.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// GUIHelper.cs 4 | /// 5 | /// (c)2015 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | 11 | namespace UnityQuickSheet 12 | { 13 | public static class GUIHelper 14 | { 15 | public static GUIStyle MakeHeader() 16 | { 17 | GUIStyle headerStyle = new GUIStyle(GUI.skin.label); 18 | headerStyle.fontSize = 12; 19 | headerStyle.fontStyle = FontStyle.Bold; 20 | 21 | return headerStyle; 22 | } 23 | 24 | /// 25 | /// A wrapper put help message on the Inspector. 26 | /// 27 | public static void HelpBox(string message, MessageType msgType) 28 | { 29 | EditorGUILayout.HelpBox(message, msgType); 30 | } 31 | 32 | const int defaultVisibleArrayElements = 20; 33 | static int maxVisibleArrayElements = defaultVisibleArrayElements; 34 | 35 | /// 36 | /// Recursively draw properties of the given SerializedProperty data. 37 | /// 38 | public static void DrawSerializedProperty(SerializedProperty prop, GUIStyle guiStyle = null) 39 | { 40 | switch (prop.propertyType) 41 | { 42 | case SerializedPropertyType.Generic: 43 | // make Array and Object to be fold 44 | prop.isExpanded = EditorGUILayout.Foldout(prop.isExpanded, prop.displayName, true); 45 | if (!prop.isExpanded) 46 | break; 47 | 48 | // increase indentation 49 | EditorGUI.indentLevel++; 50 | if (!prop.isArray) 51 | { 52 | // get Serializable Object 53 | var child = prop.Copy(); 54 | var end = prop.GetEndProperty(true); 55 | if (child.Next(true)) 56 | { 57 | while (!SerializedProperty.EqualContents(child, end)) 58 | { 59 | DrawSerializedProperty(child); 60 | if (!child.Next(false)) 61 | break; 62 | } 63 | } 64 | } 65 | else 66 | { 67 | // Handles array type with separate way due to SerializedProperty provides 68 | // its own method for array type. 69 | prop.arraySize = EditorGUILayout.IntField("Length", prop.arraySize); 70 | var showCount = Mathf.Min(prop.arraySize, maxVisibleArrayElements); 71 | for (int i = 0; i < showCount; i++) 72 | { 73 | if (guiStyle != null) 74 | { 75 | using (new GUILayout.VerticalScope(guiStyle)) 76 | { 77 | DrawSerializedProperty(prop.GetArrayElementAtIndex(i)); 78 | } 79 | } 80 | else 81 | DrawSerializedProperty(prop.GetArrayElementAtIndex(i)); 82 | } 83 | // Hide elements if it exceeds defined show count. 84 | if (prop.arraySize > showCount) 85 | { 86 | using (new GUILayout.HorizontalScope()) 87 | { 88 | // Do indentation 89 | for (int i = 0; i < EditorGUI.indentLevel; i++) 90 | { 91 | GUILayout.Space(EditorGUIUtility.singleLineHeight); 92 | } 93 | if (GUILayout.Button("Show more ...")) 94 | { 95 | maxVisibleArrayElements += defaultVisibleArrayElements; 96 | } 97 | } 98 | } 99 | } 100 | // decrease indentation 101 | EditorGUI.indentLevel--; 102 | break; 103 | case SerializedPropertyType.Integer: 104 | prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue); 105 | break; 106 | case SerializedPropertyType.Boolean: 107 | prop.boolValue = EditorGUILayout.Toggle(prop.displayName, prop.boolValue); 108 | break; 109 | case SerializedPropertyType.Float: 110 | prop.floatValue = EditorGUILayout.FloatField(prop.displayName, prop.floatValue); 111 | break; 112 | case SerializedPropertyType.String: 113 | prop.stringValue = EditorGUILayout.TextField(prop.displayName, prop.stringValue); 114 | break; 115 | case SerializedPropertyType.Color: 116 | prop.colorValue = EditorGUILayout.ColorField(prop.displayName, prop.colorValue); 117 | break; 118 | case SerializedPropertyType.ObjectReference: 119 | prop.objectReferenceValue = EditorGUILayout.ObjectField( 120 | prop.displayName, prop.objectReferenceValue, typeof(Object), true); 121 | EditorGUI.indentLevel++; 122 | EditorGUILayout.LabelField("Type", prop.type); 123 | EditorGUI.indentLevel--; 124 | break; 125 | case SerializedPropertyType.LayerMask: 126 | prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue); 127 | break; 128 | case SerializedPropertyType.Enum: 129 | EditorGUILayout.PropertyField(prop); 130 | EditorGUI.indentLevel++; 131 | EditorGUI.BeginDisabledGroup(true); 132 | prop.enumValueIndex = EditorGUILayout.IntField(prop.name, prop.enumValueIndex); 133 | EditorGUI.EndDisabledGroup(); 134 | EditorGUI.indentLevel--; 135 | break; 136 | case SerializedPropertyType.Vector2: 137 | prop.vector2Value = EditorGUILayout.Vector2Field(prop.displayName, prop.vector2Value); 138 | break; 139 | case SerializedPropertyType.Vector3: 140 | prop.vector3Value = EditorGUILayout.Vector3Field(prop.displayName, prop.vector3Value); 141 | break; 142 | case SerializedPropertyType.Rect: 143 | prop.rectValue = EditorGUILayout.RectField(prop.displayName, prop.rectValue); 144 | break; 145 | case SerializedPropertyType.ArraySize: 146 | prop.intValue = EditorGUILayout.IntField(prop.displayName, prop.intValue); 147 | break; 148 | case SerializedPropertyType.Character: 149 | EditorGUILayout.PropertyField(prop); 150 | break; 151 | case SerializedPropertyType.AnimationCurve: 152 | prop.animationCurveValue = EditorGUILayout.CurveField(prop.displayName, prop.animationCurveValue); 153 | break; 154 | case SerializedPropertyType.Bounds: 155 | prop.boundsValue = EditorGUILayout.BoundsField(prop.displayName, prop.boundsValue); 156 | break; 157 | case SerializedPropertyType.Gradient: 158 | EditorGUILayout.PropertyField(prop); 159 | break; 160 | case SerializedPropertyType.Quaternion: 161 | prop.quaternionValue = Quaternion.Euler( 162 | EditorGUILayout.Vector3Field(prop.displayName, prop.quaternionValue.eulerAngles)); 163 | break; 164 | } 165 | } 166 | 167 | } 168 | } 169 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/GUIHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 504b93fdbd135884eb5d87a4bb9d2e8d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ae03436deb51cd4a8cf8d9015b1867f 3 | folderAsset: yes 4 | timeCreated: 1461753589 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Resources/brown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/Editor/Resources/brown.png -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Resources/brown.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 81a28a6c67c9bde4fa82f00cfda8c4f1 3 | timeCreated: 1461753650 4 | licenseType: Pro 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Resources/lightSkinBox.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/Editor/Resources/lightSkinBox.png -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Resources/lightSkinBox.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a222f7263bb0e43538e362c4513a5ec9 3 | timeCreated: 1509256440 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 4 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 0 11 | sRGBTexture: 0 12 | linearTexture: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapsPreserveCoverage: 0 16 | alphaTestReferenceValue: 0.5 17 | mipMapFadeDistanceStart: 1 18 | mipMapFadeDistanceEnd: 3 19 | bumpmap: 20 | convertToNormalMap: 0 21 | externalNormalMap: 0 22 | heightScale: 0.25 23 | normalMapFilter: 0 24 | isReadable: 0 25 | grayScaleToAlpha: 0 26 | generateCubemap: 6 27 | cubemapConvolution: 0 28 | seamlessCubemap: 0 29 | textureFormat: 1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | serializedVersion: 2 33 | filterMode: 0 34 | aniso: -1 35 | mipBias: -1 36 | wrapU: 1 37 | wrapV: 1 38 | wrapW: 1 39 | nPOTScale: 1 40 | lightmap: 0 41 | compressionQuality: 50 42 | spriteMode: 1 43 | spriteExtrude: 1 44 | spriteMeshType: 1 45 | alignment: 0 46 | spritePivot: {x: 0.5, y: 0.5} 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spritePixelsToUnits: 100 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | maxTextureSizeSet: 0 55 | compressionQualitySet: 0 56 | textureFormatSet: 0 57 | platformSettings: 58 | - buildTarget: DefaultTexturePlatform 59 | maxTextureSize: 2048 60 | textureFormat: -1 61 | textureCompression: 1 62 | compressionQuality: 50 63 | crunchedCompression: 0 64 | allowsAlphaSplitting: 0 65 | overridden: 0 66 | - buildTarget: Standalone 67 | maxTextureSize: 2048 68 | textureFormat: -1 69 | textureCompression: 1 70 | compressionQuality: 50 71 | crunchedCompression: 0 72 | allowsAlphaSplitting: 0 73 | overridden: 0 74 | - buildTarget: iPhone 75 | maxTextureSize: 2048 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | - buildTarget: Android 83 | maxTextureSize: 2048 84 | textureFormat: -1 85 | textureCompression: 1 86 | compressionQuality: 50 87 | crunchedCompression: 0 88 | allowsAlphaSplitting: 0 89 | overridden: 0 90 | spriteSheet: 91 | serializedVersion: 2 92 | sprites: [] 93 | outline: [] 94 | physicsShape: [] 95 | spritePackingTag: 96 | userData: 97 | assetBundleName: 98 | assetBundleVariant: 99 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/ScriptGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af81f81b72fcdac4c9222b6b17ace885 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/ScriptPrescription.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// ScriptPrescription.cs 4 | /// 5 | /// (c)2013 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using System; 9 | using UnityEngine; 10 | using UnityEditor; 11 | using System.Linq; 12 | using System.IO; 13 | using System.Collections.Generic; 14 | using System.Text.RegularExpressions; 15 | using Object = UnityEngine.Object; 16 | 17 | namespace UnityQuickSheet 18 | { 19 | [Serializable] 20 | public class ScriptPrescription 21 | { 22 | public string className = string.Empty; 23 | public string spreadsheetName = string.Empty; 24 | public string worksheetClassName = string.Empty; // used for ScriptableObject class name. 25 | public string dataClassName = string.Empty; 26 | public string assetFileCreateFuncName = string.Empty; 27 | public string template = string.Empty; 28 | 29 | public string importedFilePath = string.Empty; // should start with "Assets" not full path 30 | public string assetFilepath = string.Empty; // should start with "Assets" not full path 31 | public string assetPostprocessorClass = string.Empty; 32 | 33 | public MemberFieldData[] memberFields; 34 | 35 | /// 36 | /// Reserved for future usage to make it easy for explicitly converting. 37 | /// 38 | public Dictionary mStringReplacements = new Dictionary (); 39 | } 40 | 41 | /// 42 | /// Represent type of an each cell. 43 | /// 44 | public enum CellType 45 | { 46 | Undefined, 47 | String, 48 | Short, 49 | Int, 50 | Long, 51 | Float, 52 | Double, 53 | Enum, 54 | Bool, 55 | } 56 | 57 | public class MemberFieldData 58 | { 59 | public CellType type = CellType.Undefined; 60 | private string name; 61 | 62 | public static bool Valid(string title) 63 | { 64 | return Regex.IsMatch(title, @"\s*(:string:integer)", RegexOptions.IgnoreCase); 65 | } 66 | 67 | public string Name 68 | { 69 | get { return name; } 70 | set { name = value; } 71 | } 72 | 73 | public string Type 74 | { 75 | get 76 | { 77 | switch(type) 78 | { 79 | case CellType.String: 80 | return "string"; 81 | case CellType.Short: 82 | return "short"; 83 | case CellType.Int: 84 | return "int"; 85 | case CellType.Long: 86 | return "long"; 87 | case CellType.Float: 88 | return "float"; 89 | case CellType.Double: 90 | return "double"; 91 | case CellType.Enum: 92 | return "enum"; 93 | case CellType.Bool: 94 | return "bool"; 95 | default: 96 | return "string"; 97 | } 98 | } 99 | } 100 | 101 | public bool IsArrayType { get; set; } 102 | 103 | public MemberFieldData() 104 | { 105 | name = ""; 106 | type = CellType.Undefined; 107 | } 108 | 109 | [System.Obsolete("Use default constructor.")] 110 | public MemberFieldData(string def) 111 | { 112 | string[] strSplit = def.Split (':'); 113 | if (strSplit.Length > 1) 114 | { 115 | string typedef = strSplit[1]; 116 | 117 | if (string.Compare(typedef, "integer") == 0) 118 | type = CellType.Int; 119 | if (string.Compare(typedef, "long") == 0) 120 | type = CellType.Long; 121 | else if (string.Compare(typedef,"string") == 0) 122 | type = CellType.String; 123 | else if (string.Compare(typedef, "float") == 0) 124 | type = CellType.Float; 125 | else if (string.Compare(typedef, "double") == 0) 126 | type = CellType.Double; 127 | else if (string.Compare(typedef, "enum") == 0) 128 | type = CellType.Enum; 129 | else if (string.Compare(typedef, "bool") == 0) 130 | type = CellType.Bool; 131 | else 132 | { 133 | type = CellType.Undefined; 134 | Debug.LogError ("Wrong cell type is defined: " + typedef); 135 | } 136 | } 137 | else 138 | type = CellType.Undefined; 139 | 140 | name = strSplit [0]; 141 | } 142 | } 143 | 144 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/ScriptPrescription.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0965d21528a71644bb3c64733ed85178 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4853d62200d7ef43b86980de2483fd6 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/Cloner.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Reflection; 4 | 5 | namespace UnityQuickSheet 6 | { 7 | 8 | /// 9 | /// Cloner which do deep copy of an array or class instance. 10 | /// 11 | /// See Also: 12 | /// http://www.codeproject.com/Articles/38270/Deep-copy-of-objects-in-C 13 | /// 14 | /// CAUTION: 15 | /// For an inheritance case, deep copying all member fields of the ancestor are not tested. 16 | /// 17 | public class Cloner 18 | { 19 | public static T DeepCopy(T obj) 20 | { 21 | if (obj == null) 22 | throw new ArgumentNullException("Object cannot be null"); 23 | return (T)Process(obj); 24 | } 25 | 26 | static object Process(object obj) 27 | { 28 | if (obj == null) 29 | return null; 30 | Type type = obj.GetType(); 31 | if (type.IsValueType || type == typeof(string)) 32 | { 33 | return obj; 34 | } 35 | else if (type.IsArray) 36 | { 37 | Type elementType = Type.GetType( 38 | type.FullName.Replace("[]", string.Empty)); 39 | 40 | var array = obj as Array; 41 | Array copied = Array.CreateInstance(elementType, array.Length); 42 | for (int i = 0; i < array.Length; i++) 43 | { 44 | copied.SetValue(Process(array.GetValue(i)), i); 45 | } 46 | return Convert.ChangeType(copied, obj.GetType()); 47 | } 48 | else if (type.IsClass) 49 | { 50 | object toret = Activator.CreateInstance(obj.GetType()); 51 | 52 | FieldInfo[] fields = type.GetFields(BindingFlags.Public | 53 | BindingFlags.NonPublic | BindingFlags.Instance); 54 | 55 | foreach (FieldInfo field in fields) 56 | { 57 | object fieldValue = field.GetValue(obj); 58 | if (fieldValue == null) 59 | continue; 60 | field.SetValue(toret, Process(fieldValue)); 61 | } 62 | return toret; 63 | } 64 | else 65 | throw new ArgumentException("Unknown type"); 66 | } 67 | 68 | } 69 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/Cloner.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf03ee2896b6c4405928daa0c5fe4556 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/CsvParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Text; 6 | 7 | namespace UnityQuickSheet 8 | { 9 | public enum TokenType 10 | { 11 | Comma, 12 | Quote, 13 | Value 14 | } 15 | 16 | public class Token 17 | { 18 | public Token(TokenType type, string value) 19 | { 20 | Value = value; 21 | Type = type; 22 | } 23 | 24 | public String Value { get; private set; } 25 | public TokenType Type { get; private set; } 26 | } 27 | 28 | public class StreamTokenizer : IEnumerable 29 | { 30 | private TextReader _reader; 31 | 32 | public StreamTokenizer(TextReader reader) 33 | { 34 | _reader = reader; 35 | } 36 | 37 | public IEnumerator GetEnumerator() 38 | { 39 | String line; 40 | StringBuilder value = new StringBuilder(); 41 | 42 | while ((line = _reader.ReadLine()) != null) 43 | { 44 | foreach (Char c in line) 45 | { 46 | switch (c) 47 | { 48 | case '\'': 49 | case '"': 50 | if (value.Length > 0) 51 | { 52 | yield return new Token(TokenType.Value, value.ToString()); 53 | value.Length = 0; 54 | } 55 | yield return new Token(TokenType.Quote, c.ToString()); 56 | break; 57 | case ',': 58 | if (value.Length > 0) 59 | { 60 | yield return new Token(TokenType.Value, value.ToString()); 61 | value.Length = 0; 62 | } 63 | yield return new Token(TokenType.Comma, c.ToString()); 64 | break; 65 | default: 66 | value.Append(c); 67 | break; 68 | } 69 | } 70 | } 71 | } 72 | 73 | IEnumerator IEnumerable.GetEnumerator() 74 | { 75 | return GetEnumerator(); 76 | } 77 | } 78 | 79 | public class CsvParser : IEnumerable 80 | { 81 | private StreamTokenizer _tokenizer; 82 | 83 | public CsvParser(Stream data) 84 | { 85 | _tokenizer = new StreamTokenizer(new StreamReader(data)); 86 | } 87 | 88 | public CsvParser(String data) 89 | { 90 | _tokenizer = new StreamTokenizer(new StringReader(data)); 91 | } 92 | 93 | public IEnumerator GetEnumerator() 94 | { 95 | Boolean inQuote = false; 96 | StringBuilder result = new StringBuilder(); 97 | 98 | foreach (Token token in _tokenizer) 99 | { 100 | switch (token.Type) 101 | { 102 | case TokenType.Comma: 103 | if (inQuote) 104 | { 105 | result.Append(token.Value); 106 | } 107 | else 108 | { 109 | yield return result.ToString(); 110 | result.Length = 0; 111 | } 112 | break; 113 | case TokenType.Quote: 114 | // Toggle quote state 115 | inQuote = !inQuote; 116 | break; 117 | case TokenType.Value: 118 | result.Append(token.Value); 119 | break; 120 | default: 121 | throw new InvalidOperationException("Unknown token type: " + token.Type); 122 | } 123 | } 124 | 125 | if (result.Length > 0) 126 | { 127 | yield return result.ToString(); 128 | } 129 | } 130 | 131 | IEnumerator IEnumerable.GetEnumerator() 132 | { 133 | return GetEnumerator(); 134 | } 135 | } 136 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/CsvParser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe76fe0a168db43adb5c342733fa1745 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/Singleton.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace UnityQuickSheet 4 | { 5 | /// 6 | /// Singleton base class. 7 | /// Derive this class to make it Singleton. 8 | /// 9 | public class Singleton : MonoBehaviour where T : MonoBehaviour 10 | { 11 | protected static T instance; 12 | 13 | /// 14 | /// Returns the instance of this singleton. 15 | /// 16 | public static T Instance 17 | { 18 | get 19 | { 20 | if (instance == null) 21 | { 22 | instance = (T)FindObjectOfType(typeof(T)); 23 | 24 | if (instance == null) 25 | { 26 | GameObject obj = new GameObject(typeof(T).ToString()); 27 | instance = obj.AddComponent(); 28 | //Debug.LogError("An instance of " + typeof(T) + 29 | // " is needed in the scene, but there is none."); 30 | } 31 | } 32 | return instance; 33 | } 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/Singleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 886ee090c5c5c4bf5b130c266f849a84 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/SingletonScriptableObject.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using UnityEditor; 3 | using UnityEngine; 4 | 5 | namespace UnityQuickSheet 6 | { 7 | /// 8 | /// Abstract class for making reload-proof singletons out of ScriptableObjects 9 | /// Returns the asset created on editor, null if there is none 10 | /// Based on https://www.youtube.com/watch?v=VBA1QCoEAX4 11 | /// 12 | /// See Also: 13 | /// blog page: http://baraujo.net/unity3d-making-singletons-from-scriptableobjects-automatically/ 14 | /// gist page: https://gist.github.com/baraujo/07bb162a1f916595cad1a2d1fee5e72d 15 | /// 16 | /// Type of the singleton 17 | 18 | public abstract class SingletonScriptableObject : ScriptableObject where T : ScriptableObject 19 | { 20 | static T _instance = null; 21 | public static T Instance 22 | { 23 | get 24 | { 25 | if (!_instance) 26 | { 27 | _instance = Resources.FindObjectsOfTypeAll().FirstOrDefault(); 28 | if (!_instance) 29 | { 30 | string filter = "t:" + typeof(T); 31 | var guids = AssetDatabase.FindAssets(filter); 32 | if (guids.Length > 0) 33 | { 34 | if (guids.Length > 1) 35 | Debug.LogWarningFormat("Multiple {0} assets are found.", typeof(T)); 36 | 37 | string assetPath = AssetDatabase.GUIDToAssetPath(guids[0]); 38 | Debug.LogFormat("Using {0}.", assetPath); 39 | _instance = AssetDatabase.LoadAssetAtPath(assetPath); 40 | } 41 | // no found any setting file. 42 | else 43 | { 44 | Debug.LogWarning("No instance of " + typeof(T).Name + " is loaded. Please create a " + typeof(T).Name + " asset file."); 45 | } 46 | } 47 | } 48 | return _instance; 49 | } 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/SingletonScriptableObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecd16231d21584a81a0d82c2ff5fe629 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/Util.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// Util.cs 4 | /// 5 | /// (c)2016 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using System; 9 | using System.Collections; 10 | using System.Linq; 11 | 12 | namespace UnityQuickSheet 13 | { 14 | public static class Util 15 | { 16 | //all c# keywords. 17 | public static string[] Keywords = new string[] { 18 | "abstract", "as", "base", "bool", "break", "byte", "case", "catch", "char", "checked", 19 | "class", "const", "continue", "decimal", "default", "delegate", "do", "double", "else", "enum", 20 | "event", "explicit", "extern", "false", "finally", "fixed", "float", "for", "foreach", "goto", 21 | "if", "implicit", "in", "in", "int", "interface", "internal", "is", "lock", "long", 22 | "namespace", "new", "null", "object", "operator", "out", "override", "params", "private", "protected", 23 | "public", "readonly", "ref", "return", "sbyte", "sealed", "short", "sizeof", "stackalloc", "static", 24 | "string", "struct", "switch", "this", "throw", "true", "try", "typeof", "uint", "ulong", "unchecked", "unsafe", 25 | "ushort", "using", "virtual", "void", "volatile", "while", 26 | }; 27 | 28 | } 29 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Editor/Util/Util.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1bfc32c6f139a62409180c6920a40b67 3 | timeCreated: 1470812588 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe271c66ff4064940b0b78b8e25d8c39 3 | folderAsset: yes 4 | timeCreated: 1512854213 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be828f35e46f2fa42985f419c7c93dc4 3 | folderAsset: yes 4 | timeCreated: 1512854229 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 843b56f361f99c441a791cdfd12b6865 3 | folderAsset: yes 4 | timeCreated: 1512854239 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Editor/ExcelExampleAssetPostProcessor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | using System.IO; 5 | using UnityQuickSheet; 6 | 7 | /// 8 | /// !!! Machine generated code !!! 9 | /// 10 | public class ExcelExampleAssetPostprocessor : AssetPostprocessor 11 | { 12 | private static readonly string filePath = "Assets/QuickSheet/Example/Excel/Example.xlsx"; 13 | private static readonly string assetFilePath = "Assets/QuickSheet/Example/Excel/ExcelExample.asset"; 14 | private static readonly string sheetName = "ExcelExample"; 15 | 16 | static void OnPostprocessAllAssets (string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) 17 | { 18 | foreach (string asset in importedAssets) 19 | { 20 | if (!filePath.Equals (asset)) 21 | continue; 22 | 23 | ExcelExample data = (ExcelExample)AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ExcelExample)); 24 | if (data == null) { 25 | data = ScriptableObject.CreateInstance (); 26 | data.SheetName = filePath; 27 | data.WorksheetName = sheetName; 28 | AssetDatabase.CreateAsset ((ScriptableObject)data, assetFilePath); 29 | //data.hideFlags = HideFlags.NotEditable; 30 | } 31 | 32 | //data.dataArray = new ExcelQuery(filePath, sheetName).Deserialize().ToArray(); 33 | 34 | //ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject; 35 | //EditorUtility.SetDirty (obj); 36 | 37 | ExcelQuery query = new ExcelQuery(filePath, sheetName); 38 | if (query != null && query.IsValid()) 39 | { 40 | data.dataArray = query.Deserialize().ToArray(); 41 | ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject; 42 | EditorUtility.SetDirty (obj); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Editor/ExcelExampleAssetPostProcessor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6a602957ca260442b488b8a703f5f65 3 | timeCreated: 1512854560 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Editor/ExcelExampleEditor.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.IO; 7 | using UnityQuickSheet; 8 | 9 | /// 10 | /// !!! Machine generated code !!! 11 | /// 12 | [CustomEditor(typeof(ExcelExample))] 13 | public class ExcelExampleEditor : BaseExcelEditor 14 | { 15 | public override bool Load() 16 | { 17 | ExcelExample targetData = target as ExcelExample; 18 | 19 | string path = targetData.SheetName; 20 | if (!File.Exists(path)) 21 | return false; 22 | 23 | string sheet = targetData.WorksheetName; 24 | 25 | ExcelQuery query = new ExcelQuery(path, sheet); 26 | if (query != null && query.IsValid()) 27 | { 28 | targetData.dataArray = query.Deserialize().ToArray(); 29 | EditorUtility.SetDirty(targetData); 30 | AssetDatabase.SaveAssets(); 31 | return true; 32 | } 33 | else 34 | return false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Editor/ExcelExampleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 818106cc5aadb41468c2994c498a0892 3 | timeCreated: 1512854560 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7e20f13eb513fb649b7f75ec25f20c60 3 | folderAsset: yes 4 | timeCreated: 1512854245 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Runtime/ExcelExample.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// !!! Machine generated code !!! 8 | /// 9 | /// A class which deriveds ScritableObject class so all its data 10 | /// can be serialized onto an asset data file. 11 | /// 12 | [System.Serializable] 13 | public class ExcelExample : ScriptableObject 14 | { 15 | [HideInInspector] [SerializeField] 16 | public string SheetName = ""; 17 | 18 | [HideInInspector] [SerializeField] 19 | public string WorksheetName = ""; 20 | 21 | // Note: initialize in OnEnable() not here. 22 | public ExcelExampleData[] dataArray; 23 | 24 | void OnEnable() 25 | { 26 | //#if UNITY_EDITOR 27 | //hideFlags = HideFlags.DontSave; 28 | //#endif 29 | // Important: 30 | // It should be checked an initialization of any collection data before it is initialized. 31 | // Without this check, the array collection which already has its data get to be null 32 | // because OnEnable is called whenever Unity builds. 33 | // 34 | if (dataArray == null) 35 | dataArray = new ExcelExampleData[0]; 36 | 37 | } 38 | 39 | // 40 | // Highly recommand to use LINQ to query the data sources. 41 | // 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Runtime/ExcelExample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98fce3204d7cbc64c930d2c915a49615 3 | timeCreated: 1512854560 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Runtime/ExcelExampleData.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// !!! Machine generated code !!! 6 | /// !!! DO NOT CHANGE Tabs to Spaces !!! 7 | /// 8 | [System.Serializable] 9 | public class ExcelExampleData 10 | { 11 | [SerializeField] 12 | int id; 13 | public int Id { get {return id; } set { id = value;} } 14 | 15 | [SerializeField] 16 | string name; 17 | public string Name { get {return name; } set { name = value;} } 18 | 19 | [SerializeField] 20 | float strength; 21 | public float Strength { get {return strength; } set { strength = value;} } 22 | 23 | [SerializeField] 24 | Difficulty difficulty; 25 | public Difficulty DIFFICULTY { get {return difficulty; } set { difficulty = value;} } 26 | 27 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Data/Runtime/ExcelExampleData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d403397c1c2da54cb61eaff5f1e15ce 3 | timeCreated: 1512854560 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Difficulty.cs: -------------------------------------------------------------------------------- 1 | public enum Difficulty 2 | { 3 | Easy, 4 | Medium, 5 | Hard 6 | } 7 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Difficulty.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e89a4433b6ad151459577225f65aa701 3 | timeCreated: 1508690877 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Excel.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 409a0f119fa96764c9fa8ff364a181ca 3 | folderAsset: yes 4 | timeCreated: 1512854221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Excel/Example.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/Example/Excel/Example.xlsx -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Excel/Example.xlsx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f6eae8b7d6c62d4da61af7a8e8f1f58 3 | timeCreated: 1508690747 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Excel/ExcelExample.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 98fce3204d7cbc64c930d2c915a49615, type: 3} 12 | m_Name: ExcelExample 13 | m_EditorClassIdentifier: 14 | SheetName: Assets/QuickSheet/Example/Excel/Example.xlsx 15 | WorksheetName: ExcelExample 16 | dataArray: 17 | - id: 0 18 | name: Goblin 19 | strength: 5 20 | difficulty: 0 21 | - id: 1 22 | name: Wolf 23 | strength: 5 24 | difficulty: 0 25 | - id: 2 26 | name: Scavanger 27 | strength: 7 28 | difficulty: 0 29 | - id: 3 30 | name: Lurker 31 | strength: 9 32 | difficulty: 0 33 | - id: 4 34 | name: Sceleton 35 | strength: 11 36 | difficulty: 1 37 | - id: 5 38 | name: Ghost 39 | strength: 13 40 | difficulty: 1 41 | - id: 6 42 | name: Orc 43 | strength: 15 44 | difficulty: 1 45 | - id: 7 46 | name: Hydra 47 | strength: 17 48 | difficulty: 2 49 | - id: 8 50 | name: Undead 51 | strength: 19 52 | difficulty: 2 53 | - id: 9 54 | name: Dragon 55 | strength: 21 56 | difficulty: 2 57 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/Excel/ExcelExample.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a7cf3542b7d5ab4b9d7efe34416a0e2 3 | timeCreated: 1512854607 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/ExcelExampleImporter.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &11400000 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_GameObject: {fileID: 0} 9 | m_Enabled: 1 10 | m_EditorHideFlags: 0 11 | m_Script: {fileID: 11500000, guid: 80e14a72067f1ad408ec8d661bc560ce, type: 3} 12 | m_Name: ExcelExampleImporter 13 | m_EditorClassIdentifier: 14 | templatePath: QuickSheet/ExcelPlugin/Templates 15 | scriptFilePath: QuickSheet/Example/Data/Runtime 16 | editorScriptFilePath: QuickSheet/Example/Data/Editor 17 | sheetName: Example.xlsx 18 | workSheetName: ExcelExample 19 | columnHeaderList: 20 | - type: 3 21 | name: Id 22 | isEnable: 0 23 | isArray: 0 24 | - type: 1 25 | name: Name 26 | isEnable: 0 27 | isArray: 0 28 | - type: 5 29 | name: Strength 30 | isEnable: 0 31 | isArray: 0 32 | - type: 7 33 | name: Difficulty 34 | isEnable: 0 35 | isArray: 0 36 | excelFilePath: Assets/QuickSheet/Example/Excel/Example.xlsx 37 | SheetNames: 38 | - ExcelExample 39 | currentSelectedSheet: 0 40 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Example/ExcelExampleImporter.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e52f89862cdefc4f84f7e542e70ccf9 3 | timeCreated: 1508692537 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 11400000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2fe98f308b38e6741be720eef4d4a3f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1eb608d418127cc48a0f4573d1c2c5d8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/BaseExcelEditor.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// BaseExelEditor.cs 4 | /// 5 | /// (c)2014 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | using System.IO; 13 | 14 | namespace UnityQuickSheet 15 | { 16 | /// 17 | /// Base class of .asset ScriptableObject class created from excel. 18 | /// 19 | public class BaseExcelEditor : BaseEditor where T : ScriptableObject 20 | { 21 | public override void OnEnable() 22 | { 23 | base.OnEnable(); 24 | } 25 | 26 | /// 27 | /// Draw Inspector view. 28 | /// 29 | public override void OnInspectorGUI() 30 | { 31 | if (target == null) 32 | return; 33 | 34 | // Update SerializedObject 35 | targetObject.Update(); 36 | 37 | if (GUILayout.Button("Update")) 38 | { 39 | if (!Load()) 40 | { 41 | const string error1 = "\n- Check the path of the 'Sheet Name' and the file is exist at the path."; 42 | const string error2 = "\n- Also check the excel file has the sheet which matches with 'Worksheet Name'."; 43 | EditorUtility.DisplayDialog( 44 | "Error", 45 | "Failed to import and update the excel file." + error1 + error2, 46 | "OK" 47 | ); 48 | } 49 | } 50 | 51 | EditorGUILayout.Separator(); 52 | 53 | DrawInspector(); 54 | 55 | // Be sure to call [your serialized object].ApplyModifiedProperties()to save any changes. 56 | targetObject.ApplyModifiedProperties(); 57 | } 58 | 59 | 60 | } 61 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/BaseExcelEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd215185f1b0ad8459b0b4fcc56bc2e6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Excel Settings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/ExcelPlugin/Editor/Excel Settings.asset -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Excel Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f37cda8add312d644bf1272f72d0ad61 3 | timeCreated: 1500383140 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// ExcelMachine.cs 4 | /// 5 | /// (c)2014 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | 12 | namespace UnityQuickSheet 13 | { 14 | /// 15 | /// A class for various setting to read excel file and generated related script files. 16 | /// 17 | internal class ExcelMachine : BaseMachine 18 | { 19 | /// 20 | /// where the .xls or .xlsx file is. The path should start with "Assets/". 21 | /// 22 | public string excelFilePath; 23 | 24 | // both are needed for popup editor control. 25 | public string[] SheetNames = { "" }; 26 | public int CurrentSheetIndex 27 | { 28 | get { return currentSelectedSheet; } 29 | set { currentSelectedSheet = value;} 30 | } 31 | 32 | [SerializeField] 33 | protected int currentSelectedSheet = 0; 34 | 35 | 36 | /// 37 | /// Note: Called when the asset file is created. 38 | /// 39 | 40 | private void Awake() { 41 | if (ExcelSettings.Instance != null) 42 | { 43 | // excel and google plugin have its own template files, 44 | // so we need to set the different path when the asset file is created. 45 | TemplatePath = ExcelSettings.Instance.TemplatePath; 46 | } 47 | } 48 | 49 | /// 50 | /// A menu item which create a 'ExcelMachine' asset file. 51 | /// 52 | [MenuItem("Assets/Create/QuickSheet/Tools/Excel")] 53 | public static void CreateScriptMachineAsset() 54 | { 55 | ExcelMachine inst = ScriptableObject.CreateInstance(); 56 | string path = CustomAssetUtility.GetUniqueAssetPathNameOrFallback(ImportSettingFilename); 57 | AssetDatabase.CreateAsset(inst, path); 58 | AssetDatabase.SaveAssets(); 59 | Selection.activeObject = inst; 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80e14a72067f1ad408ec8d661bc560ce 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelMachineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c724df26e0fe9ef48bb1422df293a448 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelQuery.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6af18c516040aad44babf30651b99b4f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettings.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// ExcelSettings.cs 4 | /// 5 | /// (c)2015 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | using System.IO; 12 | 13 | namespace UnityQuickSheet 14 | { 15 | /// 16 | /// A class manages excel setting. 17 | /// 18 | [CreateAssetMenu(menuName = "QuickSheet/Setting/Excel Setting")] 19 | public class ExcelSettings : SingletonScriptableObject 20 | { 21 | /// 22 | /// A default path where .txt template files are. 23 | /// 24 | public string TemplatePath = "QuickSheet/ExcelPlugin/Templates"; 25 | 26 | /// 27 | /// A path where generated ScriptableObject derived class and its data class script files are to be put. 28 | /// 29 | public string RuntimePath = string.Empty; 30 | 31 | /// 32 | /// A path where generated editor script files are to be put. 33 | /// 34 | public string EditorPath = string.Empty; 35 | 36 | /// 37 | /// Select currently exist account setting asset file. 38 | /// 39 | [MenuItem("Edit/QuickSheet/Select Excel Setting")] 40 | public static void Edit() 41 | { 42 | Selection.activeObject = Instance; 43 | if (Selection.activeObject == null) 44 | { 45 | Debug.LogError(@"No ExcelSetting.asset file is found. Create setting file first. See the menu at 'Create/QuickSheet/Setting/Excel Setting'."); 46 | } 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a7f75662a54ccdd4fac555acce15d166 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettingsEditor.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// ExcelSettingsEditor.cs 4 | /// 5 | /// (c)2015 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | 12 | namespace UnityQuickSheet 13 | { 14 | /// 15 | /// Editor script class for ExcelSettings scriptable object to hide password of google account. 16 | /// 17 | [CustomEditor(typeof(ExcelSettings))] 18 | public class ExcelSettingsEditor : Editor 19 | { 20 | public void OnEnable() 21 | { 22 | 23 | } 24 | 25 | public override void OnInspectorGUI() 26 | { 27 | GUI.changed = false; 28 | GUIStyle headerStyle = GUIHelper.MakeHeader(); 29 | GUILayout.Label("Excel Settings", headerStyle); 30 | 31 | EditorGUILayout.Separator(); 32 | 33 | GUILayout.BeginHorizontal(); 34 | GUILayout.Label("Template Path: ", GUILayout.Width(100)); 35 | ExcelSettings.Instance.TemplatePath = GUILayout.TextField(ExcelSettings.Instance.TemplatePath); 36 | GUILayout.EndHorizontal(); 37 | 38 | EditorGUILayout.Separator(); 39 | 40 | GUILayout.BeginHorizontal(); 41 | GUILayout.Label("Runtime Path: ", GUILayout.Width(100)); 42 | ExcelSettings.Instance.RuntimePath = GUILayout.TextField(ExcelSettings.Instance.RuntimePath); 43 | GUILayout.EndHorizontal(); 44 | 45 | GUILayout.BeginHorizontal(); 46 | GUILayout.Label("Editor Path: ", GUILayout.Width(100)); 47 | ExcelSettings.Instance.EditorPath = GUILayout.TextField(ExcelSettings.Instance.EditorPath); 48 | GUILayout.EndHorizontal(); 49 | 50 | if (GUI.changed) 51 | { 52 | EditorUtility.SetDirty(ExcelSettings.Instance); 53 | } 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/ExcelSettingsEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d88c27acbf4b93c4c8930fb3f35fbe9a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 043dc3bacaef34f44b32f31d5737bc44 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/ICSharpCode.SharpZipLib.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/ExcelPlugin/Editor/Library/ICSharpCode.SharpZipLib.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/ICSharpCode.SharpZipLib.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a0fbb4eb4896fb44836fb6ae8e970dd 3 | timeCreated: 1471838689 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.2.1.1.txt: -------------------------------------------------------------------------------- 1 | 2 | NPOI 2.1.1 can be downloaded from: 3 | https://npoi.codeplex.com/releases 4 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.2.1.1.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba8a3ef3ac56408498ad3100fe023dac 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OOXML.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OOXML.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OOXML.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9278fe8b67c3b848b05757659433352 3 | timeCreated: 1471838690 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OpenXml4Net.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OpenXml4Net.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OpenXml4Net.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e6402d22292d0a42b758fe18f47ea50 3 | timeCreated: 1471838689 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OpenXmlFormats.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OpenXmlFormats.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.OpenXmlFormats.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ecaa78485aa8c5140b1f1d3d1ea2002f 3 | timeCreated: 1471838694 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.XML.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 373b304eeee999f4da60927a3fdd4412 3 | timeCreated: 1471838694 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/NPOI.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 764d3180c4b450d41875dd478452cd42 3 | timeCreated: 1471838690 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Editor/Library/Release Notes.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f4ada1ca630e4d44a3e22f1f76d6fb8 3 | timeCreated: 1471841227 4 | licenseType: Pro 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: afb1f0a2da9be7c4abaaa51fae9c5a01 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/DataClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// !!! Machine generated code !!! 6 | /// !!! DO NOT CHANGE Tabs to Spaces !!! 7 | /// 8 | [System.Serializable] 9 | public class $ClassName 10 | { 11 | $MemberFields 12 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/DataClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be8b7e4e044e09546b0ac782828fdff7 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/PostProcessor.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | using System.IO; 5 | using UnityQuickSheet; 6 | 7 | /// 8 | /// !!! Machine generated code !!! 9 | /// 10 | public class $AssetPostprocessorClass : AssetPostprocessor 11 | { 12 | private static readonly string filePath = "$IMPORT_PATH"; 13 | private static readonly string assetFilePath = "$ASSET_PATH"; 14 | private static readonly string sheetName = "$ClassName"; 15 | 16 | static void OnPostprocessAllAssets (string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) 17 | { 18 | foreach (string asset in importedAssets) 19 | { 20 | if (!filePath.Equals (asset)) 21 | continue; 22 | 23 | $ClassName data = ($ClassName)AssetDatabase.LoadAssetAtPath (assetFilePath, typeof($ClassName)); 24 | if (data == null) { 25 | data = ScriptableObject.CreateInstance<$ClassName> (); 26 | data.SheetName = filePath; 27 | data.WorksheetName = sheetName; 28 | AssetDatabase.CreateAsset ((ScriptableObject)data, assetFilePath); 29 | //data.hideFlags = HideFlags.NotEditable; 30 | } 31 | 32 | //data.dataArray = new ExcelQuery(filePath, sheetName).Deserialize<$DataClassName>().ToArray(); 33 | 34 | //ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject; 35 | //EditorUtility.SetDirty (obj); 36 | 37 | ExcelQuery query = new ExcelQuery(filePath, sheetName); 38 | if (query != null && query.IsValid()) 39 | { 40 | data.dataArray = query.Deserialize<$DataClassName>().ToArray(); 41 | ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject; 42 | EditorUtility.SetDirty (obj); 43 | } 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/PostProcessor.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27c6dd4a148ab7441ac733fcdb71f072 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/ScriptableObjectClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// !!! Machine generated code !!! 8 | /// 9 | /// A class which deriveds ScritableObject class so all its data 10 | /// can be serialized onto an asset data file. 11 | /// 12 | [System.Serializable] 13 | public class $ClassName : ScriptableObject 14 | { 15 | [HideInInspector] [SerializeField] 16 | public string SheetName = ""; 17 | 18 | [HideInInspector] [SerializeField] 19 | public string WorksheetName = ""; 20 | 21 | // Note: initialize in OnEnable() not here. 22 | public $DataClassName[] dataArray; 23 | 24 | void OnEnable() 25 | { 26 | //#if UNITY_EDITOR 27 | //hideFlags = HideFlags.DontSave; 28 | //#endif 29 | // Important: 30 | // It should be checked an initialization of any collection data before it is initialized. 31 | // Without this check, the array collection which already has its data get to be null 32 | // because OnEnable is called whenever Unity builds. 33 | // 34 | if (dataArray == null) 35 | dataArray = new $DataClassName[0]; 36 | 37 | } 38 | 39 | // 40 | // Highly recommand to use LINQ to query the data sources. 41 | // 42 | 43 | } 44 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/ScriptableObjectClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ab22a6a786af6949b92b3b8b7cc3272 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/ScriptableObjectEditorClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | using System.IO; 7 | using UnityQuickSheet; 8 | 9 | /// 10 | /// !!! Machine generated code !!! 11 | /// 12 | [CustomEditor(typeof($WorkSheetClassName))] 13 | public class $ClassName : BaseExcelEditor<$WorkSheetClassName> 14 | { 15 | public override bool Load() 16 | { 17 | $WorkSheetClassName targetData = target as $WorkSheetClassName; 18 | 19 | string path = targetData.SheetName; 20 | if (!File.Exists(path)) 21 | return false; 22 | 23 | string sheet = targetData.WorksheetName; 24 | 25 | ExcelQuery query = new ExcelQuery(path, sheet); 26 | if (query != null && query.IsValid()) 27 | { 28 | targetData.dataArray = query.Deserialize<$DataClassName>().ToArray(); 29 | EditorUtility.SetDirty(targetData); 30 | AssetDatabase.SaveAssets(); 31 | return true; 32 | } 33 | else 34 | return false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Assets/QuickSheet/ExcelPlugin/Templates/ScriptableObjectEditorClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c19da9ea30a40f44193d094106cfa028 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb1ad8bb60899ff4291e33ba664f772b 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 678670a4c37ec654086812049cab4f15 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/BaseGoogleEditor.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// BaseGoogleEditor.cs 4 | /// 5 | /// (c)2013 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | 11 | using System; 12 | using System.Collections; 13 | using System.Collections.Generic; 14 | using System.Reflection; 15 | using System.Text; 16 | using System.Text.RegularExpressions; 17 | 18 | // to resolve TlsException error. 19 | using System.Net; 20 | using System.Net.Security; 21 | using System.Security.Cryptography.X509Certificates; 22 | 23 | using Google.GData.Client; 24 | using Google.GData.Spreadsheets; 25 | 26 | namespace UnityQuickSheet 27 | { 28 | /// 29 | /// Base class of .asset ScriptableObject class created from google spreadsheet. 30 | /// 31 | public class BaseGoogleEditor : BaseEditor where T : ScriptableObject 32 | { 33 | /// 34 | /// Actively ignore security concerns to resolve TlsException error. 35 | /// 36 | /// See: http://www.mono-project.com/UsingTrustedRootsRespectfully 37 | /// 38 | public static bool Validator(object sender, X509Certificate certificate, X509Chain chain, 39 | SslPolicyErrors sslPolicyErrors) 40 | { 41 | return true; 42 | } 43 | 44 | public override void OnEnable() 45 | { 46 | base.OnEnable(); 47 | 48 | // resolves TlsException error 49 | ServicePointManager.ServerCertificateValidationCallback = Validator; 50 | 51 | GoogleDataSettings settings = GoogleDataSettings.Instance; 52 | if (settings != null) 53 | { 54 | if (string.IsNullOrEmpty(settings.OAuth2Data.client_id) || 55 | string.IsNullOrEmpty(settings.OAuth2Data.client_secret)) 56 | Debug.LogWarning("Client_ID and Client_Sceret is empty. Reload .json file."); 57 | 58 | if (string.IsNullOrEmpty(settings._AccessCode)) 59 | Debug.LogWarning("AccessCode is empty. Redo authenticate again."); 60 | } 61 | else 62 | { 63 | Debug.LogError("Failed to get google data settings. See the google data setting if it has correct path."); 64 | return; 65 | } 66 | } 67 | 68 | /// 69 | /// Draw Inspector view. 70 | /// 71 | public override void OnInspectorGUI() 72 | { 73 | if (target == null) 74 | return; 75 | 76 | // Update SerializedObject 77 | targetObject.Update(); 78 | 79 | if (GUILayout.Button("Download")) 80 | { 81 | if (!Load()) 82 | Debug.LogError("Failed to Load data from Google."); 83 | } 84 | 85 | EditorGUILayout.Separator(); 86 | 87 | DrawInspector(); 88 | 89 | // Be sure to call [your serialized object].ApplyModifiedProperties()to save any changes. 90 | targetObject.ApplyModifiedProperties(); 91 | } 92 | 93 | 94 | protected List SetArrayValue(string from) 95 | { 96 | List tmp = new List(); 97 | 98 | CsvParser parser = new CsvParser(from); 99 | 100 | foreach (string s in parser) 101 | { 102 | Debug.Log("parsed value: " + s); 103 | tmp.Add(int.Parse(s)); 104 | } 105 | 106 | return tmp; 107 | } 108 | 109 | /* 110 | static string[] SplitCamelCase(string stringToSplit) 111 | { 112 | if (!string.IsNullOrEmpty(stringToSplit)) 113 | { 114 | List words = new List(); 115 | 116 | string temp = string.Empty; 117 | 118 | foreach (char ch in stringToSplit) 119 | { 120 | if (ch >= 'a' && ch <= 'z') 121 | temp = temp + ch; 122 | else 123 | { 124 | words.Add(temp); 125 | temp = string.Empty + ch; 126 | } 127 | } 128 | words.Add(temp); 129 | return words.ToArray(); 130 | } 131 | else 132 | return null; 133 | } 134 | */ 135 | 136 | public static string SplitCamelCase(string inputCamelCaseString) 137 | { 138 | string sTemp = Regex.Replace(inputCamelCaseString, "([A-Z][a-z])", " $1", RegexOptions.Compiled).Trim(); 139 | return Regex.Replace(sTemp, "([A-Z][A-Z])", " $1", RegexOptions.Compiled).Trim(); 140 | } 141 | } 142 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/BaseGoogleEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7c777716001d4344fb8f86ecb4a409f9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492f8b7e773bb0e4c8e92cc6247864b8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1a3c4afa7ccf34c489fa94b4fb6713ac 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/ITableExtensions.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using GDataDB.Linq.Impl; 3 | 4 | namespace GDataDB.Linq { 5 | public static class ITableExtensions { 6 | public static IQueryable AsQueryable(this ITable t) { 7 | return new Query(new GDataDBQueryProvider(t)); 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/ITableExtensions.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90a07b2287ae2704b819ec2cc81efdf9 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36477663dcce48f4bbc69b6c7eb228a9 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/Evaluator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq.Expressions; 4 | 5 | namespace GDataDB.Linq.Impl { 6 | /// 7 | /// From http://blogs.msdn.com/mattwar/archive/2007/08/01/linq-building-an-iqueryable-provider-part-iii.aspx 8 | /// 9 | public static class Evaluator { 10 | /// 11 | /// Performs evaluation & replacement of independent sub-trees 12 | /// 13 | /// The root of the expression tree. 14 | /// A function that decides whether a given expression node can be part of the local function. 15 | /// A new tree with sub-trees evaluated and replaced. 16 | public static Expression PartialEval(Expression expression, Func fnCanBeEvaluated) { 17 | return new SubtreeEvaluator(new Nominator(fnCanBeEvaluated).Nominate(expression)).Eval(expression); 18 | } 19 | 20 | 21 | /// 22 | /// Performs evaluation & replacement of independent sub-trees 23 | /// 24 | /// The root of the expression tree. 25 | /// A new tree with sub-trees evaluated and replaced. 26 | public static Expression PartialEval(Expression expression) { 27 | return PartialEval(expression, CanBeEvaluatedLocally); 28 | } 29 | 30 | 31 | private static bool CanBeEvaluatedLocally(Expression expression) { 32 | return expression.NodeType != ExpressionType.Parameter; 33 | } 34 | 35 | 36 | /// 37 | /// Evaluates & replaces sub-trees when first candidate is reached (top-down) 38 | /// 39 | private class SubtreeEvaluator : ExpressionVisitor { 40 | private readonly HashSet candidates; 41 | 42 | 43 | internal SubtreeEvaluator(HashSet candidates) { 44 | this.candidates = candidates; 45 | } 46 | 47 | 48 | internal Expression Eval(Expression exp) { 49 | return Visit(exp); 50 | } 51 | 52 | 53 | protected override Expression Visit(Expression exp) { 54 | if (exp == null) { 55 | return null; 56 | } 57 | 58 | if (candidates.Contains(exp)) { 59 | return Evaluate(exp); 60 | } 61 | 62 | return base.Visit(exp); 63 | } 64 | 65 | 66 | private Expression Evaluate(Expression e) { 67 | if (e.NodeType == ExpressionType.Constant) { 68 | return e; 69 | } 70 | 71 | LambdaExpression lambda = Expression.Lambda(e); 72 | 73 | Delegate fn = lambda.Compile(); 74 | 75 | return Expression.Constant(fn.DynamicInvoke(null), e.Type); 76 | } 77 | } 78 | 79 | 80 | /// 81 | /// Performs bottom-up analysis to determine which nodes can possibly 82 | /// be part of an evaluated sub-tree. 83 | /// 84 | private class Nominator : ExpressionVisitor { 85 | private readonly Func fnCanBeEvaluated; 86 | 87 | private HashSet candidates; 88 | 89 | private bool cannotBeEvaluated; 90 | 91 | 92 | internal Nominator(Func fnCanBeEvaluated) { 93 | this.fnCanBeEvaluated = fnCanBeEvaluated; 94 | } 95 | 96 | 97 | internal HashSet Nominate(Expression expression) { 98 | candidates = new HashSet(); 99 | 100 | Visit(expression); 101 | 102 | return candidates; 103 | } 104 | 105 | 106 | protected override Expression Visit(Expression expression) { 107 | if (expression != null) { 108 | bool saveCannotBeEvaluated = cannotBeEvaluated; 109 | 110 | cannotBeEvaluated = false; 111 | 112 | base.Visit(expression); 113 | 114 | if (!cannotBeEvaluated) { 115 | if (fnCanBeEvaluated(expression)) { 116 | candidates.Add(expression); 117 | } else { 118 | cannotBeEvaluated = true; 119 | } 120 | } 121 | 122 | cannotBeEvaluated |= saveCannotBeEvaluated; 123 | } 124 | 125 | return expression; 126 | } 127 | } 128 | } 129 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/Evaluator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8635fe0a4000f443b99bb53511be362 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/ExpressionVisitor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 030656e318dbfb4449beeb183afaff14 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/GDataDBQueryProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Linq.Expressions; 4 | 5 | namespace GDataDB.Linq.Impl { 6 | public class GDataDBQueryProvider : QueryProvider { 7 | private readonly ITable table; 8 | 9 | public GDataDBQueryProvider(ITable table) { 10 | this.table = table; 11 | } 12 | 13 | public override Query GetQuery(Expression expression) { 14 | expression = Evaluator.PartialEval(expression); 15 | return new QueryTranslator().Translate(expression); 16 | } 17 | 18 | public override object Execute(Expression expression) { 19 | return table.Find(GetQuery(expression)).Select(r => r.Element); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/GDataDBQueryProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 831d896026dfa2d42bc58cf9230d1623 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/OrderTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace GDataDB.Linq.Impl { 5 | public class OrderTranslator : ExpressionVisitor { 6 | private string columnName; 7 | private bool descending; 8 | 9 | public Order Translate(Expression e) { 10 | Visit(e); 11 | if (columnName == null) 12 | return null; 13 | return new Order {ColumnName = columnName, Descending = descending}; 14 | } 15 | 16 | protected override Expression VisitMethodCall(MethodCallExpression m) { 17 | if (m.Arguments.Count > 2) 18 | throw new NotSupportedException("OrderBy with comparer is not supported"); 19 | if (m.Method.Name == "OrderBy") { 20 | Visit(m.Arguments[1]); 21 | } else if (m.Method.Name == "OrderByDescending") { 22 | descending = true; 23 | Visit(m.Arguments[1]); 24 | } 25 | return m; 26 | } 27 | 28 | protected override Expression VisitMemberAccess(MemberExpression m) { 29 | columnName = m.Member.Name.ToLowerInvariant(); 30 | return m; 31 | } 32 | } 33 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/OrderTranslator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9315c8544cfd7d47b2d9c05e3e21a4c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/Query.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Linq; 5 | using System.Linq.Expressions; 6 | 7 | namespace GDataDB.Linq.Impl { 8 | /// 9 | /// From http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx 10 | /// 11 | /// 12 | public class Query : IOrderedQueryable { 13 | private readonly QueryProvider provider; 14 | private readonly Expression expression; 15 | 16 | public Query(QueryProvider provider) { 17 | if (provider == null) { 18 | throw new ArgumentNullException("provider"); 19 | } 20 | this.provider = provider; 21 | expression = Expression.Constant(this); 22 | } 23 | 24 | public Query(QueryProvider provider, Expression expression) { 25 | if (provider == null) { 26 | throw new ArgumentNullException("provider"); 27 | } 28 | if (expression == null) { 29 | throw new ArgumentNullException("expression"); 30 | } 31 | if (!typeof (IQueryable).IsAssignableFrom(expression.Type)) { 32 | throw new ArgumentOutOfRangeException("expression"); 33 | } 34 | this.provider = provider; 35 | this.expression = expression; 36 | } 37 | 38 | Expression IQueryable.Expression { 39 | get { return expression; } 40 | } 41 | 42 | Type IQueryable.ElementType { 43 | get { return typeof (T); } 44 | } 45 | 46 | IQueryProvider IQueryable.Provider { 47 | get { return provider; } 48 | } 49 | 50 | public IEnumerator GetEnumerator() { 51 | return ((IEnumerable) provider.Execute(expression)).GetEnumerator(); 52 | } 53 | 54 | public override string ToString() { 55 | return ToQuery().StructuredQuery; 56 | } 57 | 58 | public Query ToQuery() { 59 | return provider.GetQuery(expression); 60 | } 61 | 62 | IEnumerator IEnumerable.GetEnumerator() { 63 | return GetEnumerator(); 64 | } 65 | } 66 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/Query.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b857a749f3f8abe479f871282ec93b54 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/QueryProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq; 3 | using System.Linq.Expressions; 4 | using System.Reflection; 5 | 6 | namespace GDataDB.Linq.Impl { 7 | /// 8 | /// From http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx 9 | /// 10 | public abstract class QueryProvider : IQueryProvider { 11 | IQueryable IQueryProvider.CreateQuery(Expression expression) { 12 | return new Query(this, expression); 13 | } 14 | 15 | IQueryable IQueryProvider.CreateQuery(Expression expression) { 16 | Type elementType = TypeSystem.GetElementType(expression.Type); 17 | try { 18 | return (IQueryable) Activator.CreateInstance(typeof (Query<>).MakeGenericType(elementType), new object[] {this, expression}); 19 | } catch (TargetInvocationException tie) { 20 | throw tie.InnerException; 21 | } 22 | } 23 | 24 | public abstract Query GetQuery(Expression expression); 25 | public abstract object Execute(Expression expression); 26 | 27 | public TResult Execute(Expression expression) { 28 | return (TResult) Execute(expression); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/QueryProvider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fe654ace6ed829945aee55341081a4be 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/QueryTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | 4 | namespace GDataDB.Linq.Impl { 5 | public class QueryTranslator : ExpressionVisitor { 6 | private readonly Query q = new Query(); 7 | 8 | public Query Translate(Expression e) { 9 | Visit(e); 10 | return q; 11 | } 12 | 13 | protected override Expression VisitMethodCall(MethodCallExpression m) { 14 | Visit(m.Arguments[0]); 15 | switch (m.Method.Name) { 16 | case "Where": 17 | q.StructuredQuery = new WhereTranslator().Translate(m); 18 | break; 19 | case "OrderBy": 20 | case "OrderByDescending": 21 | q.Order = new OrderTranslator().Translate(m); 22 | break; 23 | case "Take": 24 | q.Count = (int)((ConstantExpression)m.Arguments[1]).Value; 25 | break; 26 | case "Skip": 27 | q.Start = (int)((ConstantExpression)m.Arguments[1]).Value+1; 28 | break; 29 | default: 30 | throw new NotSupportedException(string.Format("Method {0} not supported", m.Method.Name)); 31 | } 32 | return m; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/QueryTranslator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6346ed16102761e44a61b1af87d23411 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/TypeSystem.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace GDataDB.Linq.Impl { 5 | /// 6 | /// From http://blogs.msdn.com/mattwar/archive/2007/07/30/linq-building-an-iqueryable-provider-part-i.aspx 7 | /// 8 | internal static class TypeSystem { 9 | internal static Type GetElementType(Type seqType) { 10 | Type ienum = FindIEnumerable(seqType); 11 | if (ienum == null) return seqType; 12 | return ienum.GetGenericArguments()[0]; 13 | } 14 | 15 | private static Type FindIEnumerable(Type seqType) { 16 | if (seqType == null || seqType == typeof (string)) 17 | return null; 18 | if (seqType.IsArray) 19 | return typeof (IEnumerable<>).MakeGenericType(seqType.GetElementType()); 20 | if (seqType.IsGenericType) { 21 | foreach (var arg in seqType.GetGenericArguments()) { 22 | Type ienum = typeof (IEnumerable<>).MakeGenericType(arg); 23 | if (ienum.IsAssignableFrom(seqType)) { 24 | return ienum; 25 | } 26 | } 27 | } 28 | Type[] ifaces = seqType.GetInterfaces(); 29 | if (ifaces != null && ifaces.Length > 0) { 30 | foreach (var iface in ifaces) { 31 | Type ienum = FindIEnumerable(iface); 32 | if (ienum != null) return ienum; 33 | } 34 | } 35 | if (seqType.BaseType != null && seqType.BaseType != typeof (object)) { 36 | return FindIEnumerable(seqType.BaseType); 37 | } 38 | return null; 39 | } 40 | } 41 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/TypeSystem.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8e26069c93b57642bb916f9a2eb3783 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/WhereTranslator.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Linq.Expressions; 3 | using System.Text; 4 | 5 | namespace GDataDB.Linq.Impl { 6 | public class WhereTranslator : ExpressionVisitor { 7 | private readonly StringBuilder sb = new StringBuilder(); 8 | 9 | public string Translate(Expression e) { 10 | Visit(e); 11 | return sb.ToString(); 12 | } 13 | 14 | protected override Expression VisitMethodCall(MethodCallExpression m) { 15 | if (m.Method.Name == "Where") { 16 | Visit(m.Arguments[1]); 17 | } 18 | return m; 19 | } 20 | 21 | protected override Expression VisitBinary(BinaryExpression b) { 22 | sb.Append("("); 23 | switch (b.NodeType) { 24 | case ExpressionType.And: 25 | case ExpressionType.AndAlso: 26 | Visit(b.Left); 27 | sb.Append("&&"); 28 | Visit(b.Right); 29 | break; 30 | case ExpressionType.Or: 31 | case ExpressionType.OrElse: 32 | Visit(b.Left); 33 | sb.Append("||"); 34 | Visit(b.Right); 35 | break; 36 | case ExpressionType.Equal: 37 | Visit(b.Left); 38 | sb.Append("="); 39 | Visit(b.Right); 40 | break; 41 | case ExpressionType.NotEqual: 42 | Visit(b.Left); 43 | sb.Append("!="); 44 | Visit(b.Right); 45 | break; 46 | case ExpressionType.LessThan: 47 | Visit(b.Left); 48 | sb.Append("<"); 49 | Visit(b.Right); 50 | break; 51 | case ExpressionType.GreaterThan: 52 | Visit(b.Left); 53 | sb.Append(">"); 54 | Visit(b.Right); 55 | break; 56 | case ExpressionType.LessThanOrEqual: 57 | Visit(Expression.Or(Expression.LessThan(b.Left, b.Right), Expression.Equal(b.Left, b.Right))); 58 | break; 59 | case ExpressionType.GreaterThanOrEqual: 60 | Visit(Expression.Or(Expression.GreaterThan(b.Left, b.Right), Expression.Equal(b.Left, b.Right))); 61 | break; 62 | default: 63 | throw new NotSupportedException(string.Format("The binary operator '{0}' is not supported", b.NodeType)); 64 | } 65 | sb.Append(")"); 66 | return b; 67 | } 68 | 69 | protected override Expression VisitMemberAccess(MemberExpression m) { 70 | if (m.Expression != null && m.Expression.NodeType == ExpressionType.Parameter) { 71 | sb.Append(m.Member.Name.ToLowerInvariant()); 72 | return m; 73 | } 74 | throw new NotSupportedException(string.Format("The member '{0}' is not supported", m.Member.Name)); 75 | } 76 | 77 | protected override Expression VisitConstant(ConstantExpression c) { 78 | if (c.Value is string) 79 | sb.AppendFormat("\"{0}\"", c.Value); 80 | else 81 | sb.Append(c.Value.ToString()); 82 | return c; 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.Linq/Impl/WhereTranslator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2146a19b48a1a2d45878da0c250daeb2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0faf12c4105ada44bbb854b75c4afa8 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/DatabaseClient.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using GDataDB.Impl; 4 | using Google.GData.Client; 5 | using Google.GData.Documents; 6 | using Google.GData.Spreadsheets; 7 | using SpreadsheetQuery=Google.GData.Documents.SpreadsheetQuery; 8 | 9 | namespace GDataDB { 10 | public class DatabaseClient : IDatabaseClient { 11 | private readonly IService documentService; 12 | private readonly IService spreadsheetService; 13 | 14 | public IService DocumentService 15 | { 16 | get { return documentService; } 17 | } 18 | 19 | public IService SpreadsheetService 20 | { 21 | get { return spreadsheetService; } 22 | } 23 | 24 | public DatabaseClient(string username, string password) { 25 | 26 | GOAuth2RequestFactory requestFactory = GDataDBRequestFactory.RefreshAuthenticate(); 27 | 28 | var docService = new DocumentsService("database"); 29 | docService.RequestFactory = requestFactory; 30 | 31 | documentService = docService; 32 | 33 | var ssService = new SpreadsheetsService("database"); 34 | 35 | ssService.RequestFactory = requestFactory; 36 | spreadsheetService = ssService; 37 | } 38 | 39 | public IDatabase CreateDatabase(string name) { 40 | using (var ms = new MemoryStream()) { 41 | using (var sw = new StreamWriter(ms)) { 42 | sw.WriteLine(",,,"); 43 | var spreadSheet = DocumentService.Insert(new Uri(DocumentsListQuery.documentsBaseUri), ms, "text/csv", name); 44 | return new Database(this, spreadSheet); 45 | } 46 | } 47 | } 48 | 49 | /// 50 | /// @kims 2017.02.09. Added exception handling to smoothly handle abnormal error. 51 | /// If oauth2 setting does not correctly done in the GoogleDataSetting.asset file or missing, 52 | /// you will get the 'Null reference object' error. 53 | /// @kims 2016.08.09. Added second parameter to pass error message by reference. 54 | /// 55 | /// Null, if any error has been occured. 56 | public IDatabase GetDatabase(string name, ref string error) 57 | { 58 | try 59 | { 60 | Google.GData.Spreadsheets.SpreadsheetQuery query = new Google.GData.Spreadsheets.SpreadsheetQuery(); 61 | 62 | // Make a request to the API and get all spreadsheets. 63 | SpreadsheetsService service = spreadsheetService as SpreadsheetsService; 64 | 65 | SpreadsheetFeed feed = service.Query(query); 66 | 67 | if (feed.Entries.Count == 0) 68 | { 69 | error = @"There are no spreadsheets in your docs."; 70 | return null; 71 | } 72 | 73 | AtomEntry spreadsheet = null; 74 | foreach (AtomEntry sf in feed.Entries) 75 | { 76 | if (sf.Title.Text == name) 77 | spreadsheet = sf; 78 | } 79 | 80 | if (spreadsheet == null) 81 | { 82 | error = @"There is no such spreadsheet with such title in your docs."; 83 | return null; 84 | } 85 | 86 | return new Database(this, spreadsheet); 87 | } 88 | catch(Exception e) 89 | { 90 | error = e.Message; 91 | return null; 92 | } 93 | } 94 | } 95 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/DatabaseClient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7925f4f929afa064287fe96e2e533eaa 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/IDatabase.cs: -------------------------------------------------------------------------------- 1 | namespace GDataDB { 2 | /// 3 | /// Spreadsheet document 4 | /// 5 | public interface IDatabase { 6 | /// 7 | /// Creates a new worksheet in this document 8 | /// 9 | /// 10 | /// 11 | /// 12 | ITable CreateTable(string name); 13 | 14 | /// 15 | /// Gets an existing worksheet in this document. 16 | /// 17 | /// 18 | /// 19 | /// Searched worksheet or null if not found 20 | ITable GetTable(string name); 21 | 22 | /// 23 | /// Deletes this spreadsheet document 24 | /// 25 | void Delete(); 26 | } 27 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/IDatabase.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a666a0cde53c4e49b5df865586f2f75 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/IDatabaseClient.cs: -------------------------------------------------------------------------------- 1 | using Google.GData.Client; 2 | 3 | namespace GDataDB { 4 | /// 5 | /// Google spreadsheet service entry point 6 | /// 7 | public interface IDatabaseClient { 8 | 9 | IService DocumentService { get; } 10 | IService SpreadsheetService { get; } 11 | 12 | /// 13 | /// Creates a new (spreadsheet document) 14 | /// 15 | /// 16 | /// 17 | IDatabase CreateDatabase(string name); 18 | 19 | /// 20 | /// Gets an existing (spreadsheet document) 21 | /// 22 | /// 23 | /// IDocument instance or null if not found 24 | IDatabase GetDatabase(string name, ref string error); 25 | } 26 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/IDatabaseClient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 610c69e222be9e74c879bbce74fd6320 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/IRow.cs: -------------------------------------------------------------------------------- 1 | namespace GDataDB { 2 | /// 3 | /// Row in the spreadsheet 4 | /// 5 | /// 6 | public interface IRow { 7 | /// 8 | /// Element stored in the row 9 | /// 10 | T Element { get; set; } 11 | 12 | /// 13 | /// Updates the row in the spreadsheet using the current 14 | /// 15 | void Update(); 16 | 17 | /// 18 | /// Deletes this row 19 | /// 20 | void Delete(); 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/IRow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88a0a06988212364da870d1629b3de9b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/ITable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace GDataDB { 5 | /// 6 | /// Worksheet in a spreadsheet document 7 | /// 8 | /// 9 | public interface ITable { 10 | /// 11 | /// Deletes this worksheet 12 | /// 13 | void Delete(); 14 | 15 | /// 16 | /// Adds a new row 17 | /// 18 | /// Object to store 19 | /// Row stored 20 | IRow Add(T e); 21 | 22 | /// 23 | /// Gets a row by index number 24 | /// 25 | /// 26 | /// 27 | IRow Get(int rowNumber); 28 | 29 | /// 30 | /// Gets all stored rows in this worksheet 31 | /// 32 | /// 33 | IList> FindAll(); 34 | 35 | /// 36 | /// Gets all stored rows in this worksheet, paged 37 | /// 38 | /// 39 | /// 40 | /// 41 | IList> FindAll(int start, int count); 42 | 43 | /// 44 | /// Free text row search 45 | /// 46 | /// text to search 47 | /// Matching rows 48 | IList> Find(string query); 49 | 50 | /// 51 | /// Searches rows using a structured query 52 | /// Syntax: http://code.google.com/apis/spreadsheets/data/2.0/reference.html#ListParameters 53 | /// 54 | /// structured query 55 | /// Matching rows 56 | IList> FindStructured(string query); 57 | 58 | /// 59 | /// Searches rows using a structured query, paged 60 | /// Syntax: http://code.google.com/apis/spreadsheets/data/2.0/reference.html#ListParameters 61 | /// 62 | /// 63 | /// 64 | /// 65 | /// Matching rows 66 | IList> FindStructured(string query, int start, int count); 67 | 68 | /// 69 | /// Searches rows 70 | /// 71 | /// query parameters 72 | /// Matching rows 73 | IList> Find(Query q); 74 | 75 | 76 | Uri GetFeedUrl(); 77 | } 78 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/ITable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c4a7baabfc25a745b6826021c792a3d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5799f7b88a0f60b459c4af1c9d9ebbea 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Database.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Google.GData.Client; 3 | using Google.GData.Documents; 4 | using Google.GData.Spreadsheets; 5 | 6 | namespace GDataDB.Impl { 7 | public class Database : IDatabase { 8 | private readonly IDatabaseClient client; 9 | private readonly AtomEntry entry; 10 | 11 | public Database(IDatabaseClient client, AtomEntry entry) { 12 | this.client = client; 13 | this.entry = entry; 14 | } 15 | 16 | public ITable CreateTable(string name) { 17 | var link = entry.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null); 18 | var wsFeed = (WorksheetFeed) client.SpreadsheetService.Query(new WorksheetQuery(link.HRef.ToString())); 19 | var length = typeof (T).GetProperties().Length; 20 | var ws = wsFeed.Insert(new WorksheetEntry(1, (uint) length, name)); 21 | var cellLink = new AtomLink(ws.CellFeedLink); 22 | var cFeed = client.SpreadsheetService.Query(new CellQuery(cellLink.HRef.ToString())); 23 | { 24 | uint c = 0; 25 | foreach (var p in typeof (T).GetProperties()) { 26 | var entry1 = new CellEntry(1, ++c, p.Name); 27 | cFeed.Insert(entry1); 28 | } 29 | } 30 | return new Table(client.SpreadsheetService, ws); 31 | } 32 | 33 | public ITable GetTable(string name) { 34 | var link = entry.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null); 35 | var wsFeed = (WorksheetFeed) client.SpreadsheetService.Query(new WorksheetQuery(link.HRef.ToString()) {Title = name, Exact = true}); 36 | if (wsFeed.Entries.Count == 0) 37 | return null; 38 | return new Table(client.SpreadsheetService, (WorksheetEntry) wsFeed.Entries[0]); 39 | } 40 | 41 | public WorksheetEntry GetWorksheetEntry(string name) 42 | { 43 | /* 44 | var link = entry.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null); 45 | var wsFeed = (WorksheetFeed) client.SpreadsheetService.Query(new WorksheetQuery(link.HRef.ToString()) {Title = name, Exact = true}); 46 | if (wsFeed.Entries.Count == 0) 47 | return null; 48 | 49 | return (WorksheetEntry)wsFeed.Entries [0]; 50 | */ 51 | 52 | SpreadsheetEntry spreadsheet = this.entry as SpreadsheetEntry; 53 | WorksheetFeed wsFeed = spreadsheet.Worksheets; 54 | 55 | // Iterate through each worksheet in the spreadsheet. 56 | WorksheetEntry worksheetEntry = null; 57 | foreach(WorksheetEntry entry in wsFeed.Entries) 58 | { 59 | // Retrieve worksheet with the given name. 60 | if (entry.Title.Text == name) 61 | worksheetEntry = entry; 62 | } 63 | 64 | return worksheetEntry; 65 | } 66 | 67 | public void Delete() { 68 | // cannot call "entry.Delete()" directly after modification as the EditUri is invalid 69 | var feed = client.DocumentService.Query(new DocumentsListQuery(entry.SelfUri.ToString())); 70 | feed.Entries[0].Delete(); 71 | } 72 | } 73 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Database.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f8206ae896ba62478a8909918040144 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/GDataDBRequestFactory.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// GDataDBRequestFactory.cs 4 | /// 5 | /// (c)2015 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | 9 | using UnityEngine; 10 | using UnityEditor; 11 | using System; 12 | using System.Collections.Generic; 13 | using Google.GData.Client; 14 | using Google.GData.Spreadsheets; 15 | using Newtonsoft.Json; 16 | using Newtonsoft.Json.Linq; 17 | using UnityQuickSheet; 18 | 19 | namespace GDataDB.Impl 20 | { 21 | /// 22 | /// Handles OAuth2 credentials to access on google spreadsheets. 23 | /// 24 | /// Note that it needs json type of private key to get access code. 25 | /// 26 | /// 27 | public class GDataDBRequestFactory 28 | { 29 | const string SCOPE = "https://www.googleapis.com/auth/drive https://spreadsheets.google.com/feeds https://docs.google.com/feeds"; 30 | const string REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob"; 31 | const string TOKEN_TYPE = "refresh"; 32 | 33 | public static GOAuth2RequestFactory RefreshAuthenticate() 34 | { 35 | if (string.IsNullOrEmpty(GoogleDataSettings.Instance._RefreshToken) || 36 | string.IsNullOrEmpty(GoogleDataSettings.Instance._AccessToken)) 37 | return null; 38 | 39 | if (string.IsNullOrEmpty(GoogleDataSettings.Instance.OAuth2Data.client_id) || 40 | string.IsNullOrEmpty(GoogleDataSettings.Instance.OAuth2Data.client_id)) 41 | return null; 42 | 43 | OAuth2Parameters parameters = new OAuth2Parameters() 44 | { 45 | RefreshToken = GoogleDataSettings.Instance._RefreshToken, 46 | AccessToken = GoogleDataSettings.Instance._AccessToken, 47 | ClientId = GoogleDataSettings.Instance.OAuth2Data.client_id, 48 | ClientSecret = GoogleDataSettings.Instance.OAuth2Data.client_secret, 49 | Scope = "https://www.googleapis.com/auth/drive https://spreadsheets.google.com/feeds", 50 | AccessType = "offline", 51 | TokenType = "refresh" 52 | }; 53 | return new GOAuth2RequestFactory("spreadsheet", "MySpreadsheetIntegration-v1", parameters); 54 | } 55 | 56 | public static void InitAuthenticate() 57 | { 58 | string clientId = GoogleDataSettings.Instance.OAuth2Data.client_id; 59 | string clientSecret = GoogleDataSettings.Instance.OAuth2Data.client_secret; 60 | string accessCode = GoogleDataSettings.Instance._AccessCode; 61 | 62 | // OAuth2Parameters holds all the parameters related to OAuth 2.0. 63 | OAuth2Parameters parameters = new OAuth2Parameters(); 64 | parameters.ClientId = clientId; 65 | parameters.ClientSecret = clientSecret; 66 | parameters.RedirectUri = REDIRECT_URI; 67 | 68 | // Retrieves the Authorization URL 69 | parameters.Scope = SCOPE; 70 | parameters.AccessType = "offline"; // IMPORTANT 71 | parameters.TokenType = TOKEN_TYPE; // IMPORTANT 72 | 73 | string authorizationUrl = OAuthUtil.CreateOAuth2AuthorizationUrl(parameters); 74 | Debug.Log(authorizationUrl); 75 | //Debug.Log("Please visit the URL above to authorize your OAuth " 76 | // + "request token. Once that is complete, type in your access code to " 77 | // + "continue..."); 78 | 79 | parameters.AccessCode = accessCode; 80 | 81 | if (IsValidURL(authorizationUrl)) 82 | { 83 | Application.OpenURL(authorizationUrl); 84 | const string message = @"Copy the 'Access Code' on your browser into the access code textfield."; 85 | EditorUtility.DisplayDialog("Info", message, "OK"); 86 | } 87 | else 88 | EditorUtility.DisplayDialog("Error", "Invalid URL: " + authorizationUrl, "OK"); 89 | } 90 | 91 | /// 92 | /// Check whether the given string is a valid http or https URL. 93 | /// 94 | private static bool IsValidURL(string url) 95 | { 96 | Uri uriResult; 97 | return (Uri.TryCreate(url, UriKind.Absolute, out uriResult) && 98 | (uriResult.Scheme == Uri.UriSchemeHttp || 99 | uriResult.Scheme == Uri.UriSchemeHttps)); 100 | } 101 | 102 | public static void FinishAuthenticate() 103 | { 104 | try 105 | { 106 | OAuth2Parameters parameters = new OAuth2Parameters(); 107 | parameters.ClientId = GoogleDataSettings.Instance.OAuth2Data.client_id; 108 | parameters.ClientSecret = GoogleDataSettings.Instance.OAuth2Data.client_secret; 109 | parameters.RedirectUri = REDIRECT_URI; 110 | 111 | parameters.Scope = SCOPE; 112 | parameters.AccessType = "offline"; // IMPORTANT 113 | parameters.TokenType = TOKEN_TYPE; // IMPORTANT 114 | 115 | parameters.AccessCode = GoogleDataSettings.Instance._AccessCode; 116 | 117 | OAuthUtil.GetAccessToken(parameters); 118 | string accessToken = parameters.AccessToken; 119 | string refreshToken = parameters.RefreshToken; 120 | //Debug.Log("OAuth Access Token: " + accessToken + "\n"); 121 | //Debug.Log("OAuth Refresh Token: " + refreshToken + "\n"); 122 | 123 | GoogleDataSettings.Instance._RefreshToken = refreshToken; 124 | GoogleDataSettings.Instance._AccessToken = accessToken; 125 | } 126 | catch(Exception e) 127 | { 128 | // To display the error message with EditorGUI.Dialogue, we throw it again. 129 | throw new Exception(e.Message); 130 | } 131 | } 132 | } 133 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/GDataDBRequestFactory.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29ae1c6f5d942c446a5ec64a3d3dd1ad 3 | timeCreated: 1442999553 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Row.cs: -------------------------------------------------------------------------------- 1 | using Google.GData.Spreadsheets; 2 | 3 | namespace GDataDB.Impl { 4 | public class Row : IRow { 5 | public T Element { get; set; } 6 | private readonly ListEntry entry; 7 | private readonly Serializer serializer = new Serializer(); 8 | 9 | public Row(ListEntry entry) { 10 | this.entry = entry; 11 | } 12 | 13 | public void Update() { 14 | serializer.Serialize(Element, entry); 15 | entry.Update(); 16 | } 17 | 18 | public void Delete() { 19 | entry.Delete(); 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Row.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 780b2fc9689edea4892694374d93050a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System; 4 | using System.Linq; 5 | using System.ComponentModel; 6 | using System.Reflection; 7 | using Google.GData.Spreadsheets; 8 | 9 | namespace GDataDB.Impl { 10 | /// 11 | /// (de)serializes an object into a spreadsheet row 12 | /// Uses only the object properties. 13 | /// Property names are used as column names in the spreadsheet 14 | /// 15 | /// 16 | public class Serializer { 17 | public ListEntry Serialize(T e) { 18 | return Serialize(e, new ListEntry()); 19 | } 20 | 21 | public ListEntry Serialize(T e, ListEntry record) { 22 | foreach (var p in typeof (T).GetProperties()) { 23 | if (p.CanRead) { 24 | record.Elements.Add(new ListEntry.Custom { 25 | LocalName = p.Name.ToLowerInvariant(), // for some reason this HAS to be lowercase or it throws 26 | Value = ToNullOrString(p.GetValue(e, null)), 27 | }); 28 | } 29 | } 30 | return record; 31 | } 32 | 33 | public string ToNullOrString(object o) { 34 | if (o == null) 35 | return null; 36 | return o.ToString(); 37 | } 38 | 39 | public object ConvertFrom(object value, Type t) { 40 | if (t.IsGenericType && t.GetGenericTypeDefinition().Equals(typeof (Nullable<>))) { 41 | var nc = new NullableConverter(t); 42 | return nc.ConvertFrom(value); 43 | } 44 | 45 | //HACK: modified to return enum. 46 | if (t.IsEnum) 47 | { 48 | return Enum.Parse(t, value.ToString(), true); 49 | } 50 | else 51 | return Convert.ChangeType(value, t); 52 | } 53 | 54 | public T Deserialize(ListEntry e) { 55 | var t = typeof (T); 56 | var r = (T) Activator.CreateInstance(t); 57 | foreach (ListEntry.Custom c in e.Elements) { 58 | var property = t.GetProperty(c.LocalName, BindingFlags.IgnoreCase | BindingFlags.Instance | BindingFlags.Public); 59 | if (property == null) 60 | continue; 61 | if (property.CanWrite) { 62 | 63 | try 64 | { 65 | if (property.PropertyType.IsArray) 66 | { 67 | const char DELIMETER = ','; // '\n' 68 | 69 | if (property.PropertyType.GetElementType().IsEnum) 70 | { 71 | var values = c.Value.Split(DELIMETER) 72 | .Select(s => s.Replace(" ", string.Empty)) 73 | .Select(i => Enum.Parse(property.PropertyType.GetElementType(), i)) 74 | .ToArray(); 75 | 76 | Array array = (Array)Activator.CreateInstance(property.PropertyType, values.Length); 77 | 78 | // copy the object values to the array 79 | int l = 0; 80 | foreach (var value in values) 81 | { 82 | array.SetValue(value, l++); 83 | } 84 | 85 | property.SetValue(r, array, null); 86 | } 87 | else 88 | { 89 | // remove whitespace between each of element 90 | string str = new string(c.Value.ToCharArray() 91 | .Where(ch => !Char.IsWhiteSpace(ch)) 92 | .ToArray()); 93 | 94 | // remove ',', if it is found at the end. 95 | char[] charToTrim = { ',', ' ' }; 96 | str = str.TrimEnd(charToTrim); 97 | 98 | if (!string.IsNullOrEmpty(str)) { 99 | // split by ',' 100 | object[] temp = str.Split(DELIMETER); 101 | 102 | Array array = (Array)Activator.CreateInstance(property.PropertyType, temp.Length); 103 | 104 | for (int i = 0; i < array.Length; i++) 105 | { 106 | array.SetValue(Convert.ChangeType(temp[i], property.PropertyType.GetElementType()), i); 107 | } 108 | 109 | property.SetValue(r, array, null); 110 | } 111 | } 112 | } 113 | else 114 | { 115 | object value = new object(); 116 | if (property.PropertyType.IsEnum) 117 | { 118 | value = c.Value.Replace(" ", string.Empty); 119 | value = Enum.Parse(property.PropertyType, value.ToString()); 120 | } 121 | else 122 | { 123 | value = ConvertFrom(c.Value, property.PropertyType); 124 | } 125 | 126 | property.SetValue(r, value, null); 127 | } 128 | } 129 | catch(Exception exc) 130 | { 131 | Debug.LogError ("GDataDB Serialization Exception: " + exc.Message + " ListEntry LocalName: " + c.LocalName); 132 | } 133 | } 134 | } 135 | return r; 136 | } 137 | } 138 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f5ae1b402774a740ad9860c1dff85b6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Table.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using Google.GData.Client; 4 | using Google.GData.Spreadsheets; 5 | 6 | namespace GDataDB.Impl { 7 | public class Table : ITable { 8 | private readonly IService svc; 9 | private readonly WorksheetEntry entry; 10 | private readonly Serializer serializer = new Serializer(); 11 | 12 | public Table(IService svc, WorksheetEntry entry) { 13 | this.svc = svc; 14 | this.entry = entry; 15 | } 16 | 17 | public void Delete() { 18 | var wsFeed = (WorksheetFeed)svc.Query(new WorksheetQuery(entry.SelfUri.ToString())); 19 | wsFeed.Entries[0].Delete(); 20 | } 21 | 22 | private ListQuery GetQuery() { 23 | return new ListQuery(GetLink().HRef.Content); 24 | } 25 | 26 | private ListFeed GetFeed() { 27 | return (ListFeed) svc.Query(GetQuery()); 28 | } 29 | 30 | private AtomLink GetLink() { 31 | return entry.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null); 32 | } 33 | 34 | public IRow Add(T e) { 35 | var feed = GetFeed(); 36 | var newEntry = serializer.Serialize(e); 37 | var rowEntry = feed.Insert(newEntry); 38 | return new Row((ListEntry) rowEntry) {Element = e}; 39 | } 40 | 41 | public IRow Get(int rowNumber) { 42 | var q = GetQuery(); 43 | q.StartIndex = rowNumber; 44 | q.NumberToRetrieve = 1; 45 | var results = Find(q); 46 | if (results.Count == 0) 47 | return null; 48 | return results[0]; 49 | } 50 | 51 | public IList> FindAll() { 52 | return Find(GetQuery()); 53 | } 54 | 55 | public IList> FindAll(int start, int count) { 56 | return Find(new Query { 57 | Start = start, 58 | Count = count, 59 | }); 60 | } 61 | 62 | public IList> Find(string query) { 63 | return Find(new Query {FreeQuery = query}); 64 | } 65 | 66 | public IList> FindStructured(string query) { 67 | return Find(new Query {StructuredQuery = query}); 68 | } 69 | 70 | public IList> FindStructured(string query, int start, int count) { 71 | return Find(new Query { 72 | StructuredQuery = query, 73 | Start = start, 74 | Count = count, 75 | }); 76 | } 77 | 78 | public IList> Find(Query q) { 79 | var fq = GetQuery(); 80 | fq.Query = q.FreeQuery; 81 | fq.SpreadsheetQuery = q.StructuredQuery; 82 | fq.StartIndex = q.Start; 83 | fq.NumberToRetrieve = q.Count; 84 | if (q.Order != null) { 85 | fq.OrderByColumn = q.Order.ColumnName; 86 | fq.Reverse = q.Order.Descending; 87 | } 88 | return Find(fq); 89 | } 90 | 91 | public Uri GetFeedUrl() { 92 | return new Uri(GetFeed().Feed); 93 | } 94 | 95 | private IList> Find(FeedQuery q) { 96 | var feed = (ListFeed) svc.Query(q); 97 | var l = new List>(); 98 | foreach (ListEntry e in feed.Entries) { 99 | l.Add(new Row(e) { Element = serializer.Deserialize(e) }); 100 | } 101 | return l; 102 | } 103 | } 104 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Table.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2522631e6bd02b4b83ab5914028e304 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Order.cs: -------------------------------------------------------------------------------- 1 | namespace GDataDB { 2 | /// 3 | /// Sort order 4 | /// 5 | public class Order { 6 | public bool Descending { get; set; } 7 | public string ColumnName { get; set; } 8 | } 9 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Order.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ec4df538115e8f49ada7fb240b9c7f6 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Query.cs: -------------------------------------------------------------------------------- 1 | namespace GDataDB { 2 | /// 3 | /// Query parameters 4 | /// 5 | public class Query { 6 | /// 7 | /// Start index, for paging 8 | /// 9 | public int Start { get; set; } 10 | 11 | /// 12 | /// Record count to fetch, for paging 13 | /// 14 | public int Count { get; set; } 15 | 16 | /// 17 | /// Free text query 18 | /// 19 | public string FreeQuery { get; set; } 20 | 21 | /// 22 | /// Structured query 23 | /// 24 | public string StructuredQuery { get; set; } 25 | 26 | /// 27 | /// Sort order 28 | /// 29 | public Order Order { get; set; } 30 | } 31 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Query.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ff00530572803448edb27e6eca581a 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/README.md: -------------------------------------------------------------------------------- 1 | This is an attempt at porting the python google spreadsheet data client 2 | 3 | Original source at: 4 | http://code.google.com/p/gdata-python-client/source/browse/src/gdata/spreadsheet/text_db.py 5 | 6 | [![Please donate](http://www.pledgie.com/campaigns/11248.png)](http://www.pledgie.com/campaigns/11248) -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2de6057f0cebe18449d1a9be8826e298 3 | DefaultImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GDataDB/license.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb0682fb21149484eb8f1f5456809119 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google Data Settings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google Data Settings.asset -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google Data Settings.asset.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: de069546a9e7f3340afcaabb8a149e47 3 | timeCreated: 1500383124 4 | licenseType: Pro 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8fe61dc56dc04f44a9b5a28fa7eaa9db 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.AccessControl.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.AccessControl.DLL -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.AccessControl.DLL.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2fc52d5c46f74b70adce3c8e02c0f96 3 | timeCreated: 1432905934 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | OSXIntel: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel64: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | SamsungTV: 41 | enabled: 0 42 | settings: 43 | STV_MODEL: STANDARD_13 44 | Win: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | Win64: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | WindowsStoreApps: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | iOS: 57 | enabled: 0 58 | settings: 59 | CompileFlags: 60 | FrameworkDependencies: 61 | userData: 62 | assetBundleName: 63 | assetBundleVariant: 64 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Client.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Client.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Client.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e94444d8d4c34fc78f28ee4187d6c97 3 | timeCreated: 1432905927 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Documents.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Documents.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Documents.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 544998f35f5cb4ae6bf8a6272ae695e9 3 | timeCreated: 1432905928 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Extensions.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Extensions.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Extensions.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fe880e0f65d44d6c9347487e1f7acfe 3 | timeCreated: 1432905929 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Spreadsheets.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Spreadsheets.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.Spreadsheets.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4dafe866bed5849e49a161d00b51b89c 3 | timeCreated: 1432905928 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 0 13 | settings: {} 14 | Editor: 15 | enabled: 1 16 | settings: 17 | DefaultValueInitialized: true 18 | WindowsStoreApps: 19 | enabled: 0 20 | settings: 21 | CPU: AnyCPU 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Google.GData.license.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3432ee42bd3114816a9951cd7feb1fa4 3 | timeCreated: 1427705185 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll.mdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll.mdb -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll.mdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7afcc5a21345c5945bed49685864ac47 3 | timeCreated: 1508690148 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d5c6649544e9484cafe531c0c9713fc 3 | timeCreated: 1432906003 4 | licenseType: Free 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Android: 12 | enabled: 0 13 | settings: 14 | CPU: AnyCPU 15 | Any: 16 | enabled: 0 17 | settings: {} 18 | Editor: 19 | enabled: 1 20 | settings: 21 | CPU: AnyCPU 22 | DefaultValueInitialized: true 23 | OS: AnyOS 24 | Linux: 25 | enabled: 0 26 | settings: 27 | CPU: x86 28 | Linux64: 29 | enabled: 0 30 | settings: 31 | CPU: x86_64 32 | OSXIntel: 33 | enabled: 0 34 | settings: 35 | CPU: AnyCPU 36 | OSXIntel64: 37 | enabled: 0 38 | settings: 39 | CPU: AnyCPU 40 | SamsungTV: 41 | enabled: 0 42 | settings: 43 | STV_MODEL: STANDARD_13 44 | Win: 45 | enabled: 0 46 | settings: 47 | CPU: AnyCPU 48 | Win64: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | iOS: 53 | enabled: 0 54 | settings: 55 | CompileFlags: 56 | FrameworkDependencies: 57 | userData: 58 | assetBundleName: 59 | assetBundleVariant: 60 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.pdb -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.pdb.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 762afa29ed0c5422da7287c8e04b90e9 3 | timeCreated: 1432905997 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/Newtonsoft.Json.xml.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 69b9ce4284a8148a5bb45ccbcb0bc6e9 3 | timeCreated: 1432906003 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/Google/license.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: adedb1851d5204f3bacaf36547c7ff72 3 | timeCreated: 1427705185 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// GoogleDataSettings.cs 4 | /// 5 | /// (c)2013 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | using System.IO; 12 | using System.Collections.Generic; 13 | 14 | namespace UnityQuickSheet 15 | { 16 | /// 17 | /// A class manages google account setting. 18 | /// 19 | [CreateAssetMenu(menuName = "QuickSheet/Setting/GoogleData Setting")] 20 | public class GoogleDataSettings : SingletonScriptableObject 21 | { 22 | // A flag which indicates use local installed oauth2 json file for authentication or not. 23 | static public bool useOAuth2JsonFile = false; 24 | 25 | public string JsonFilePath 26 | { 27 | get { return jsonFilePath; } 28 | set 29 | { 30 | if (string.IsNullOrEmpty(value) == false) 31 | jsonFilePath = value; 32 | } 33 | } 34 | private string jsonFilePath = string.Empty; 35 | 36 | /// 37 | /// A default path where .txt template files are. 38 | /// 39 | public string TemplatePath = "QuickSheet/GDataPlugin/Templates"; 40 | 41 | /// 42 | /// A path where generated ScriptableObject derived class and its data class script files are to be put. 43 | /// 44 | public string RuntimePath = string.Empty; 45 | 46 | /// 47 | /// A path where generated editor script files are to be put. 48 | /// 49 | public string EditorPath = string.Empty; 50 | 51 | [System.Serializable] 52 | public struct OAuth2JsonData 53 | { 54 | public string client_id; 55 | public string auth_uri; 56 | public string token_uri; 57 | public string auth_provider_x509_cert_url; 58 | public string client_secret; 59 | public List redirect_uris; 60 | }; 61 | 62 | public OAuth2JsonData OAuth2Data; 63 | 64 | // enter Access Code after getting it from auth url 65 | public string _AccessCode = "Paste AcecessCode here!"; 66 | 67 | // enter Auth 2.0 Refresh Token and AccessToken after succesfully authorizing with Access Code 68 | public string _RefreshToken = ""; 69 | 70 | public string _AccessToken = ""; 71 | 72 | /// 73 | /// Select currently exist account setting asset file. 74 | /// 75 | [MenuItem("Edit/QuickSheet/Select Google Data Setting")] 76 | public static void Edit() 77 | { 78 | Selection.activeObject = Instance; 79 | if (Selection.activeObject == null) 80 | { 81 | Debug.LogError("No GoogleDataSettings.asset file is found. Create setting file first."); 82 | } 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dbcda13c00cae4f4087d84a149a1c70b 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettingsEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4161ed9b16570b64f8a03904fffde3ac 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// GoogleMachine.cs 4 | /// 5 | /// (c)2013 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using UnityEditor; 10 | using System.Collections; 11 | using System.Collections.Generic; 12 | using System.IO; 13 | 14 | namespace UnityQuickSheet 15 | { 16 | /// 17 | /// A class for various setting to import google spreadsheet data and generated related script files. 18 | /// 19 | internal class GoogleMachine : BaseMachine 20 | { 21 | [SerializeField] 22 | public static string generatorAssetPath = "Assets/QuickSheet/GDataPlugin/Tool/"; 23 | [SerializeField] 24 | public static string assetFileName = "GoogleMachine.asset"; 25 | 26 | 27 | public string AccessCode = ""; 28 | 29 | /// 30 | /// Note: Called when the asset file is created. 31 | /// 32 | private void Awake() 33 | { 34 | // excel and google plugin have its own template files, 35 | // so we need to set the different path when the asset file is created. 36 | TemplatePath = GoogleDataSettings.Instance.TemplatePath; 37 | } 38 | 39 | /// 40 | /// A menu item which create a 'GoogleMachine' asset file. 41 | /// 42 | [MenuItem("Assets/Create/QuickSheet/Tools/Google")] 43 | public static void CreateGoogleMachineAsset() 44 | { 45 | GoogleMachine inst = ScriptableObject.CreateInstance(); 46 | string path = CustomAssetUtility.GetUniqueAssetPathNameOrFallback(ImportSettingFilename); 47 | AssetDatabase.CreateAsset(inst, path); 48 | AssetDatabase.SaveAssets(); 49 | Selection.activeObject = inst; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GoogleMachine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdb4931813a361148a6651be452ff88e 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Editor/GoogleMachineEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 838c44f91b255e2409df38f7e8c42d7c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da001fbab56f2de47a6db0c42a368162 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/AssetFileClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.IO; 4 | using UnityQuickSheet; 5 | 6 | /// 7 | /// !!! Machine generated code !!! 8 | /// 9 | public partial class GoogleDataAssetUtility 10 | { 11 | [MenuItem("Assets/Create/Google/$ClassName")] 12 | public static void $AssetFileCreateFuncName() 13 | { 14 | $ClassName asset = CustomAssetUtility.CreateAsset<$ClassName>(); 15 | asset.SheetName = "$SpreadSheetName"; 16 | asset.WorksheetName = "$ClassName"; 17 | EditorUtility.SetDirty(asset); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/AssetFileClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3ff468c579567b4fa0e89df791a23c7 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/DataClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | /// 5 | /// !!! Machine generated code !!! 6 | /// !!! DO NOT CHANGE Tabs to Spaces !!! 7 | /// 8 | [System.Serializable] 9 | public class $ClassName 10 | { 11 | $MemberFields 12 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/DataClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ea35372ef24973468c73a9fc4fcfb30 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/ScriptableObjectClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | 6 | /// 7 | /// !!! Machine generated code !!! 8 | /// 9 | /// A class which deriveds ScritableObject class so all its data 10 | /// can be serialized onto an asset data file. 11 | /// 12 | [System.Serializable] 13 | public class $ClassName : ScriptableObject 14 | { 15 | [HideInInspector] [SerializeField] 16 | public string SheetName = ""; 17 | 18 | [HideInInspector] [SerializeField] 19 | public string WorksheetName = ""; 20 | 21 | // Note: initialize in OnEnable() not here. 22 | public $DataClassName[] dataArray; 23 | 24 | void OnEnable() 25 | { 26 | //#if UNITY_EDITOR 27 | //hideFlags = HideFlags.DontSave; 28 | //#endif 29 | // Important: 30 | // It should be checked an initialization of any collection data before it is initialized. 31 | // Without this check, the array collection which already has its data get to be null 32 | // because OnEnable is called whenever Unity builds. 33 | // 34 | if (dataArray == null) 35 | dataArray = new $DataClassName[0]; 36 | } 37 | 38 | // 39 | // Write a proper query methods for retrieving data. 40 | // 41 | //public $DataClassName FindByKey(string key) 42 | //{ 43 | // return Array.Find(dataArray, d => d.Key == key); 44 | //} 45 | } 46 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/ScriptableObjectClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd64167c27777cb428ae1d7a19decfec 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/ScriptableObjectEditorClass.txt: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEditor; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | using GDataDB; 8 | using GDataDB.Linq; 9 | 10 | using UnityQuickSheet; 11 | 12 | /// 13 | /// !!! Machine generated code !!! 14 | /// 15 | [CustomEditor(typeof($WorkSheetClassName))] 16 | public class $ClassName : BaseGoogleEditor<$WorkSheetClassName> 17 | { 18 | public override bool Load() 19 | { 20 | $WorkSheetClassName targetData = target as $WorkSheetClassName; 21 | 22 | var client = new DatabaseClient("", ""); 23 | string error = string.Empty; 24 | var db = client.GetDatabase(targetData.SheetName, ref error); 25 | var table = db.GetTable<$DataClassName>(targetData.WorksheetName) ?? db.CreateTable<$DataClassName>(targetData.WorksheetName); 26 | 27 | List<$DataClassName> myDataList = new List<$DataClassName>(); 28 | 29 | var all = table.FindAll(); 30 | foreach(var elem in all) 31 | { 32 | $DataClassName data = new $DataClassName(); 33 | 34 | data = Cloner.DeepCopy<$DataClassName>(elem.Element); 35 | myDataList.Add(data); 36 | } 37 | 38 | targetData.dataArray = myDataList.ToArray(); 39 | 40 | EditorUtility.SetDirty(targetData); 41 | AssetDatabase.SaveAssets(); 42 | 43 | return true; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/QuickSheet/GDataPlugin/Templates/ScriptableObjectEditorClass.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a4639051ed66664e8726864d2e0df95 3 | TextScriptImporter: 4 | userData: 5 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f90a9d68d0a5bde43b81350c3580939d 3 | folderAsset: yes 4 | DefaultImporter: 5 | userData: 6 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Runtime/ExposePropertyAttribute.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | using System.Collections; 4 | 5 | [AttributeUsage( AttributeTargets.Property )] 6 | public class ExposePropertyAttribute : Attribute 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Runtime/ExposePropertyAttribute.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97ffbbf694304df4187920e468596214 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Runtime/Util.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f0a156a630ab434889769751205b7f3 3 | folderAsset: yes 4 | timeCreated: 1487836845 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/QuickSheet/Runtime/Util/ConvertExt.cs: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | /// 3 | /// ConvertExt.cs 4 | /// 5 | /// (c)2017 Kim, Hyoun Woo 6 | /// 7 | /////////////////////////////////////////////////////////////////////////////// 8 | using UnityEngine; 9 | using System; 10 | using System.Linq; 11 | 12 | namespace UnityQuickSheet 13 | { 14 | /// 15 | /// QuickSheet specific a helper class for various type converting. 16 | /// 17 | /// 18 | public class ConvertExt 19 | { 20 | /// 21 | /// 22 | /// 23 | static public object[] Split(string value) 24 | { 25 | const char DELIMITER = ','; 26 | 27 | string str = value as string; 28 | 29 | // remove whitespace between each of element 30 | str = new string(str.ToCharArray() 31 | .Where(ch => !Char.IsWhiteSpace(ch)) 32 | .ToArray()); 33 | 34 | // remove ',', if it is found at the end. 35 | char[] charToTrim = { ',', ' ' }; 36 | str = str.TrimEnd(charToTrim); 37 | 38 | // split by ',' 39 | object[] temp = str.Split(DELIMITER); 40 | return temp; 41 | } 42 | 43 | /// 44 | /// Convert the given string to array of float. 45 | /// Note the string should contain ',' to separate each of array element. 46 | /// 47 | public static float[] ToSingleArray(string value) 48 | { 49 | object[] temp = Split(value); 50 | float[] result = temp.Select(e => Convert.ChangeType(e, typeof(float))) 51 | .Select(e => (float)e).ToArray(); 52 | //ERROR: InvalidCastException: Cannot cast from source type to destination type. 53 | //float[] result = temp.Select(e => (float)e).ToArray(); 54 | return result; 55 | } 56 | 57 | /// 58 | /// Convert the given string to array of double. 59 | /// 60 | public static double[] ToDoubleArray(string value) 61 | { 62 | object[] temp = Split(value); 63 | double[] result = temp.Select(e => Convert.ChangeType(e, typeof(double))) 64 | .Select(e => (double)e).ToArray(); 65 | return result; 66 | } 67 | 68 | /// 69 | /// Convert the given string to array of short. 70 | /// 71 | public static short[] ToInt16Array(string value) 72 | { 73 | object[] temp = Split(value); 74 | short[] result = temp.Select(e => Convert.ChangeType(e, typeof(short))) 75 | .Select(e => (short)e).ToArray(); 76 | return result; 77 | } 78 | 79 | /// 80 | /// Convert the given string to array of int. 81 | /// 82 | public static int[] ToInt32Array(string value) 83 | { 84 | object[] temp = Split(value); 85 | int[] result = temp.Select(e => Convert.ChangeType(e, typeof(int))) 86 | .Select(e => (int)e).ToArray(); 87 | return result; 88 | } 89 | 90 | /// 91 | /// Convert the given string to array of long. 92 | /// 93 | public static long[] ToInt64Array(string value) 94 | { 95 | object[] temp = Split(value); 96 | long[] result = temp.Select(e => Convert.ChangeType(e, typeof(long))) 97 | .Select(e => (long)e).ToArray(); 98 | return result; 99 | } 100 | 101 | /// 102 | /// Convert the given string to array of long. 103 | /// 104 | public static string[] ToStringArray(string value) 105 | { 106 | object[] temp = Split(value); 107 | string[] result = temp.Select(e => Convert.ChangeType(e, typeof(string))) 108 | .Select(e => (string)e).ToArray(); 109 | return result; 110 | } 111 | 112 | } 113 | } -------------------------------------------------------------------------------- /Assets/QuickSheet/Runtime/Util/ConvertExt.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f346ac7047381c469ddcb5df32af23a 3 | timeCreated: 1487836856 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Kim, Hyoun Woo 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 0 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_DisableAudio: 0 16 | m_VirtualizeEffects: 1 17 | -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_EnablePCM: 1 18 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 19 | -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_DefaultBehaviorMode: 0 10 | m_SpritePackerMode: 0 11 | m_SpritePackerPaddingPower: 1 12 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 13 | m_ProjectGenerationRootNamespace: 14 | m_UserGeneratedProjectSuffix: 15 | -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 0} 42 | m_TransparencySortMode: 0 43 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 44 | m_DefaultRenderingPath: 1 45 | m_DefaultMobileRenderingPath: 1 46 | m_TierSettings: [] 47 | m_LightmapStripping: 0 48 | m_FogStripping: 0 49 | m_InstancingStripping: 0 50 | m_LightmapKeepPlain: 1 51 | m_LightmapKeepDirCombined: 1 52 | m_LightmapKeepDynamicPlain: 1 53 | m_LightmapKeepDynamicDirCombined: 1 54 | m_LightmapKeepShadowMask: 1 55 | m_LightmapKeepSubtractive: 1 56 | m_FogKeepLinear: 1 57 | m_FogKeepExp: 1 58 | m_FogKeepExp2: 1 59 | m_AlbedoSwatchInfos: [] 60 | m_LightsUseLinearIntensity: 0 61 | m_LightsUseColorTemperature: 0 62 | -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left cmd 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | m_SettingNames: 89 | - Humanoid 90 | -------------------------------------------------------------------------------- /ProjectSettings/NavMeshLayers.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/ProjectSettings/NavMeshLayers.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_QueriesHitTriggers: 1 23 | m_QueriesStartInColliders: 1 24 | m_ChangeStopsCallbacks: 0 25 | m_CallbacksOnDisable: 1 26 | m_AlwaysShowColliders: 0 27 | m_ShowColliderSleep: 1 28 | m_ShowColliderContacts: 0 29 | m_ShowColliderAABB: 0 30 | m_ContactArrowScale: 0.2 31 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 32 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 33 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 34 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 35 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 36 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.6.3p4 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Fastest 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | blendWeights: 1 21 | textureQuality: 1 22 | anisotropicTextures: 0 23 | antiAliasing: 0 24 | softParticles: 0 25 | softVegetation: 0 26 | realtimeReflectionProbes: 0 27 | billboardsFaceCameraPosition: 0 28 | vSyncCount: 0 29 | lodBias: 0.3 30 | maximumLODLevel: 0 31 | particleRaycastBudget: 4 32 | asyncUploadTimeSlice: 2 33 | asyncUploadBufferSize: 4 34 | excludedTargetPlatforms: [] 35 | - serializedVersion: 2 36 | name: Fast 37 | pixelLightCount: 0 38 | shadows: 0 39 | shadowResolution: 0 40 | shadowProjection: 1 41 | shadowCascades: 1 42 | shadowDistance: 20 43 | shadowNearPlaneOffset: 3 44 | shadowCascade2Split: 0.33333334 45 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 46 | blendWeights: 2 47 | textureQuality: 0 48 | anisotropicTextures: 0 49 | antiAliasing: 0 50 | softParticles: 0 51 | softVegetation: 0 52 | realtimeReflectionProbes: 0 53 | billboardsFaceCameraPosition: 0 54 | vSyncCount: 0 55 | lodBias: 0.4 56 | maximumLODLevel: 0 57 | particleRaycastBudget: 16 58 | asyncUploadTimeSlice: 2 59 | asyncUploadBufferSize: 4 60 | excludedTargetPlatforms: [] 61 | - serializedVersion: 2 62 | name: Simple 63 | pixelLightCount: 1 64 | shadows: 1 65 | shadowResolution: 0 66 | shadowProjection: 1 67 | shadowCascades: 1 68 | shadowDistance: 20 69 | shadowNearPlaneOffset: 3 70 | shadowCascade2Split: 0.33333334 71 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 72 | blendWeights: 2 73 | textureQuality: 0 74 | anisotropicTextures: 1 75 | antiAliasing: 0 76 | softParticles: 0 77 | softVegetation: 0 78 | realtimeReflectionProbes: 0 79 | billboardsFaceCameraPosition: 0 80 | vSyncCount: 0 81 | lodBias: 0.7 82 | maximumLODLevel: 0 83 | particleRaycastBudget: 64 84 | asyncUploadTimeSlice: 2 85 | asyncUploadBufferSize: 4 86 | excludedTargetPlatforms: [] 87 | - serializedVersion: 2 88 | name: Good 89 | pixelLightCount: 2 90 | shadows: 2 91 | shadowResolution: 1 92 | shadowProjection: 1 93 | shadowCascades: 2 94 | shadowDistance: 40 95 | shadowNearPlaneOffset: 3 96 | shadowCascade2Split: 0.33333334 97 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 98 | blendWeights: 2 99 | textureQuality: 0 100 | anisotropicTextures: 1 101 | antiAliasing: 0 102 | softParticles: 0 103 | softVegetation: 1 104 | realtimeReflectionProbes: 1 105 | billboardsFaceCameraPosition: 1 106 | vSyncCount: 1 107 | lodBias: 1 108 | maximumLODLevel: 0 109 | particleRaycastBudget: 256 110 | asyncUploadTimeSlice: 2 111 | asyncUploadBufferSize: 4 112 | excludedTargetPlatforms: [] 113 | - serializedVersion: 2 114 | name: Beautiful 115 | pixelLightCount: 3 116 | shadows: 2 117 | shadowResolution: 2 118 | shadowProjection: 1 119 | shadowCascades: 2 120 | shadowDistance: 70 121 | shadowNearPlaneOffset: 3 122 | shadowCascade2Split: 0.33333334 123 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 124 | blendWeights: 4 125 | textureQuality: 0 126 | anisotropicTextures: 2 127 | antiAliasing: 2 128 | softParticles: 1 129 | softVegetation: 1 130 | realtimeReflectionProbes: 1 131 | billboardsFaceCameraPosition: 1 132 | vSyncCount: 1 133 | lodBias: 1.5 134 | maximumLODLevel: 0 135 | particleRaycastBudget: 1024 136 | asyncUploadTimeSlice: 2 137 | asyncUploadBufferSize: 4 138 | excludedTargetPlatforms: [] 139 | - serializedVersion: 2 140 | name: Fantastic 141 | pixelLightCount: 4 142 | shadows: 2 143 | shadowResolution: 2 144 | shadowProjection: 1 145 | shadowCascades: 4 146 | shadowDistance: 150 147 | shadowNearPlaneOffset: 3 148 | shadowCascade2Split: 0.33333334 149 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 150 | blendWeights: 4 151 | textureQuality: 0 152 | anisotropicTextures: 2 153 | antiAliasing: 2 154 | softParticles: 1 155 | softVegetation: 1 156 | realtimeReflectionProbes: 1 157 | billboardsFaceCameraPosition: 1 158 | vSyncCount: 1 159 | lodBias: 2 160 | maximumLODLevel: 0 161 | particleRaycastBudget: 4096 162 | asyncUploadTimeSlice: 2 163 | asyncUploadBufferSize: 4 164 | excludedTargetPlatforms: [] 165 | m_PerPlatformDefaultQuality: 166 | Android: 2 167 | FlashPlayer: 3 168 | GLES Emulation: 3 169 | PS3: 3 170 | Standalone: 3 171 | Web: 3 172 | Wii: 3 173 | XBOX360: 3 174 | iPhone: 2 175 | -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_Enabled: 0 14 | m_CaptureEditorExceptions: 1 15 | UnityPurchasingSettings: 16 | m_Enabled: 0 17 | m_TestMode: 0 18 | UnityAnalyticsSettings: 19 | m_Enabled: 0 20 | m_InitializeOnStartup: 1 21 | m_TestMode: 0 22 | m_TestEventUrl: 23 | m_TestConfigUrl: 24 | UnityAdsSettings: 25 | m_Enabled: 0 26 | m_InitializeOnStartup: 1 27 | m_TestMode: 0 28 | m_EnabledPlatforms: 4294967295 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | PerformanceReportingSettings: 32 | m_Enabled: 0 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Unity-QuickSheet 2 | 3 | 4 |

5 | 6 | POD 8 | 9 | 10 | license 12 | 13 |

14 | 15 | Unity-QuickSheet enables you to use google and excel spreadsheet data within Unity editor. With Unity-QuickSheet, you can retrieve data from a spreadsheet and save it as an asset file with a [ScriptableObject](http://docs.unity3d.com/ScriptReference/ScriptableObject.html) format even without writing single line of code. 16 | 17 |

18 | 19 |

20 | 21 | ## Features 22 | 23 | * **_Easy!_** No need to write any single line of code. 24 | * **_Convenient!_** It can retrieve data from excel file. (both of xls and xlsx format are supported on Windows, only xls on OSX.) 25 | * **_Flexible!_** It can also retrieve data from google spreadsheet. 26 | * **_Fast!_** No need to write a parser to retrieve data, it automatically serializes retrieved data into Unity3D's [ScriptableObject](http://docs.unity3d.com/ScriptReference/ScriptableObject.html), the binary format and so it is fast than to use XML which is usually ASCII format. 27 | 28 | Saying again, you don't need to write even single line of code to import data from a spreadsheet whatever Excel or Google spreadsheet. 29 | 30 | 31 | ## Documentaion 32 | 33 | Documentation, located on GitBook site found on [here](https://kimsama.gitbooks.io/unity-quicksheet/content/). 34 | 35 | > Also you can find ['Unity-Quicksheet.pdf'](https://github.com/kimsama/Unity-QuickSheet/blob/master/Assets/QuickSheet/Doc/Unity-Quicksheet.pdf), a pdf file same as the one on the [GitBook page](https://kimsama.gitbooks.io/unity-quicksheet/content/) 36 | 37 | 38 | * **Release Note**: See the [Release](https://github.com/kimsama/Unity-QuickSheet/releases) page for change log. 39 | * **Unity Forum**: You can also find *'Unity-Quicksheet'* on the Unity forum page found on [here](http://forum.unity3d.com/threads/released-unity-quicksheet.289146/). Any feedbacks, patches or suggestions are always welcome! 40 | 41 | ## References 42 | 43 | * [Unity Serialization](http://forum.unity3d.com/threads/155352-Serialization-Best-Practices-Megapost) on Unity's forum for details of serialization mechanism. 44 | * [GDataDB](https://github.com/mausch/GDataDB) is used to retrieve data from Google Spreadsheet. Note that [GDataDB](https://github.com/mausch/GDataDB) is slightly modified to support *enum* type. 45 | * [NPOI](https://npoi.codeplex.com/) is used to read xls and xlsx file. 46 | * All "*.dll" files of Google Data SDK are available at [Google Data API SDK](https://code.google.com/p/google-gdata/downloads/detail?name=libgoogle-data-mono-2.1.0.0.tar.gz&can=2&q=) 47 | * Newtonsoft.Json source code for net 2.0 is available at [here](https://github.com/JamesNK/Newtonsoft.Json) 48 | * [Unity-GoogleData](https://github.com/kimsama/Unity-GoogleData), my previous effort to import a spreadsheet data into Unity. 49 | 50 | ## License 51 | 52 | This code is distributed under the terms and conditions of the MIT license. 53 | 54 | > Other code or libraries borrowed from [GDataDB](https://github.com/mausch/GDataDB), [NPOI](https://npoi.codeplex.com/) and [Google Data API SDK](https://code.google.com/p/google-gdata/downloads/detail?name=libgoogle-data-mono-2.1.0.0.tar.gz&can=2&q=) follow its license. 55 | 56 | Copyright (c) 2013 Kim, Hyoun Woo 57 | -------------------------------------------------------------------------------- /images/array_cell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/array_cell.png -------------------------------------------------------------------------------- /images/arraytype_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/arraytype_setting.png -------------------------------------------------------------------------------- /images/enum_type.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/enum_type.png -------------------------------------------------------------------------------- /images/google-accesscode-01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/google-accesscode-01.png -------------------------------------------------------------------------------- /images/google-accesscode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/google-accesscode.png -------------------------------------------------------------------------------- /images/google-setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/google-setting.png -------------------------------------------------------------------------------- /images/quicksheet01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kimsama/Unity-QuickSheet/04a969de162da8b0bd674bf48f515a0390cda016/images/quicksheet01.png --------------------------------------------------------------------------------