Giter Club home page Giter Club logo

unity-quicksheet's Introduction

Unity-QuickSheet

POD license

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 format even without writing single line of code.

Features

  • Easy! No need to write any single line of code.
  • Convenient! It can retrieve data from excel file. (both of xls and xlsx format are supported on Windows, only xls on OSX.)
  • Flexible! It can also retrieve data from google spreadsheet.
  • Fast! No need to write a parser to retrieve data, it automatically serializes retrieved data into Unity3D's ScriptableObject, the binary format and so it is fast than to use XML which is usually ASCII format.

Saying again, you don't need to write even single line of code to import data from a spreadsheet whatever Excel or Google spreadsheet.

Documentaion

Documentation, located on GitBook site found on here.

Also you can find 'Unity-Quicksheet.pdf', a pdf file same as the one on the GitBook page

  • Release Note: See the Release page for change log.
  • Unity Forum: You can also find 'Unity-Quicksheet' on the Unity forum page found on here. Any feedbacks, patches or suggestions are always welcome!

References

  • Unity Serialization on Unity's forum for details of serialization mechanism.
  • GDataDB is used to retrieve data from Google Spreadsheet. Note that GDataDB is slightly modified to support enum type.
  • NPOI is used to read xls and xlsx file.
  • All "*.dll" files of Google Data SDK are available at Google Data API SDK
  • Newtonsoft.Json source code for net 2.0 is available at here
  • Unity-GoogleData, my previous effort to import a spreadsheet data into Unity.

License

This code is distributed under the terms and conditions of the MIT license.

Other code or libraries borrowed from GDataDB, NPOI and Google Data API SDK follow its license.

Copyright (c) 2013 Kim, Hyoun Woo

unity-quicksheet's People

Contributors

5argon avatar chenjie13 avatar kanonji avatar kimsama avatar markffrench avatar mutmedia avatar pblca avatar pedromr avatar qu1795 avatar zzxiang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

unity-quicksheet's Issues

Error creating Array with Google Sheets

Hi there,

I'm getting an error creating an array. I've tried using strings and int dataTypes and I've used tabs, comma's and comma's with one space to seperate my data in my google sheet but nothing seems to work when I download the sheet.

Here's the error:

GDataDB Serialization Exception: Value is not a convertible object: System.String to System.String[] ListEntry LocalName: arraytest
UnityEngine.Debug:LogError(Object)
GDataDB.Impl.Serializer1:Deserialize(ListEntry) (at Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Serializer.cs:71) GDataDB.Impl.Table1:Find(FeedQuery) (at Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Table.cs:99)
GDataDB.Impl.Table1:FindAll() (at Assets/QuickSheet/GDataPlugin/Editor/GDataDB/GDataDB/Impl/Table.cs:52) testEditor:Load() (at Assets/Editor/Data/testEditor.cs:67) UnityQuickSheet.BaseGoogleEditor1:OnInspectorGUI() (at Assets/QuickSheet/GDataPlugin/Editor/BaseGoogleEditor.cs:97)
testEditor:OnInspectorGUI() (at Assets/Editor/Data/testEditor.cs:35)
UnityEditor.DockArea:OnGUI()

Always need to Select Google Data Settings to update/Reimport.

Hi,
When i try to re import data it will show this error. "Failed to get google data settings. See the google data setting if it has correct path."
After i go to folder and select this file and try again, then only it re imports data.
Doing this always is pain.

Warning on Unity 2018 and above

After imported the plugin into my project, a warning message always appears when I open my Unity Editor (version 2019):

There are menu items registered under Edit/Project Settings: QuickSheet/Select Excel Setting, QuickSheet/Select Google Data Setting
Consider using [SettingsProvider] attribute to register in the Unified Settings Window.

UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

Seems that since version 2018, Unity don't want us to put any menu items under "Edit/Project Settings" anymore. Therefore, I suggest to change

[MenuItem("Edit/Project Settings/QuickSheet/Select Google Data Setting")]

and

[MenuItem("Edit/Project Settings/QuickSheet/Select Excel Setting")]

to

[MenuItem("Edit/QuickSheet/Select Google Data Setting")]

and

[MenuItem("Edit/QuickSheet/Select Excel Setting")]

Error to parse oauth2 json file for google drive from Alberto Sánchez

See the original post below:

Hi again, thank you for helping me out before!

I have another question, I hope you can help!

I am getting an error when I am trying to load a JSON file from console.developers.google.com.

I made GoogleDataSettings.asset, then loaded the JSON file I downloaded, but I can't see the Client ID and the Client Secret on the Inspector, because I get this error:

NullReferenceException: Object reference not set to an instance of an object
UnityQuickSheet.GoogleDataSettingsEditor.OnInspectorGUI () (at Assets/QuickSheet/GDataPlugin/Editor/GoogleDataSettingsEditor.cs:107)
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at /Users/builduser/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1231)
UnityEditor.DockArea:OnGUI()

