Search Unity

[Released] G2U 2.1.13 - Use Google Spreadsheets in Unity

Discussion in 'Assets and Asset Store' started by Shane-C, Oct 14, 2013.

  1. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    We are working on that. We've optimized just about everything on our side. Since we are now multithreading the whole process, we are at the mercy of the Google API, and the speed at which it returns data. The old GoogleFu didn't require you to pull information until export time, but since we are now displaying the data and allowing you to change it from within Unity, the process had to change.

    Which version of Unity are you on? We may already have a fix for this. The 5.1 version of Unity deprecated a few things, and the next update addresses this. However I didn't see this particular error so I'd like to try to reproduce it.

    This is a good suggestion, and fairly easy to implement. We have an update that we are trying to wrap up currently that fixes a few bugs, but we'll put this one on the list for sure.
     
  2. ImaginaryChris

    ImaginaryChris

    Joined:
    Nov 25, 2013
    Posts:
    20
    Great work and thanks for the quick answers!

    We are on 5.1.2 if that helps (OSX version). This particular project is pretty simple but we are using the PlayerIO sdk in case that helps to troubleshoot this. https://gamesnet.yahoo.net/download/
     
  3. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Unfortunately we don't have an OSX machine to test on. Could you please email me at contact@litteratus.net if you get a chance to help resolve this?
     
  4. ncroan

    ncroan

    Joined:
    Jul 21, 2015
    Posts:
    5
    Hi Shane,

    The documentation states that OAuth2 is not supported:

    "We attempted to get OAuth2 working with GoogleFu so that your information was guaranteed to be safe, but the current Monodevelop restrictions made it impossible"

    And then the changelog in this thread states in 2.0.7:
    • OAuth2 token retention improved

    Is OAuth2 supported in the current build? I haven't had a chance to use this yet and I wanted to know if I should be creating a dedicated Google account for my project to prevent exposing my personal account to any unnecessary risk.

    Thanks!
     
  5. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    The documentation PDF is out of date. OAuth2 is now mandatory, and therefore we had to implement it. You no longer provide any credentials to G2U, and no username/password is stored locally on your machine.
     
  6. ncroan

    ncroan

    Joined:
    Jul 21, 2015
    Posts:
    5
    Thanks!
     
  7. hmnyari

    hmnyari

    Joined:
    Oct 24, 2012
    Posts:
    4
    I want to know how can i write to spreadsheet in runtime
    I couldnt find about write method in document
    how can I save values at runtime?
    is google2u only for read?
    thank you
     
  8. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Once the values are in game, there is no way to push them back to the Google Doc. The values in the database are read-only.
     
  9. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    G2U version 2.1.0 has been uploaded to the Asset Store!

    IMPORTANT NOTICE

    The default install folder has been changed. This means you MUST remove the previous /Assets/Google2u folder (You may leave your Google2uGen folder in-tact) before you install the newest version. Otherwise you will get a screen full of warnings/errors.

    Notable Changes:
    • G2U now lives in the Standard Assets folder. This means it will not need to recompile along with the rest of your code. This is a huge time-saver!
    • All Using directives have been moved inside of the Google2u namespace to help prevent accidental library collisions.
    • Newtonsoft.Json.net has been removed, and the GDATA libraries that required it have been modified. G2U is now fully compatible with the other JSON.Net libraries
    • JSON Validation no longer requires the ID column to be valid... but it still MUST exist in your spreadsheet! There is now an option to suppress it from the export entirely
    • Path issues and other misc bugs have been resolved
    Documentation is the next big task. It hasn't been updated since 1.x and desperately needs some attention. Until that happens, if you get stuck for any reason, please email contact@litteratus.net if you have any issues whatsoever.
     
    ncroan and tosiabunio like this.
  10. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    There seems to be an issue querying worksheets at the moment.
    I'm currently looking into the problem and will have an update soon.

    Thanks for your patience

    EDIT:

    Looks like this is an issue with the Google API, and they are working on a fix for it. Service may be intermittent until the fix is rolled out. This is unfortunately out of my hands.

    Here is a link to the issue report:
    https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3939&colspec=Stars Opened ID Type Status Summary API Owner#makechanges

    EDIT 2: It seems to be cleared up. Let's hope it stays that way!!

    On a side note.. talk about the worst timing, I just put out an update and I was all concerned that I broke something major! It's a relief that it wasn't my fault this time :p
     
    Last edited: Jul 29, 2015
  11. colinday

    colinday

    Joined:
    Jan 9, 2012
    Posts:
    25
    Just bought this today to help remote collaboration with my story writer who doesn't use Unity but can easily add dialog to a spreadsheet.

    I'm still figuring out my workflow, but one thing I've noticed that would be super helpful for me would be to allow the export paths to be specified as folders relative to the Asset root of the project. This way, when it comes time for me to release the game and I start forking multiple branches from my Perforce source control, I can actually use this tool in each branch properly.

    I would also like a way to say that I cannot edit the data from within the Unity tools, is there a setting for that if not in the tools somewhere in my google sheet? I clicked on the second row in a table, and it auto edited the sheet on google docs, which is not what I want and seems dangerous. Speaking of that second row, if I didn't specify the type row explicitly, it seems that the row was totally missed when exporting to XML data.

    Also, I found it incredibly confusing to get the tools to export a static database because upon installation there was no export path set, and it would not accept an export path at all unless it contained the string "/RESOURCES", which I was only able to figure out by reading your code. New users who don't go that deep might find that frustrating and think the tools are totally broken.

    Lastly, nothing seems to export to XML at all if I have checked to stop on blank row or column ... i assume this means to stop if an entire row or column contains no data ... but checking it seemed to stop the entire process from exporting anything at all. i could only get around this by actually deleting the un-necessary rows and columns in the spreadsheet itself.

    It's a pretty slick tool tho, a lot of work has gone into a nice and quick interface with the auth, account sheets, settings all that stuff ... nice work. I think this will work for me for collaborating remotely with a writer for dialog.
     
  12. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Hey there Colin, I'll address each of your questions/concerns in order

    This would be fine for exports such as XML, CSV, and JSON.. but for the Static and Object databases it won't work at all. Object Databases require a code compile when generating, and Unity won't compile code outside of the Assets hierarchy. I decided to normalize the whole process and made it a requirement for all exports. This is certainly something that can be custom coded to remove the restriction in a case-by-case basis, but for the majority of people this isn't something that I'd put in the base product.

    The only reason you wouldn't be able to edit a sheet is if it's a Manual Workbook and you don't have edit rights to it. All account-based workbooks should be editable. If this is indeed the case, I'd like to get to the bottom of it.

    Yes, I need to make a confirmation box for this. It's on the to-do list.

    This sounds like a bug. I'll look into it.

    If a path isn't set explicity, one should be generated under /Assets/Google2uGen/Static Database/Resources. I'll look into this as well to make sure there isn't a bug. As for the /Resources, again in order for a user to be able to hit Export, and immediately be able to access the class, Unity requires Static Database to be in a /Resources path. At one point I had a message being reported if the path was invalid.. I'll need to look and see what happened to it.

    I'll look into this one as well. As with any piece of software, sometimes changing things has unintended side effects in places that you'd never expect. I don't personally use the XML option, so I'm guilty of not testing it as thoroughly as I should.

    I appreciate it! I'll see about getting those bugs and requests filled as soon as I can. I'm currently working on updating the documentation, but I'll get to them as soon as possible. If you need anything urgently then contact me at contact@litteratus.net
     
  13. TSabos

    TSabos

    Joined:
    Mar 8, 2015
    Posts:
    94
    Has anyone tried this with Windows 10 yet? I keep getting "Execution of authentication request returned unexpected result: 404" no matter what I try. This is no 2 step on my account and this worked prior to upgrading to Win10. I've tried everything including disabling firewall and can't get connected.

    EDIT: Disregard, the version I had was far outdated and didn't RTFM beginning of this thread. I had to make a ton of changes to my source code to get it to compile before it would show the new interface since I did upgrading in a bad order. All is good thanks guys ;)
     
    Last edited: Aug 8, 2015
    Shane-C likes this.
  14. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Documentation has been updated.
    The newest docs can be found here:
    G2U Documentation
     
    tosiabunio likes this.
  15. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    2.1.2 Has been submitted.

    Static DB Auto-Path Generation has been fixed
    XML exporting has been fixed
    Added a confirmation dialog when switching between Row 2 and Type Row
     
    Last edited: Aug 16, 2015
  16. denlee0710

    denlee0710

    Joined:
    Mar 9, 2015
    Posts:
    36
    Hello,

    Is there any way to not have G2U auto query all worksheets when one workbook is selected/loaded? We have a big workbook with many sheets; most times only one sheet is updated and we have to re-import that one sheet, but have to wait for G2U to query and validate all sheets which takes a while. We much prefer the way of the old GoogleFu where you only load/import what you need and takes shorter time. Is there an option for that or could that be added to a planned feature?

    Thanks,
    Dennis
     
  17. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Dennis, This is a planned feature, We are going to implement it like the workbook hiding, where you can choose to turn on/off certain sheets for processing/validation.
     
  18. NSmith

    NSmith

    Joined:
    Jan 23, 2013
    Posts:
    3
    In your documentation you mention samples but I have no Samples folder after import. Im guessing it was left out of the latest package. Can you post them somewhere and provide a link?
     
  19. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Gah! How did that happen??

    The next version of G2U will mark the triumphant return of the sample project. Until then, download this UnityPackage and import it into the same project as G2U and you should be good to go.

    Sorry about that!!
     
  20. Atrixx

    Atrixx

    Joined:
    Feb 8, 2012
    Posts:
    24
    The website has been down these past few days @Shane C
    I hope the project hasn't been forgotten!
     
  21. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    The website is up for me. Is there a broken link somewhere?
     
  22. Atrixx

    Atrixx

    Joined:
    Feb 8, 2012
    Posts:
    24
    Hmmm, it displays a "403 Permission Denied" page for me!
    I'm based in Australia running Safari, OSX. Not sure whats going on though haha
     
  23. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Interesting. As far as I know I'm not blocking Australia. Could you email me at contact@litteratus.net so I can get some more specific information?
     
  24. el_marvo

    el_marvo

    Joined:
    May 13, 2015
    Posts:
    4
    Hi, I'm using GoogleFu with Playmaker and just realized that the created playmaker actions don't allow me to access Arrays. Are there plans to support those for Playmaker in the (hopefully near^^) future?

    cheers
     
  25. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    We are going to look into supporting the ArrayMaker extension for Playmaker. The biggest holdup is that we don't personally use Playmaker at all. It is on the list of things to do though. I don't have an estimate at this time for how long it may be before ArrayMaker is supported, unfortunately.
     
  26. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Hi there,

    I noticed in a WebGL build that G2U alone took 12 mb in size after building. I checked the code and structure, and found that you use resources folder to store Editor UI assets.

    Would it be possible to move these assets to "Editor Default Resources"? This way those files won't take 50% of my build size and we will all live in a better world.

    Cheers,
     
  27. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Yes. The next update will have them there. I had assumed because they were under an Editor folder, they would be ignored. I was very wrong.
     
  28. alexandre-fiset

    alexandre-fiset

    Joined:
    Mar 19, 2012
    Posts:
    715
    Thanks for the quick answer!

    To be fair, I also assumed the same thing and a lot of other devs did too. Unity simply build all resources folders regardless of where they are...
     
  29. el_marvo

    el_marvo

    Joined:
    May 13, 2015
    Posts:
    4
    Thx for the quick reply, I'll be keeping an eye out for that. Until then I'll set up a workaround.

    cheers
     
  30. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi

    Any ideas why it will not let me upload an excel file .xls to google drive. Finder is showing all xls files as gray?

    cheers

    Nalin
     
  31. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Hmm.. not sure exactly. I just tried it on my PC and it worked just fine. Which platform are you on?
    The workaround is to manually import the excel spreadsheet into your google drive. There is no extra magic going on with the G2U import.. it's doing exactly the same thing.
     
  32. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Mac - i uploaded via google anyway

    no probs
     
  33. sdmartin87

    sdmartin87

    Joined:
    Mar 24, 2014
    Posts:
    2
    Hi, I'm trying to create a script that can look at any static database I create and search it to find information. All of the databases have the same column headings. The problem is that since each database script has unique classes based on the spreadsheet name (artdb.row, animaldb.row, etc) I can't have a single variable that can swap out the row information from different databases. Instead I figure i'll have to create unique search methods for each database and have them switched in and out of a delegate based on which database I need to access. I was hoping that as the developers, you might have a better idea for how to do this more simply? Any suggestions would be welcome. Thanks
     
  34. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    I would like to help you with a solution to this, but I think it may be a little more complicated than it needs to be if we are doing this via forum. Email me at contact@litteratus.net and lets figure out the best solution for the problem at hand.
     
  35. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    I found weired phenomenon.

    Editor/Resources folder is always included to final build.
    I tested by building for android target with Unity 5.2.2

    So, tons of assets in Googld2u/EditorAssets/Resources/Docs/*.jpg is included to final build now
    and makes build bloated.
    Shane, could you check it?
     
  36. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    This is fixed in an upcoming version. See 4 posts above for the proposed fix, and this is exactly what is needed to resolve the issue. It does take a bit more work than simply moving the assets though, so if you can wait for the update, I'll have it done in the next week or two, I'm working on a new feature that is halfway done as well.
     
  37. jderrough

    jderrough

    Joined:
    Apr 1, 2011
    Posts:
    6
    Hi,

    I'm currently evaluating Google2u and tried to import a very simple document (see screenshot attached) as an Object Database. A 'Google2uDatabase' was created in the hierarchy with no component attached, and two 'Sheet1.cs' files were added to the project's assets (one under 'Editor', the other under 'Resources').

    More importantly, the console keeps logging a NullReferenceException in Google2u.Google2u.Update().

    Here is an excerpt of the console log:
    ---------------------------------------------------------------------------------------------
    Looking for Database Script: Sheet1
    UnityEngine.Debug:Log(Object)
    Google2u.Google2u:Update()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ---------------------------------------------------------------------------------------------
    Found Database Script at: Assets/Google2uGen/ObjDB/Editor/Sheet1/Sheet1.cs
    UnityEngine.Debug:Log(Object)
    Google2u.Google2u:Update()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ---------------------------------------------------------------------------------------------
    Found Database Script at: Assets/Google2uGen/ObjDB/Resources/Sheet1/Sheet1.cs
    UnityEngine.Debug:Log(Object)
    Google2u.Google2u:Update()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ---------------------------------------------------------------------------------------------
    Sheet1: GetAssemblyType returns Google2u.Sheet1
    UnityEngine.Debug:Log(Object)
    Google2u.Google2u:Update()
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    ---------------------------------------------------------------------------------------------
    NullReferenceException: Object reference not set to an instance of an object
    System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:1890)
    System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:1873)
    System.String.Format (System.String format, System.Object[] args) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System/String.cs:1868)
    Google2u.Google2u.Update ()
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorApplicationBindings.gen.cs:270)
    ---------------------------------------------------------------------------------------------

    Please advise.

    Thanks in advance.
    Jonathan
     

    Attached Files:

  38. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Hey Jonathan,
    The spreadsheet looks fine, I'll take a look ASAP. It looks like the string builder is failing for some reason, perhaps grabbing a null string. I'll have to debug it to get to the bottom of it. I'll keep you updated.
     
  39. pchuri

    pchuri

    Joined:
    Aug 18, 2014
    Posts:
    12
    Hello, I have used G2U 2.1.2.

    My build always includes the resources of G2U (Assets/Standard Assets/Editor/Google2u/EditorAssets/Resources/Docs/*.jpg).

    Why don't you move resources to other folder and use AssetDatabase instead of Resources.Load??
    Thank you.
     
  40. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    These will be relocated in the next update.
     
  41. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    G2U have the feature that 'void' type column is ignored in export.
    But, when I export all worksheets by pushing the disk button in Account Workbooks section, void type column is sometimes exported.
    It's ok when I pushed the disk button in individual worksheet window.

    Please fix this.
    Thank you.
     
  42. Emre_U

    Emre_U

    Joined:
    Jan 27, 2015
    Posts:
    49
    Got this on my fresh import . Will I survive? I have poured to much time to my project already and seeing this red warning is giving me creeps of worst kind.

    Error importing folder (The pathName assets/standard assets is already mapped to e965ae00268627c44b1b9cd12f2b831c. But the meta data wants it to be mapped to 51d8386c069b67b49ad226a3ff365e4d)

    Also it is complaining about (yellow warning)

    Assets/Standard Assets/Editor/Google2u/Google2uAccountWorkbook.cs(282,44): warning CS0618: `UnityEditor.EditorWindow.title' is obsolete: `Use titleContent instead (it supports setting a title icon as well).'

    I am using Unity 5.2's latest one but not 5.3 yet. In the finishing steps of the project.
     
  43. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Sorry about the delayed reply, I've had a very long past few weeks with the Christmas/New Years holiday, and I spent a lot of time away from G2U, and with my family. I hope you understand.

    The `UnityEditor.EditorWindow.title' is obsolete warning can be ignored for now. It's a 1 line change in the G2U code, and I'll have it fixed in the next update.

    The Standard Assets error however, I'm not entirely sure why you are getting that. It can be overcome however. Simply import G2U into a brand new project, and copy all of the files over manually. It would seem you already have an Assets/Standard Assets folder, and the package importer doesn't like that G2U also needs to place assets inside of it.
     
    johanneskopf and Emre_U like this.
  44. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Version 2.1.3 is uploaded to the Asset Store. It will be available shortly
     
    johanneskopf likes this.
  45. johanneskopf

    johanneskopf

    Joined:
    Feb 16, 2015
    Posts:
    81
    Hey,
    Tried your asset today for the first time, and I think it will help me a lot managing game data, thanks for that!
    But something is wrong with the import, I tried to import my data to an object database and got that error:

    So the values of my int column couldn't be parsed to an string?
    I used two times "50" as input.
    But the second time i pressed generate, everything worked fine.

    Hope you can fix this, and if you need it I can provide my used worksheet too.
    John
     
  46. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Hey John, please email me at Contact@litteratus.net and I'll see if I can figure out what went wrong. It's possible that the latest release had some unintended side effects. I'd like to test your dataset directly so I can get a reproduction ASAP
     
  47. CrunchingKoalas

    CrunchingKoalas

    Joined:
    Mar 29, 2011
    Posts:
    51
    We're experiencing the same error right now, is there any way to bypass this bug? Our spreadsheet is full of VOID keywords and it's gonna take a lot of time to get rid of these.

    Please let us know.

    Cheers,
    Tom
     
  48. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Tom, that bug is specifically what 2.1.3 was meant to fix. Are you still having the issue with 2.1.3?
     
  49. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Waaaaaaait a minute. I just reproduced the issue. It's specifically tied to the way we are processing sheets in the Account Worksheet view.

    I'll have this fixed shortly!

    Version 2.1.4 has been submitted. The Object Database Void Column issue should be fixed.
     
    Last edited: Feb 4, 2016
    johanneskopf likes this.
  50. CrunchingKoalas

    CrunchingKoalas

    Joined:
    Mar 29, 2011
    Posts:
    51
    Thanks for such a fast reply!

    Not sure what do you mean - does it mean the "VOID issue" has already been fixed? I just tried the 2.1.4 version and it still exports the "VOID" columns into my dictionary.

    I'm using Unity 5.3.1p4 , G2U 2.1.4 and I'm exporting the spreadsheet to an XML file.

    Cheers,
    Tom