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
    2.0.6 has been released to the Asset Store, and the Free version has been uploaded. This should fix the Manual Workbook issues.
     
  2. Pocatcom

    Pocatcom

    Joined:
    Sep 12, 2012
    Posts:
    1
    How can I save the settings of the manual workbooks? I want to use settings of the manual workbooks in another PC.
     
  3. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Currently there is no way of transferring settings from one PC to another. We have a task related to this, and expect to get the feature in by the next version or two. For now, you will just have to set up the Manual workbook settings on both PC's.
     
    golmae likes this.
  4. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    You're likely still going to run into issues, especially with AOT / IL2CPP platforms and Windows Store / Phone / Universal builds.
     
  5. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Dustin, thanks for chiming in. G2U is an editor-only utility.. so nothing gets shipped in the final builds. My only concern is conflicting with your version of Json.net.
     
  6. golmae

    golmae

    Joined:
    Mar 6, 2015
    Posts:
    1
    Thank you!
     
  7. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    That shouldn't be an issue. It happens from time to time with other assets and I just tell people to remove the Newtonsof.Json.Dll which will cause the assets to automatically use my asset and it works like a charm. If you'd like to test compatibility send me a PM.
     
  8. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    2.0.7 has been uploaded to the Asset Store

    • This version will improve the Google OAuth2 token retention (It should refresh your token properly now)
    • Also, added the ability to hide Account Workbooks from the view, so if you have particular workbooks that are not used in your project associated with your account, you are now able to hide them appropriately. (Individual worksheet visibility is not yet implemented)
    • And the preferences are no longer stored using EditorPrefs. Instead, it saves a binary file with all of your settings (Google2u/Editor/g2uPrefs.bin) that can be transferred to other computers. You are able to load preferences files through the settings. For backwards compatibility, it will still load your old settings that reside in EditorPrefs if it hasn't been set through the new methods.
     
    golmae likes this.
  9. denlee0710

    denlee0710

    Joined:
    Mar 9, 2015
    Posts:
    29
    Hi, it seems the workbook import does not support byte array. I'm on latest version. Please fix.
     
  10. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    What version of json .net is that google stuff dependent on? I haven't had a chance to check it out yet.
     
  11. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    I'll take a look ASAP

    The one I found to work with both Unity and Google is version 40r8 compiled for .NET 3.5
     
  12. Wawro01

    Wawro01

    Joined:
    Apr 23, 2014
    Posts:
    37
    I've just updated to newest version and i must say I'm quite disappointed. We are using Object database for the most sheets. Firstly it looks like that StopOnBlankRows dont work. When I check it, it shows that sheet is not valid (please see screenshot). Also, when switching between sheets all have the same Game Object Database. Is it possible to have sheets from workbook on different objects ? And last question is about NGUI legacy, is this not supported anymore ?
     

    Attached Files:

  13. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    You're also probably going to run into issues with multidimensional arrays as well. :/. Ok ill make sure I get it looked at tonight.
     
  14. propeller

    propeller

    Joined:
    Jul 2, 2012
    Posts:
    204
    Hello,
    I'm using a vector2 data type in my spreadsheet, unfortunately G2U always tells me that it cannot convert
    it to a vector2. Vector3 works fine though.
    This is how I'm writing the vector2: 2.0, 2.0
    Am I missing something?

    thanks
     
  15. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    I'll look into it. It looks like the validation is still looking at the row headers to make sure they are valid, and in your case they wouldn't be (They contain spaces). If StopOnBlankRow is set, it shouldn't be doing this. I'll have it fixed for 2.0.8

    Unfortunately not automatically. You can export each sheet individually, and change the export object each time, but I realize that is a pain. I can put this on the task list, but I can't promise it by the next version. We would have to re-think the UI design and how we do the settings for the different exporters.

    NGUI Legacy is no longer supported. The last version of NGUI to use that method is well over a year old, so we decided to cut it.

    I'll look into this tonight and get back to you. Chances are it's a bug, and I'll have it fixed for 2.0.8


    I'm looking at releasing 2.0.8 ASAP. There are a few small issues here and there that absolutely should be fixed. One in particular is how G2U is failing to save preferences in some cases. This is very important, and I understand the urgency. Look for it tonight or tomorrow morning on the Asset Store.
     
  16. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    2.0.8 has been uploaded to the Asset Store

    G2U will now save preferences properly in all cases
    Byte arrays are once again properly supported
    Vector2 will once again validate properly
    CSV export will automatically enclose strings with commas, quotes, and newlines with quotes
    Rows will not attempt to validate past blank rows if "Stop on Blank Row" is checked
    Sheets will automatically be re-validated when changing options

    There have been many bug reports and feature requests in the past couple of days, I am juggling this with my day-job right now which is very demanding of my time at the moment. If there is still something out-standing that needs to go in, I'm already looking forward to the 2.0.9 release. I thank you all for your patience. I know that when you purchase an asset, you expect it to work 100% and while G2U is not perfect, we do the best we can to stay on top of it!
     
  17. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    Nah, nearly all software has bugs of some kind, especially young software. I've been maintaining my asset for a couple of years and still run into occasional bugs for some scenario that I didn't expect. Keep up the good work! Your customers only care about the bugs if you're disengaged and you're clearly not.
     
    chelnok likes this.
  18. Wawro01

    Wawro01

    Joined:
    Apr 23, 2014
    Posts:
    37
    Thanks for that :)

    This is really big issue for us at the moment. We were successfully using 1.05 version of google fu, where it was supported actually. We are storing upgrades for game units in sheets. Where there is one sheet per one unit. Each unit has link to database object ... We have already 80 sheets. It would mean for me as a developer to redesign core of the game in the time when we are going to publish. Is there any way to take old 1.05 googleFU and make it work with new google authentication ?

    This is pitty too. We are in developing process of game for more than year and half and decided not to update NGUI (We made many major improvements which would be difficult to merge with new version).
     
  19. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    email me at contact@litteratus.net
    We'll try to work something out with you
     
  20. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    I have uploaded 2.0.9 to the Asset Store
    This added a null check to fix an issue with new projects. Everyone should update to this version to prevent a lockup when the G2U window is opened.
     
  21. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    2.0.10 has been uploaded to the Asset Store

    This version brings back Legacy NGUI support. I've had some requests to bring it back, so it is now an option in the NGUI Export.
    Also, this version allows you to set a Game Object for the Object Database Exporter per sheet. This is an override to the existing global setting.
     
  22. Sinmantky

    Sinmantky

    Joined:
    Aug 3, 2011
    Posts:
    9
    Hi

    I just imported the free ver of 2.0.10, linked it to my Google, and created a csv file (NGUI and normal CSV) from within Unity. So I think I'm on the right track.
    Howeever, my Playmaker does not recognize GoogleFu, thus not allowing me to use any of the PM actions. Furthermore I don't see the PM in Settings>Paths (The UI in the package and the documentation is different).

    Any idea?

    Thanks.
     
  23. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    The documentation that is built into G2U is a lot more accurate than the public docs (I still haven't had time to update, and G2U is rapidly changing, so keeping up is difficult).

    In order to enable Playmaker Action generation you will need to export as an Object Database. But before you actually do export, you'll need to check the "Generate Playmaker Actions" option in the Game Object Database Creation Options (In the sheet edit view).

    upload_2015-6-8_8-47-24.png

    If that is checked, the Playmaker Actions will be generated automatically

    upload_2015-6-8_8-48-22.png

    As for the paths, It's in Settings->Export Paths->Playmaker Export

    upload_2015-6-8_8-49-52.png
     
  24. Sinmantky

    Sinmantky

    Joined:
    Aug 3, 2011
    Posts:
    9
    Thanks for the reply.

    After exporting it via Object Database, I managed to get the Playmaker actions and set a state up with the corresponding Col Headers and Type Rows. I can also see it in the Google2U window.

    However once i press play, no data is retrieved. I looked into the files in /ObjDB/Resources/example and found out that the Data Cells weren't in there. Meaning, no data is being retrieved to the PlayMaker Action

    As an experiment, I exported it using StaticDB and looked at the output file, and in it, I saw that it had all the data cells that were missing in the Object Database.

    So my question now is; are the data fields supposed to be exported with /ObjDB/Editor/example or is it somewhere else?
     
  25. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    The data is stored in the GameObject itself. The script that is attached simply facilitates accessing the data. If you click on the GameObject in the hierarchy, there is a custom inspector attached that will allow you to see the data in the GameObject.
     
  26. Sinmantky

    Sinmantky

    Joined:
    Aug 3, 2011
    Posts:
    9
    Thats what I thought, but the generated database object doesn't have a script/component attached.

    This is the example scene supplied with GoogleFu.
    GoogleFu1.png
    As you can see, there's a small icon on the right of the generated DB game object (Google2uDatabse)

    But If i create a new scene with a new database object, I don't have the icon and I don't see a component attached...
    GoogleFu2.png

    I guess it's a bug in the free ver?

    Lemme buy the full version and see if it works.

    Regards
     
  27. Sinmantky

    Sinmantky

    Joined:
    Aug 3, 2011
    Posts:
    9
    yea, the full version works, where as the free version didn't.
    I think it's a bug
     
  28. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Thank you for the detailed troubleshooting, I'll look into it.
     
  29. mzamara

    mzamara

    Joined:
    Nov 18, 2014
    Posts:
    8
    Hey Guys!

    I'm using the paid version of G2U, and I'm having a hard time following the documentation provided. I've set up my google sheets correctly, and was able to get them imported into G2U as an Object Database, but when trying to actually access the data I'm coming up completely short.

    My Google Doc: https://docs.google.com/spreadsheets/d/12xDp0dXgpx3EQJEQSw9e4ypY9Hieww0UHcp8pZ5gs3E/edit?usp=sharing

    Screenshot of my Project:


    If someone could walk me through (ideally using my data as the example) the basic code necessary to do the following I would be more than appreciative:

    1. Count how many rows are in a sheet (QuestionData or AnimalData)
    2. Select 1 Row of Data (at random is fine) that I can access the properties for.
    3. Get a value from the selected row of data (Ex: QuestionText from QuestionData or Name from AnimalData).

    If there's more information needed or something very obvious I'm missing, please feel free to let me know.

    Thanks!
     
  30. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    This doesn't surprise me. I really need to get back on top of that...

    Ok, so looking at your spreadsheet you should have generated a Game Object in your hierarchy that contains your database script. I'm going to assume it's named "QuestionData"

    So, the first thing you'll do is create a member variable in your class that you can use to access your database script.
    Code (CSharp):
    1. private Google2u.QuestionData _Database;
    Then, in Start(), look for the database object, and when you find it, get access to the script itself.
    Code (CSharp):
    1. void Start ()
    2. {
    3.         var databaseObj = GameObject.Find("Google2uDatabase");
    4.         if(databaseObj != null)
    5.             _Database = databaseObj.GetComponent<Google2u.QuestionData>();
    6. }
    Then, whenver you need access to anything, go through the _Database object.

    Code (CSharp):
    1. var numRows = _Database.Rows.Count;
    2. var firstRow = _Database.Rows[0];
    3. var specificRow = _Database.GetRow("ID_HASHUMP");
    4. var rowText = specificRow._Name;
     
    NatCou likes this.
  31. mzamara

    mzamara

    Joined:
    Nov 18, 2014
    Posts:
    8
    Wow, what a fast reply! This looks to be exactly what I need (well, I need to write it in C#, but that won't be too difficult).

    Can't wait to give this a try when I get home later tonight.

    Thanks!
     
  32. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    That is C# code ;)

    Also, emailing contact@litteratus.net is a direct line to my cellphone. I just so happened to be looking at the forum when you posted.. :cool:
     
    mzamara likes this.
  33. mzamara

    mzamara

    Joined:
    Nov 18, 2014
    Posts:
    8
    since when does C# use var? :) Every example i've ever seen that uses var is for javascript, hence my assumption
     
  34. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,562
    For quite awhile now. :) The typing is determined at compile time.
     
    mzamara and Shane-C like this.
  35. mzamara

    mzamara

    Joined:
    Nov 18, 2014
    Posts:
    8
    I see! Thanks again. I'll continue sharing my progress of things as I go, and any other feedback I have :)
     
  36. mzamara

    mzamara

    Joined:
    Nov 18, 2014
    Posts:
    8
    Just plugged in everything, and it worked perfectly. Thanks again!
     
  37. denlee0710

    denlee0710

    Joined:
    Mar 9, 2015
    Posts:
    29
    Hello,

    I'm currently using latest version of Google2u, and mainly use it to import in JSON format. It is a little annoying that even importing sheets in JSON, the auto cell validation still enforces that row header need to start with a letter and cannot be, say an int. In addition, rules are still enforced even on void rows and columns.

    Could you make the rule enforcement more lax for JSON or add a bypass option so we can still import?

    Thanks,
    Dennis
     
  38. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    110
    I second that. We could also get rid of the ID column with specific format which is also not necessary for JSON exported data (at least for me).

    But optional validation wouldn't work as I appreciate validation for my other columns.
     
    Last edited: Jun 24, 2015
  39. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Gentlemen I'm working on the next version.. just getting some kinks ironed out.
    The optional validation is at the top of the list of things to do!

    I've also relocated G2U to the /Standard Assets/ folder. This was a private request from another user, and the result has worked out so well that I feel that I need to make it official. The long and short of the reasoning behind it, anything in Standard Assets will not recompile unless necessary. So that means when you change a script in your project, Unity will never decide that it needs to recompile G2U along with it (Which means generating Object Databases becomes much faster as well).

    I've somewhat solved having to use an old version of Newtonsoft.Json.dll with the help of another customer. So now any version of Newtonsoft.Json.net will work (iOS users rejoice!)

    There are a few other changes, such as how I'm determining locations of files and such that I've also improved.

    A little more testing and I should be ready to release another version VERY soon.

    Thanks for all of your suggestions!
     
    tosiabunio likes this.
  40. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    I am using Json.Net and G2U is colliding against it.
    After deleting Newtonsoft.Json.dll, try to login.
    Then exception happens:

    FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=4.0.5.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies.
    Google.GData.Client.OAuthUtil.GetAccessToken (Google.GData.Client.OAuth2Parameters parameters)
    Google2u.Google2u.DrawLoginGUI () (at Assets/Google2u/Editor/Google2uGUI.cs:284)
    Google2u.Google2u.OnGUI () (at Assets/Google2u/Editor/Google2uGUI.cs:1056)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
     
    Last edited: Jun 24, 2015
  41. netics

    netics

    Joined:
    Aug 23, 2011
    Posts:
    102
    If I don't delete Newtonsoft dll, then login failed.
    The error message is below:

    Google2u: There is a problem with your credentials. Clear the credentials and Re-Authorize G2U
    UnityEngine.Debug:Log(Object)
    Google2u.Google2u:Update() (at Assets/Google2u/Editor/Google2u.cs:317)
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()


    It seems that this error is not related with Json.Net.
    I just can't login to google with G2U.
    But it's also true that G2U collide against Json.Net.
     
    Last edited: Jun 24, 2015
  42. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    110
    I'm using Json.Net (the one from the Asset Store) and there's no conflict with G2U in my case.
     
    Dustin-Horne likes this.
  43. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    netics: Is this using the latest version of G2U? Free or paid? Which platform do you have Unity set to? Did you try using the interface to clear your token? If you prefer, I can help you one on one if you email me at contact@litteratus.net
     
  44. dnoparker

    dnoparker

    Joined:
    Aug 28, 2013
    Posts:
    63
    Can you by any chance do something like a video tutorial on the basics? The documentation is hard to figure out!
     
  45. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    It's in the works. I have never put together a video document before, so I'm trying to learn the ropes.

    Meanwhile are you hung up on something in particular?
     
  46. hmnyari

    hmnyari

    Joined:
    Oct 24, 2012
    Posts:
    4
    I'm using Unity5.1.1f1
    when I download g2u from assetstore, script upgrade window appearred.
    I push upgrade button and unity is freeze. I tried several times. same result.
    didn't appear another assets.
    would you please tell me how can I fix this ? help please
    thank you
     
  47. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    I'll look into this!
    It seems 5.1.1 may have deprecated a function for something (I hate it when that happens!)
     
  48. Shane-C

    Shane-C

    Joined:
    Nov 9, 2012
    Posts:
    211
    Ok that was easy enough.

    From the Unity 5.1.0 release notes:
    • Editor: Adding an icon to an EditorWindow title is now exposed by using the GUIContent 'titleContent' property (the old string 'title' is now obsolete)
    So they deprecated EditorWindow.title, which I use in a few spots in the code.
    I will have a fix for this shortly, in the meantime if you can't get it working:

    In approximately these places (Depending on the version of G2U you have)
    Google2uAccountWorkbook: Line 247
    Google2uManualWorkbook: Line 252

    The line:
    ed.title = WorkbookName;

    change it to:
    ed.titleContent.text = WorkbookName;

    And in Google2u.cs: Line 226
    The line:
    Google2uWindow.title = "Google2u";

    change it to:
    Google2uWindow.titleContent.text = "Google2u";


    The next version of G2U will have these, and a few other issues fixed.
     
  49. royalgia

    royalgia

    Joined:
    Oct 26, 2014
    Posts:
    12
    Why not load directly spreadsheet from ur PC but use Google service ? im still confusing, it just use spreadsheet as database, correct ? and all it do is retrieving data from spreadsheet from Google Drive then build the whole database offline with that data online before complete the final build of the game ? So isn't it obviously that we can import spreadsheet directly from our PC offline ? :rolleyes:o_O
     
  50. ImaginaryChris

    ImaginaryChris

    Joined:
    Nov 25, 2013
    Posts:
    20
    We just updated to the latest version, from GoogleFu and have a few comments:

    1. Loading of google spreadsheets is very slow (a lot slower than the first GoogleFu). We have about 11 tabs in Google Spreadsheet, and it takes a while to load all of them. Will this be fixed in the future?

    2. Error message : Unable to load the icon: 'UnityEditor.PreviewWindow'.
    Note that either full project path should be used (with extension) or just the icon name if the icon is located in the following location: 'Assets/Editor Default Resources/Icons/' (without extension, since png is assumed)
    UnityEditor.PreviewWindow:OnEnable()
    This bug happens whenever the project is run.

    3. Suggestion: Worksheets Full View. Awesome, but perhaps it would be a good idea to show a prompt before automatically adding the variable type row. I clicked on the arrow (on the 2nd row), and it suddenly overwrote the first entry in my data (and even in the Google Spreadsheet), could be dangerous as someone can just accidentally click this and lose that row in their spreadsheet.
     
unityunity