A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Assets and Asset Store' started by Shane-C, Oct 14, 2013.
That's great to hear!
Hey Shane just tried to import a new workbook but I'm having a problem. Basically when I change the type to int G2U still asks for the data the start with a letter. Also as soon as I switch the type, the validate icon flickers like crazy. Any ideas? Thanks.
The far left column is an ID column. It's used for variable names in code. This particular column must contain unique id's for each row, and one of the rules is that it must begin with a letter.
In your case, you can simply use ID_0, ID_1, etc..
Thanks, I've been using G2U for ages but never realised this haha.
This is... extremely surprising!
Unless you are using the JSON export.. in which case there is an option for "Ignore ID column".. BUT it still must exist!!
G2U keys off of it internally as well, and if it doesn't contain unique ID's, G2U gets very moody.
Yeah I'm using object databases and for each one I've done so far it's made sense to have the first column as a string ID.
But for the one I did recently I thought I didn't need it and I would just access them via the order they are in, in the spreadsheet, e.g. .GetRow(0), or something. If that makes sense haha.
I've just picked up the asset and so far it seems quite nice! I was wondering though if there's a reason you store everything in a list as opposed to static variables? That way I could access a row like Dialogue.ID_0.English?
I'm thinking about writing my own editor script to generate this, but I'm not sure how I can find the name of each column? You've stored rows, but not the column strings.
The implementation can be easily changed. Each export type has it's own class and you can change it however you like. They are basically just code generators. We chose this method due to it being a lot easier to write the generators to work in all cases.
The column names are the actual variable names in the MySheetNameRow class that is generated. (Prepended with an underscore to help prevent conflicts.. code generation is tricky)
Ah yes, that makes sense! Well I don't really want to fiddle around with your source, as it'll be overwritten in updates, so I'm going to make a second script to scrape the database you generate and just generate me a class for my uses.
Is there anything special I need to do to make sure nothing from G2U ends up in my final build? As in, where can I put your generated database etc., so I don't store everything twice in a build?
Well it depends. Are you exporting as an Object Database? If so, you are going to have to make a new exporter because all of the data ends up in a GameObject in your scene. If you are using a static database, then there is 1 class that is generated as a file. There is one (tiny) base class that the Object Database relies on, that is included in the final build, other than that the only things that ship with the product are the files you generate from G2U. None of the other code/resources are included whatsoever.
Honestly I've been considering rewriting the way I handle exporters, so if you want to write your own, I'll make sure to work with that in mind, and try to make it as painless as possible to update. Just make sure you write your own class.
No worries! In case you're interested, I'll pop what I wrote below. It runs through the Unity assembly and finds any classes that implement IGoogle2uDB. Of course it's quite specific to my requirements (every sheet needs to have the same columns, e.g. "English", "French" etc., but can have different rows). It generates one base class, which is a 'row', essentially. And then creates static variables for each row of each spreadsheet, separating sheets into their own classes. (So you can have 'Dialogue', 'UIText' etc.) The implicit operator is temporary and will eventually reference my localisation manager.
You'll need to make a folder in Assets/: /0 - My Game/Scripts/Localisation/
Place the script in an Editor folder anywhere (probably in the aforementioned Localisation directory), and ensure that G2U saves the object database to the default location. (It's deleted after this script is run.)
Then just go to the top menu and run My Game -> Generate Localisation File.
Side note: Is there a reason you are logging finding the editor assets folders? I'd love an option to turn this off, as I like to try and keep my console clear where possible, hehe.
That particular log may be unnecessary now. You are safe to remove it.
I'm having an issue with a null error message on any new Google2U action I create within Playmaker. I've tried creating new and copying older actions as well as whole states that have worked in the past and are actually still working. But the copied version is getting the null error and Playmaker is not completing the action. Oddly, when running the program I see that the variable are correctly being showing up (eg database name and row name), but the variable that holds the data value is showing up as zero.
I did have a freeze in Unity that required a force quite about the time this problem started, so I'm not certain if that could have anything to do with it.
Too, I have been making a number of changes within the Google database, but I've refreshed the database (pressed icon that looks like an old floppy) and validated that the row and column names align with what I'm calling within Playmaker.
Any help you can provide would be helpful.
Honestly this is a tough one. I can't really say for certain what could be happening here, but if you contact me directly we can try to sort through the problem. firstname.lastname@example.org is where you can reach me. Be sure to send whatever you are comfortable sending, and send me a link to your spreadsheet so I can try to reproduce the problem on my side.
A couple of quick requests that would be nice if added;
- Enum type. For static generation; if specified, it will grab the unique values from this column, and produce an enum containing the values. (similar to what's done in the ID column, albeit allowing multiple re-uses)
- The ability to strip the _'s from prepended to property names in generated classes. I get they're there to avoid collisions with either internal properties, or c# keywords; but it'd be nice to have a checkbox and produce cleaner code.
I'll see what I can do with the next release. Sounds relatively easy.
sorry, i've written a private message, reply didn't seem to work, but it's ok now
I've read the manual, but i can't seem to find how to export to files TO spreadsheet so i can edit the values and import them back in unity.
Is there any option for auto-refreshing the data as part of the normal build process? So far, I only identify the workflow of me manually refreshing each of my worksheets every time I want to load a data change. When fine tuning over several builds, this can get cumbersome.
I actually came here for the same thing. I love the possibility to offer easy tweaking to my team through spreadsheets, but it can be quite frustrating to wait for the queries to finish. I'm not sure if a constant auto refresh is the best idea, because at some point the values in a table probably won't all be valid. I would love to see a scripting interface that I can use to automatically refresh the tables with the options I have first chosen in the gui window.
That way I could for example connect that to a build prehook in order to be sure that the values are in sync with the most recent spreadsheet.
Is there maybe a way to already do this, that I have missed? Sadly the documentation doesn't include that much information on how to access g2u functionality directly.
€dit: Oh by the way, could you please change the name of the topic to the most recent version numer as well as changing the assetstore link back to forum.unity.com (It still is community.unity.com). I got kind of lost while searching for the right thread.
Was this project abandoned? No feedback for over 2 months? I get the feeling that the competitor (https://www.assetstore.unity3d.com/en/#!/content/15570) might be the better choice to buy.
Is anyone aware whether it's possible to retrieve a rowId from row data?
The constructor seems to take in an _ID but doesn't bother to store it anywhere. I'd rewrite the class, but it's being generated every time I update my spreadsheet.
Hi @Shane-C ,
First off, G2U is outstanding! My studio abandoned our own internal Google Sheets importer after we saw how much better G2U handled the task.
In the past we typically used integer ids for our rows and exported the data as JSON. With G2U we encountered the requirement where ids must be strings. Am I correct in assuming this is to support exporting data as Object Database and/or Static Database? Is there a way to circumvent this requirement if we only intend to export the data as JSON?
For now, I am working around this limitation by creating a column titled "dummy" of type "string" whose values are simply the relevant row cast to a string, then in G2U enabling the "Ignore ID Column", and finally using column B as our actual id column. Since the dummy values are numeric and ought to break the export process if they were used as variable names, I infer that these values are not actually relevant to this export case, yet are enforced all the same.
Thanks for great asset. lol
When I export data as NGUI localization, g2u makes Localization.csv under folder named NGUI.
but NGUI [UI Localize] script cannot recognize, because it's not under [Resources] folder
I wonder why doesn't g2u makes Resources.
(I also exported as StaticDB, at that time it makes files under StaticDB\Resources)
I'm using NGUI 3.11.1, Unity 5.5.0f, latest version of g2u
I've used this tool in several projects but in the latest one all a sudden every single import results in hanging Unity requiring a force quit in windows (all projects use 5.5.0f3). I have to wipe out my Google2uGen\StaticDB\Resources folder completely before every "save" I do from the editor window or else it hangs. Ever seen this before?
Hi, I'm trying to use Google2U on my game, but it will be a WebGL game, and G2U does not communicate with Google using this build target, is there any way to solve this?
@Shane-C , all,
Is this Asset still supported and does anybody know if it works still with Unity 2017 and latest Google Drive?
Also, presume if I want to reference resources like textures or other GOs or audio clips say I would use string columns with the resource path strings?
@Duffer123 I do still support G2U through email, and there are no issues with 2017 that I've seen. GameObjects can be referenced by name, and if you use GameObject in the type row, code will be generated for finding the object in the scene and returning that instead of a string. Keep in mind this does use GameObject.Find, so don't abuse it
2.1.13 is available in the Asset Store
Includes official Unity 2017 support (Fixed a deprecation warning), and the ability to export CSV, JSON, and XML files to a single subfolder rather than making a subfolder for each sheet. The option is in the Sheet Settings under Formatting Options.