Apparently because of this line on GoogleDataSettingsEditor.cs.

var oauthData = JObject.Parse(jsonData).SelectToken("installed").ToString();

I think it is trying to load the data from the token "installed", but it doesn't exist on the JSON file!

Do you know how to solve this so I can verify my account and load data from Google Drive?

Thank you!!

Load data exception

When i use your tool to load my xlsx file, this issue happens

NPOI.POIXMLException: ---> NPOI.OpenXml4Net.Exceptions.InvalidFormatException: Can't read content types part !
at NPOI.OpenXml4Net.OPC.Internal.ContentTypeManager..ctor (System.IO.Stream in1, NPOI.OpenXml4Net.OPC.OPCPackage pkg) [0x00000] in :0
at NPOI.OpenXml4Net.OPC.Internal.ZipContentTypeManager..ctor (System.IO.Stream in1, NPOI.OpenXml4Net.OPC.OPCPackage pkg) [0x00000] in :0
at NPOI.OpenXml4Net.OPC.ZipPackage.GetPartsImpl () [0x00000] in :0
at NPOI.OpenXml4Net.OPC.OPCPackage.GetParts () [0x00000] in :0
at NPOI.OpenXml4Net.OPC.OPCPackage.Open (System.IO.Stream in1) [0x00000] in :0
at NPOI.Util.PackageHelper.Open (System.IO.Stream is1) [0x00000] in :0
--- End of inner exception stack trace ---
at NPOI.Util.PackageHelper.Open (System.IO.Stream is1) [0x00000] in :0
at NPOI.XSSF.UserModel.XSSFWorkbook..ctor (System.IO.Stream is1) [0x00000] in :0
at ExcelQuery..ctor (System.String path, System.String sheetName) [0x00047] in /Users/huytran/Documents/workspace/sumTrack/Assets/Extensions/QuickSheet/ExcelPlugin/Editor/ExcelQuery.cs:41
UnityEngine.Debug:LogError(Object)
ExcelQuery:.ctor(String, String) (at Assets/Extensions/QuickSheet/ExcelPlugin/Editor/ExcelQuery.cs:53)
ExcelMachineEditor:OnInspectorGUI() (at Assets/Extensions/QuickSheet/ExcelPlugin/Editor/ExcelMachineEditor.cs:50)
UnityEditor.DockArea:OnGUI()

Working environment: Mac OSX 10.10.1; Unity 4.5 Pro
Input data is attached as this below link
https://dl.dropboxusercontent.com/u/63045417/map_test.xlsx

Error while importing Excel file data

error quicksheet

This error message is appearing while I'm trying to import from an Excel sheet. There are no empty cell in my sheet. Tried debugging with deleting some rows and columns. Always having an error saying empty cell at LAST column.

Even an older version of the excel sheet is working fine which has lower rows and columns. My excel sheet is multilingual btw.

Mistype

Is:
Create->QuickSheet->Tools->Goolgle
Must be:
Create->QuickSheet->Tools->Google

AssetPostProcessor error CS1009: Unrecognized escape sequence

When generating code from an excel xlsx file using Unity 2018.3.6f1, I get "error CS1009: Unrecognized escape sequence" on the NAMEAssetPostProcessor.cs file.
Apparently the assetFilePath replacement uses Assets\ instead of Assets/
simple to edit and fix in VStudio, but shouldnt be necessary.

GoogleDataSettings reports an error if repository used as SubModule.

If I subModule the repository in an empty project and clone it in a folder "Assets/__submodules/Unity-QuickSheet", it always callback the error as shown on the following screenshot.

If the repository is cloned and then open the project with Unity, there is no error at all.

Would be better if I can submodule then can work from my project then always keep your project up to date :).

capture

Google DLL Version Mismatch

The Google.GData.Client.dll has not been updated for 2 years while all the other dlls have been updated 11 months ago. Downloading and using this project in its current state creates a version mismatch error between the Client.dll and the Spreadsheets.dll. The Client.dll is Version 2.1 while the others are 2.2+

Support inheritance

Support inheritance for the created ScriptableObject derived class.

Already done on my work side, need to port to the github project page.

Using UnityEditor.IMGUI.Controls to display column header on a Import Setting.

There is a new API set, added on Unity 5.6.x, still it is beta stage though, under the UnityEditor.IMGUI.

UnityEditor.IMGUI.Controls seems to be one can replace current column-header setting.

The problem of the current column-header setting is that it works fine but got a bit nasty in the code side.

So, it can be better to change with MultiColumnHeader when it is available after releasing final version of Unity 5.6.x.

Support for Excelfile placed under StreamingAssets folder

I want to place Excel file under StreaamingAssets folder so that after creating exe I can edit the excel file from outside and live link will be established between dta and Unity objects.
I have successfully generated import settings But the moment I re-import it is generating blank scripted asset and throws following error
NullReferenceException
Sheet1AssetPostprocessor.OnPostprocessAllAssets (System.String[] importedAssets, System.String[] deletedAssets, System.String[] movedAssets, System.String[] movedFromAssetPaths) (at Assets/CC_PravinYadav/Excel/Editor/Sheet1AssetPostProcessor.cs:42)

Gathering data as Goolgle Sheet API python does?

It is more question than an issue.

I first made the GoogleSheetAPI integration from Maya with python to manage assets for 3D artists in my team.

GoogleSheetAPI reference :

Now using the same GoogleSheet to build an interface to check and test assets.

1st I made a parser from a local file with set classes, etc.... (from the *.tsv file downloaded via the GoogleSheet interface).

2nd with the GoogleSheetAPI it return value from the cell range value : (rangeName = 'Class Data!A2:E')
It let me get the value in an array. (values = result.get('values', [])
Which I can use the same parser as the local file.

3nd now from Unity, every ready and working the same way as the Maya python script.
But my very last step would be to catch the GoogleSheet data as plain text from an array as the Python API does...

Since you probably gather the data this way at some point, is there a way to access to it?
I actually do not need anything else...

Also would like to access the online data at anytime from C#...

Thank you by advance! :)

unused column

What about unused column?

For example there are 5 columns in "Character" sheet.
"name", "_desc", "ap", "dp", "maxhp"

But I do not want to import "_desc" column into scriptableobject.

Cannot import Google Sheet

It gives me this error after I click import button. I didn't set Google two-stage verification on.

GDataRequestException: Execution of authentication request returned unexpected result: 404
Google.GData.Client.Utilities.getAuthException (Google.GData.Client.TokenCollection tokens, System.Net.HttpWebResponse response)
Google.GData.Client.Utilities.QueryClientLoginToken (Google.GData.Client.GDataCredentials gc, System.String serviceName, System.String applicationName, Boolean fUseKeepAlive, IWebProxy proxyServer, System.Uri clientLoginHandler)
Google.GData.Client.GDataGAuthRequest.QueryAuthToken (Google.GData.Client.GDataCredentials gc)
Google.GData.Client.GDataGAuthRequest.EnsureCredentials ()
Google.GData.Client.GDataRequest.EnsureWebRequest ()
Google.GData.Client.GDataGAuthRequest.EnsureWebRequest ()
Google.GData.Client.GDataRequest.Execute ()
Google.GData.Client.GDataGAuthRequest.Execute (Int32 retryCounter)
UnityEditor.DockArea:OnGUI()

If column name is `value`, the import value will not get assigned

Say I got a excel sheet like

key value
A B
AA BB

The code generated for the value row would be

[SerializeField]
  string value;
  public string Value { get {return value; } set { value = value;} }

Making that value never get assigned. I would suggest adding changing setter to this.value = value to avoid ambiguity.

Default value

Is there a way to set default value to a variable if it's an empty cell when import from Excel?

Out of range error while importing array of enum values

I'm using QuickSheet to import data from google sheets. I've tryed to import array of enum alues. QuickSheet imports data correctly (it whould be much better if you mention about flags ability of enums in documentation... i was expecting an array of enums though flags enum is more correctly). But watching on data scriptable object in Inspector leads to massive oet of range error messages spam. They appear because enumValueIndex in GUIHelper class can't handle whith multivalue enum. If enum property is multivalue the enumValueIndex returns -1 which leads to error message.

I've added some code to solve the problem my way, but i'm not experienced enouth to find professional solution of this problem.

string text = "";

if (prop.enumValueIndex >= 0)
    EditorGUILayout.PropertyField(prop); 
else
{
    EditorGUILayout.TextField(prop.name + " (int value)", prop.intValue.ToString()); 
    text = " => outofrange error";
}

    EditorGUI.indentLevel++;
    EditorGUILayout.LabelField("enumValueIndex = " + prop.enumValueIndex.ToString() + text);

Sorry if doublig...

Support array type.

Support array type which is a string with comma separated form in a cell.

Detecting text cell as numeric cell in excel

I chose a field, in excel machine, which supposed to be string.

The field in excel containing just single numeric value. Eg : '1', '2'

It gives me an error message like: Cannot get text value from a numeric cell Row.

In some way I need the value to be string. So I need to make it a string instead of integer.

I tried to format particular column in excel to Text, but still getting same result, which the plugin recognize the cell as numeric value instead of text value even I choose import as string

Enables 'DELIMITER' to set on the setting file.

Enables 'DILIMITER' which is used to separate each of array element in the cell to set on the setting file.

Someone prefer to use new-line separator than a comma so it may be better to make a user to choose the delimiter on the setting file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.