Home
Combining Unity with Google Spreadsheets User Manual Version
Contents
1. Once you are logged in the screen will show the currently logged in account name and a Log Out button If Save Credentials is unchecked when you log out this will clear all account data stored and you will have to re inout your username and password to access your account again 16 Using Manual Workbooks Optional lf you are planning to use a published workbook you will need to tell GoogleFu how to access this workbook You will need to first have the URL of the published workbook to let GoogleFu know where it is located If you have authenticated with your Google credentials GoogleFu will have access to your workbooks and this step is purely optional The Workbook you are attempting to access must be public and published to the web If you are attempting to access a workbook that is private you will need to authenticate with Google to view it To set the workbook to public open it in Google open the File menu and select Share In the Sharing Settings dialog you will need to change the access type by clicking the Change link Sharing settings Link to share only accessible by collaborators https docs google com spreadsheet cec key Share link via I Qt f y h Who has access Frivate Only the people listed below can e Change ka F you you gma Is owner Invite people ons Change 17 Another dialog will appear allowing you to select the sharing settings Choose Publ
2. Language S ID PATHS Paths 10 ID TOOLS Tools 11 ID HELP Help l2 ID HELP MAIN Main 13 ID HELP LOCAL Localization 14 ID HELP DB Database 15 TN GFNFRATF PATHS Butnamatirallu Create Pathe Use the NGUI UlLocalize script to designate a row ID for the UlLabel and the NGUI Localization script to load the languages 31 English g Unity Untitled GoogleFu_NGUI PC Mac amp Linux Standalone Initializing Please wait French g Unity Untitled GoogleFu_NGUI PC Mac amp Linux Standalone File Edit Assets GameObject Component NGUI Window Help Initialisation S il vous plait patienter 32 Using GoogleFu with Playmaker If Playmaker is present in the project GoogleFu will recognize it and allow you to generate Playmaker actions as part of the Object Database Export GoogleFu looks for a specific file that Playmaker provides GoogleFu Once you have activated a workbook and selected a worksheet to export as a GameObject Database you will be given the option to generate Playmaker Actions for the database GoogleFu 33 When you have generated the database create a Playmaker FSM on a Game Object and open the Action Browser A new option will be available for GoogleFu and the Action that has been generated will be named after your worksheet Actions Color Convert Debug Device Effects GameObject GoogleFu Get Character Stats Data GUI GUIElement
3. gt GoogleFu EA D irartis Dinara llann facwele W bian D Wamra ma kat Unity Untitied Unity Googie PL Mac amp Nux j a Standalone ie File Edit Assets GameObject Component Tools Asset Store Tools Wir do Next Window Ctrl Tab Previous Window Ctrl Shitt Tab Layouts Scene Ctrl 1 Game Ctrl 2 Inspector Ctrl 3 Hierarchy Ctrl 4 Project Ctrl 5 Animation Ctrl 6 Profiler Ctrl 7 Asset Store Ctrl 9 Version Control Ctrl 0 Animator Lightmapping Occlusion Culling Navigation Console Ctrl Shiftt C You will be presented with the GoogleFu window GoogleFu o x Authentication Optional Google User Name Pid Google Password eee eet Save Credentials Auto Log In At the top there are four tabs Settings Workbooks Tools and Help The Settings tab will be highlighted and you will have 3 options on the left side Credentials Language and Paths 13 Setting up Paths in GoogleFu Click the Paths button and you will see the following screen GoogleFu Automatically Create Paths Enable GameObject Database Generation Enable Static Class Database Generation E _ Enable XML File Generation Enable JSON Object File Generation Each of the options allows you to enable exporting of a specific type of database But before GoogleFu will allow you to export anything you must select appropriate folders within yo
4. GUILayout Input ITween Level Lights Logic Material Math Mesh Movie Network Photon Physics PlayerPrefs a i RenderSettings ScriptContral 7 i Get Character Stats Data Gets the specified entry in the CharacterStats Database Preview Add Action To State 34 You will need to supply the object that you attached the database to via a Playmaker GameObject variable playMaker Wariables eto hp opoe Soa statsD atabase CharacterStatsDatabase 35 Any data you wish to retrieve from the database will also need to be stored in variables Wariables My GoblinName Once you supply the State with the relevant information all you need to do is Play once the action is executed all of the data will be pulled from the database and placed in the variable S 36 Source Code Third Party and Copyright information We want to be 100 transparent when it comes to GoogleFu accessing your personal Google Account and allow you to rest at ease that there is nothing shady going on behind the scenes so the full version of GoogleFu has not been compiled into a DLL Always always keep a backup of your data GoogleFu does overwrite existing files when it generates the database The DLL s that are included with GoogleFu are redistributed as part of the Google GData API They have not been modified in any way and full source code for the API is avail
5. Workbook Logging into your Google account with GoogleFu Optional In the Credentials page under the Settings tab you will find a standard login dialog Here you will input your Google user name and password This step is optional because you are also able to manually enter published workbook url s as well The reason you would want to use your Google account is to allow GoogleFu to access workbooks that are privately associated with that account GoogleFu authentication Optional y Google User Name LitBuild gmail corm W Google Password eh a Save Credentials J Auto Log In The Save Credentials option will let GoogleFu store your credentials so you do not have to manually enter them each time you open the GoogleFu window Note that this is a security risk The way GoogleFu stores your credentials is in plain text in the registry This means the username and password is available to anyone who knows where to look The Auto Log In option is only available if Save Credentials is checked This will allow GoogleFu to automatically authenticate with Google every time the window is opened Note that authentication is done synchronously and may stall the loading process until GoogleFu has successfully authenticated If you are experiencing what seems like a freeze when opening a project with the GoogleFu window visible then you may want to uncheck this option and authorize with Google only when necessary
6. a small independent studio consisting of two industry veterans We have been professionally employed in the Video Games Military Simulation industries for over 8 years and Litteratus is our hobby Together we have worked for companies and have credits on over 15 different games for PC Nintendo DS and PSP and are currently working in the Rendering and Visualization field GoogleFu is a product of our hobby work and a tool that we developed to assist in our own creations We decided to productize it as we believe it would be useful to anyone not just Litteratus itself Getting Started Setting up GoogleFu for your project Signing up for a Google account Whether you decide to provide GoogleFu with your authentication or not this step is mandatory You must have a Google account in order to use GoogleFu If you already have a Google account and wish to use this account with GoogleFu you may skip to the next step You can create a new Google account at the following website Google Account Creation Once you have navigated there using the web browser of your choice you will need to create an account Fill in the following form with your account information A Google Accounts e C fi 8 https accounts google com SignUp Google Create a new Google Account Family a my heart is here cousin Romai Your Google Account is more than just Search Take it all with you Share a little Or share a lot Work
7. activated a workbook and you will see a page that lists all of the available worksheets contained in the workbook Each sheet is exported individually You are able to select which worksheets are going to be exported and which format the data will be in once it is exported ee x GoogleFu o kas Active Workbook GoogleFu Example Open URL Deactivate G Export Worksheets Localization w Sheet Export Selected Click the checkbox next to each sheet you wish to export and you will be presented with options for the format types available to you GoogleFu m Active Workbook GoogleFu Example Open URL Deactiwate Ill Export Worksheets ry W Localization W Export Worksheet as a GameObject Database W Export Worksheet as a Static Database File W Export Worksheet as an XML File W Export Worksheet as a JSON Object File Sheet Export Selected 22 Choosing an export type GameObject Database A GameObject that contains a generated script will either be created for you or you may specify a GameObject to attach the script to The data from the worksheet will be inserted into the GameObject via this generated script and be retrieved using functions generated in the script Option Use first row as Value Types The first row of the worksheet can be used to specify value types string int etc If this option is used the data structure t
8. as a quaternion shorthand 1 0 2 0 3 0 4 0 color color32 Fo o C D OD oe But what about insert another common data type here such as Short Why doesn t GoogleFu support that Unity has issues serializing some data in MonoBehaviors Even common data types such as char are not supported We only support data types that fit the following criteria Common Generically useful Easily edited inside of Google Spreadsheets MonoBehavior is able to serialize natively This rules out some data types such as Matrix A Matrix is a common data type but since Unity uses quaternions almost exclusively when describing rotations and it s very difficult to work out what a matrix is doing from inside a single cell of a worksheet we do not support it Using Arrays within individual cells GoogleFu allows a smaller subset of the available types to be converted to arrays of that type Actually List lt T gt to allow for further expansion when importing into Unity Arrays will need to be delimited by a character that you choose inside of GoogleFu Typically the comma is used however in the case of Strings another delimiter may be necessary Choose the delimiter in the Tools menu before importing the data from Google The delimiter will need to be consistent across all arrays in the Spreadsheet Trim Strings y Trim String Arrays Array Delimiters String Array Delimiters Complex Type Delimiters Complex Arra
9. containing the code for a JSON object is generated with the data from the worksheet CSV File A Comma Seperated Values formatted file is generated with the data from the worksheet 23 NGUI Localization If NGUI is installed in the project this option is available This will export data from the worksheet in a format that NGUI uses for localization Note It is up to the user to ensure the column headers are in a format that NGUI recognizes Daikon Forge Localization lf Daikon Forge is installed in the project this option is available This will export data from the worksheet in a format that Daikon Forge uses for localization Note It is up to the user to ensure the column headers are in a format that Daikon Forge recognizes i E 7i GoogleFu Active Workbook GoogleFu Example Open URL f Deactivate E Export Worksheet as a GameObject Database ee Export Worksheet as a Static Database File e Use first row as Value Types wv Export Worksheet as an XML File wa Export Worksheet as a JSON Object File Sheet2 Export Selected k Export Worksheets m Iwi Localization Once you have chosen an export type and any options that export type has available you can click the Export Selected button to generate the files and or GameObjects that contain the data from your worksheet The generated files will be written to the directories you have set up in the Paths page
10. happened We are more than willing to help get you back up and running immediately and will update GoogleFu with a fix as soon as possible contact litteratus net Change Log 1 0 10 Generated Code Added a property for the number of columns in a Row Row Lengbth Added the ability to get the string value of a Row using the bracket operators Arrays Added support for data arrays in individual cells GUI Added the ability to choose delimiters for single cell arrays Added an option to trim whitespace on strings Added an option to trim whitespace on string arrays Export Added the option for CSV export directly Compatibility Restricted GoogleFu from operating under invalid build targets Updated Manual Workbook support to work with the new URL generated when you publish to the web Removed support for char short and double value types Bug Fixes When generating an object database if an error is detected the generation will stop immediately and report an error Quaternions are now displaying correctly in the Editor Improved some error conditions and debug output 1 0 9 Compatible with NGUI 3 5 0 and greater NGUI lt 3 5 0 still supported through the use of a Legacy checkbox 1 0 8 Added more Playmaker actions to assist in retrieving data 39 Added a ToString function to Rows to print out all data within the row 1 0 7 Fixed an authentication issue when shared workbooks are marked as private read only 1 0 6d Fixe
11. under Settings 24 Accessing your data After exporting the worksheets you will want to access your data Depending on how you exported this is done in different ways The XML and JSON files are designed to be used with other tools or read into your game manually The NGUI Localization files are used by NGUI directly and the NGUI Localization documents will illustrate how to use it The GameObject Database and Static Database have generated functions that allow you to access the data Below are examples on how to use them GameObject Database Data Retrieval A GameObject Database is an object that exists in the scene and has all of the database information stored within it It contains a script that is generated by GoogleFu that provides access to the data contained in it You can access the data by first gaining access to the script The code below is a snippet from the GoogleFu Sample Example of an Object based Database CharacterStats _statsDb Since our database exists within an object in the scene we ll need to find it Alternatively you could expose the database as a public member and use the inspector to set it GameObject statsdbobj GameObject Find databaseObj if statsdbobj null Get the CharacterStats component out of the GameObject CharacterStats is the name of the worksheet in the google spreadsheet that we are getting the monster information from _statsDb statsdbobj GetC
12. a Type method will only work if exporting to an Object Database or Static Database void int 300 Wizard l E Data Types supported by GoogleFu The following Data Types are directly supported by GoogleFu Good Example Bad Example float Floating point number designated by a whole number or a 3 14159 3 14159f whole number followed by a period and then another 1 234 cat whole number using the character f after the number will 3 0 1 2 cause an error int 32 bit signed whole number 1 21474836499 Range 2147483648 to 2147483647 512 3 23 unsigned int 32 bit unsigned whole number 3 1 Range 0 to 4294967295 512 false 1 C Same as boolean shorthand false 3 0 An 8 bit signed integer value a aa Valid range 128 to 127 33 9000 string A series or array of Characters basically anything goes Its hard to break this 123 one An array of two floats delimited by a comma vector2 6 9 vector3 An array of three floats delimited by a comma 102030 blue 32 9 8 7 1 0 vector Same as a vector3 shorthand 3 6 5 10 99 bottle beer Array of 3 float values Red Green Blue cast as a Color 0 5 0 1 0 2 200 200 200 inside of Unity Valid range for colors 0 0 1 0 Array of 3 unsigned character values Red Green Blue 200 200 200 1 0 1 0 1 0 cast as a Color32 inside of Unity Valid range for colors 0 255 quaternion Array of 4 float values cast as a Quaternion inside of 1 2 3 4 r g b a Unity Same
13. a is going to be strings anyway Google has a handy formula for automatically translating cells GoogleTranslate value from language id to language id So using the following example GoogleFu Example File Edit View Insert Format Data Tools Help Mommens Tx STRING ID So ew TT 6 123 Arial Sent Cong ia 2 D_INITIALIZING ID_ AUTHENTICATING ID_ IMPORTING MESSAGE 5 ID SETTINGS 6 ID WORKBOOKS 7 ID CREDENTIALS amp ID LANGUAGE 9 ID PATHS 10 ID TOOLS 11 ID HELP 12 D HELP MAIN 13 ID HELP LOCAL i14 ID HELP DB 15 IN GFENFRATF PATHS If you want to translate the cell B2 from English to French you would use the following in Cell C2 GoogleTranslate B2 B51 C 1 Google Spreadsheet uses the Google Translate functionality internally and is not a feature of GoogleFu If you have a large enough string database and are localizing for many languages you will find that sometimes Google will stop translating This is because it only allocates so much time to do translations A way to resolve this is wait for the sheet to fully load in Google and search for N A on the page It will show you cells that have not been fully resolved If you add or remove a space in the English cell it will attempt to resolve only the dependent cells Repeat this process for any unresolved cells 12 Opening GoogleFu When you start GoogleFu for the first time by opening the Unity Editor and selecting Window
14. able through Google NGUI is copyrighted by Tasharen Entertainment Playmaker is copyrighted by Hutong Games Daikon Forge is copyrighted by Daikon Forge Google is copyrighted by wait for it Google Tell your friends about GoogleFu We are a couple of guys just trying to make a living not some huge faceless corporation Also please rate us on the Unity Asset Store if you like GoogleFu If not let us know and we ll try to fix the problem http www litteratus net FAQ GoogleFu is saying that my login is invalid but KNOW my credentials are correct This can happen in the case of having 2 step authentication turned on in your Google account We recommend that you set up a Google account specifically for your project and leave 2 step authentication turned off Can I use GoogleFu to access my Google Spreadsheet at runtime No GoogleFu is strictly a Pre Build process It simply streamlines pulling the information from a Google Spreadsheet and saving it in a way that is easily accessible from the game Communication with Google can sometimes be very slow and is not suited for real time network traffic Aside from that it would also require you to place your Google Credentials directly into the code which is a huge security risk SQL databases that are accessed via PHP scripts on a webserver is the fastest most secure way to handle runtime database access 3 What is the difference between the Full version and the Free versio
15. adsheets is able to import many different types of files including xls xlsx ods csv txt tsv tab Am required to use a Google account to use GoogleFu Short answer No Long answer It s recommended yes The majority of GoogleFu s functionality revolves around accessing the account of a user and allowing the user to select individual pages of a workbook to import into the Unity project While you are able to manually add public published workbooks and pull the data from them this would mean that anyone who knew where to find your workbooks could access them By providing GoogleFu with your account information it is able to access your private workbooks Isn t using my Google account a security risk Only if you choose to save your credentials in the GoogleFu editor All of the source code for GoogleFu is exposed We chose to do this as a verification of trust GoogleFu itself isn t doing anything with your account information other than providing it to the Google API where necessary However if you choose to save your credentials it is saved in the registry as plain text so that you do not have to provide them the next time you open the window By manually logging out these values are cleared and GoogleFu will not save them 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 Who is Litteratus Litteratus is
16. ata from a Row Samples Using the exported data as NGUI Localization files Using GoogleFu with Playmaker source Code Third Party and Copyright information FAQ GoogleFu is saying that my login is invalid but KNOW my credentials are correct Can use GoogleFu to access my Google Spreadsheet at runtime What is the difference between the Full version and the Free version Do have to use my Google account What does GoogleFu do exactly Does this mean my game must contact Google Can use GoogleFu entirely offline Can use GoogleFu at runtime Can update my spreadsheet from inside of Unity am getting a crash What do do Introduction What is GoogleFu GoogleFu is a tool that works from within the Unity editor to assist in the creation of database like objects or files and provide the means to access this data from within Unity All of the processing and network access is done prior to building the game so there is no file access and no network communication needed once the game is built Why do I need this The use of spreadsheets allows you to better visualize data in relation to other entries By creating spreadsheets using Google Spreadsheets directly or by using other popular spreadsheet formats you are able to design and create a data driven workflow for your game very quickly and easily GoogleFu provides the mechanism to quickly interpret the spreadsheets and writes custom classes to either access directly or t
17. d an issue with Color not being properly generated in the custom editor script 1 0 6c Removed all using directives to maximize compatibility 1 0 6a Fixed a bug in the Database Object creation Fixed index out of range exceptions with static databases 1 0 6 Fixed an issue with bools in the spreadsheet They are now properly supported Changed a backslash to forward slash when exporting NGUI Localization Mac compatibility Added an option to JSON exporting to choose between automatically escaping Unicode characters or not 1 0 5 Moved DLL s into the Editor directory to prevent them from being included in final builds Added support for Diakon Forge localization file export If you have previously installed GoogleFu updating this package will NOT remove the old DLL s from the project You must manually remove all DLL s contained in the Assets GoogleFu directory or remove GoogleFu from the project entirely and re import This will not remove any of your saved settings 1 0 4 Fixed issues regarding Vector2 Vector3 and Quaternion types in the Custom Inspector code generation 1 0 3 Rearranged file structure to remove icons from being included into final builds Removed a Using directive from a file that was causing build issues 1 0 2 Recompiled the NewtonsoftJson dll It should play nice with other plugins now 1 0 1 Initial version 40
18. eFu can assist in uploading that to Google Spreadsheets by using the Upload Workbook page in the Workbooks tab GoogleFu Upload Workbook ae Upload Google is able to process the following file types xls xlsx ods csv txt and tsv Use the folder icon to browse to a Spreadsheet and click the Upload button Uploaded spreadsheets may use Untitled as the name until you change it manually in Goog 20 Activating a Workbook To export data from a workbook you will first need to activate the workbook you plan to export from In either the Account Workbooks or Manual Workbooks page under the Workbooks tab you can activate a workbook by clicking the Activate button next to the entry GoogleFu When a workbook is activated it will turn grey in the list and appear above the main tabs To deactivate the active workbook you may either click the Deactivate button in the active workbook above the tabs or simply activate a different workbook 21 Exporting data from a Google Spreadsheet Once you have an active workbook and the export options are set up in the Paths page under Settings the Tools tab will become available The Tools tab is where you will be able to export the data from a Google Spreadsheet and optionally import it into Unity as a Object based or Static database Selecting Worksheets to export Select the Tools tab once you have
19. hat is generated will be strongly typed based on the values in this row This saves having to convert data from strings at runtime Option Use the DoNotDestroy method on the generated GameObject If you initialize a database and wish for the database to remain loaded indefinitely using this option will ensure the GameObject is created once and will not be destroyed between scenes Option Select an existing GameObject to attach the Database to You may choose a GameObject from the scene to attach the generated script to or leave it as None to automatically create a databaseObj GameObject Option Generate Playmaker Actions lf you have Playmaker installed this option will be available to you Automatically generate Playmaker actions that assist in accessing data from your Database Static Database A file will be generated that contains a singleton that you may access from other scripts All of the data from the worksheet will be inserted into a generated data structure on creation of this singleton class Option Use first row as Value Types The first row of the worksheet can be used to specify value types string int etc If this option is used the data structure that is generated will be strongly typed based on the values in this row This saves having to convert data from strings at runtime XML File An XML file is generated with the data from the worksheet JSON Object File A file
20. hrough a game object in the scene What are some examples of how to effectively use GoogleFu One of the most common uses for Spreadsheets is string localization Google Spreadsheets provide a formula to assist in translating entries from one language to another This may not be a perfect translation but it s enough to get you started And because Google allows you to collaborate with others seamlessly providing a localization team the spreadsheet is very easy Once strings are translated GoogleFu will be able to import the localized strings into the project and be ready to access within seconds Another use is creating templates for units in your game loot tables item stats enemy stats asset file mapping and much more Imagine creating Al for your game and being able to visualize and tweak health speed and other stats of each unit without editing a single line of code Or adding all of your sound hooks in the game by ID and being able to change which sound is being played by simply editing an entry in a spreadsheet Where does the data come from You provide all of the data needed There are a few rules to follow when creating a spreadsheet but it is up to you to provide any type of data you wish Whether your spreadsheet contains a single column of information or hundreds GoogleFu will be able to handle it What spreadsheet formats does GoogleFu support GoogleFu will only access Google Spreadsheets directly however Google Spre
21. ic on the web option If you wish to allow anyone to edit the workbook publically you may select the Can edit option or leave it as Can view if you simply wish to allow GoogleFu to access the data Sharing settinas Visibility options gt Public on the web Anyone with the link Anyone who has the link can ace Can edit _ Can comment Can view Access Anyone no sign in required Can view eb Learn more Cancel Learn more about visibility Save and exit the dialog Next you will need to publish the workbook To find the published workbook URL open the spreadsheet in Google and open the File menu and select Publish to the web File Edit View Inset Format Data Share Mew Open Ctl 0 Rename Make a copy Import See revision history Ctrl Alt Shitt G Spreadsheet settings Download as e Publish to the web Email collaborators Email as attachment m Print Ctrl P 18 You will then see a dialog that gives you options for publishing the worksheet Leaving all of the options as defaults and choosing the Publish Now option Google will generate a URL for the workbook Publish to the web Control publishing his document is published to the web Automatically republish when changes are made Stop publishing Note Publishing will make this content viewable by anyone who has the published link but will not change the document s shar
22. in the future Name Choose your username prefer to use my current email address Create a password Confirm your password Birthday Month Gender lam Mobile phone eS Your current email address Prove you re not a robot Skip this verification phone verification may be required 73 Type the two pieces of text Sign in Accessing your Google Drive Once you have created your new account you will be able to sign into your Google Drive This is where all of your Google Spreadsheets will be located The online access is provided free of charge and you are given a few gigabytes worth of space to save all of your work It is cloud based and can be accessed anywhere from any computer with access to Google provided that you authenticate with Google and log in to your Google Drive Your Google Drive can be accessed from here Your Google Drive The landing page for your Google Drive should look similar to this A My Drive Google Drive xX ao amp C fi https drive google com pli 1 amp authuser 0 my drive 4 You Search Images Maps Play YouTube News Gmail Drive Calendar More Google laa you gmail com v Drive srt m Meet your Drive Then go for a spin My Drive is the home for all your files With amp e Explore the left hand navigation gt My Drive G l oogle Drive for your PC you can sync files Create Google Docs and more Shared with me from your compu
23. ing settings Learn more Get a link to the published document Document link Embed code lt iframe eres httrm e MVedaecce nnanloa comlfenrasgdehoate ds AOTH Al Piet Al ef lors a Or share this link using Qt wI f y h lii Close The URL in the Document Link box is the URL that you will be giving GoogleFu Copy it from the box Once you have published the workbook return to the GoogleFu window and navigate to the Manual Workbooks page of the Workbooks tab There you will paste the URL obtained from Google into the box and click the Add button The workbook will appear under the Manual Workbooks heading Manual Workbooks AdvancedDatabase Open URL Add Workbook Manually Open URL 19 Using Account Workbooks Optional If you have authenticated with your Google Credentials the workbooks associated with your account will be available in the Account Workbooks page of the Workbooks tab GoogleFu account Workbooks l GoogleFu Example Open URL Activate AdvancedDatabase Open URL Activate Mental Localization OpenURL Activate SimpleDatabase Open URL Activate LitTemplate Open URL Activate To quickly open the workbooks for editing you can use the Open URL button and it will open in your web browser Uploading Workbooks Optional If you have a spreadsheet on your drive Googl
24. k GoogleFu Combining Unity with Google Spreadsheets User Manual Version 1 0 12 LITTE RATUS A Copyright 2014 Litteratus LLC http www litteratus net Email googlefu litteratus net Introduction What is GoogleFu Why do need this What are some examples of how to effectively use GoogleFu Where does the data come from What spreadsheet formats does GoogleFu support Am required to use a Google account to use GoogleFu Isn t using my Google account a security risk Who is Litteratus Getting Started Setting up GoogleFu for your project signing up for a Google account Accessing your Google Drive setting up a Spreadsheet so GoogleFu can parse it Ignoring Specific Columns Rows Data Types supported by GoogleFu Using Arrays within individual cells Using a Spreadsheet for Localization Opening GoogleFu setting up Paths in GoogleFu Setting the GoogleFu language Optional Authenticating with Google and selecting an Active Workbook Logging into your Google account with GoogleFu Optional Using Manual Workbooks Optional Using Account Workbooks Optional Uploading Workbooks Optional Activating a Workbook Exporting data from a Google Spreadsheet selecting Worksheets to export Choosing an export type GameObject Database Static Database XML File JSON Object File NGUI Localization Daikon Forge Localization Accessing your data GameObject Database Data Retrieval Static Database Data Retrieval Retrieving Column D
25. msRow myRing itemsDb Rows int ltems rowlds ITEM_ RING string RingName1 myRing _ NAME string RingName2 myRing GetStringData name 28 Samples Included with GoogleFu is an example spreadsheet that you can upload to your Google account This example has 3 worksheets to illustrate the syntax you should use when creating your own GoogleFu compatible spreadsheets The example is located at Assets GoogleFu Samples Data SampleDatabase xlsx You do not need to be able to open this file locally in order to use it Simply use the Upload Workbook page in the Workbooks tab to upload it to Google and let Google take care of opening it Also you will find a sample that uses both Object Database and Static Database to generate dynamic game objects This example is located at Assets GoogleFu Samples Scenes DemoScene This is a bare bones example of how to use the databases once exported Simply load the scene and click the buttons to generate a Game Object with data from the database aq Unii File Edit Assets GameObject Component Tools Asset Store Tools Window Help CE oe RIFI Lae Ean H o Wil ji et IL Goblin Random 29 Using the exported data as NGUI Localization files If NGUI is present in the project GoogleFu will recognize it and allow you to export the database as NGUI Localization files GoogleFu looks for a specific file that NGUI provides GoogleFu O
26. n The Free version of GoogleFu is limited to exporting 10 Row x 10 Col spreadsheet It is designed to allow you to use the plugin in it s full capacity but restrict the amount of data it will process If you only need a 10x10 spreadsheet then go nuts there are no other restrictions The Free version of GoogleFu is also compiled into a DLL where the Full version contains all of the raw code files Do have to use my Google account No you are not required to sign in with a Google account You can make any of your personal spreadsheets publicly accessible and GoogleFu will be able to import the data However if you do allow GoogleFu to authenticate it will be able to access private spreadsheets tied to your account What does GoogleFu do exactly GoogleFu retrieves data from Google Spreadsheets and formats it in a way that is easy to retrieve in your game This makes a Data Driven design extremely efficient and also allows you to very easily localize all of your strings and retrieve them by using a string ID Does this mean my game must contact Google No GoogleFu does all of the data retrieval outside of your game and packs it up into files or stuffs all of the data into a GameObject in your scene This is all done prior to running the game so there is no communication with Google at runtime Can I use GoogleFu entirely offline No GoogleFu utilizes the Google Spreadsheets API and requires access to the Google Docs cloud in
27. nce you have selected an Active Workbook you will be given the option to export as NGUI Localization Files GoogleFu 30 The following illustrates what will be generated if the Legacy option is checked This is only for old versions of NGUI The newer version requires a CSV file and is generated instead of the individual txt files if the Legacy option is unchecked When you export these files they will be created in the path you have specified Dev D GoogleFu_LNGUI Assets GoogleFuGen NOU wo Search M A Name f Date modified Type size a af tet 9 24 2013 11 20PM__TXT File 19 KB lad ar tet 9 24 2013 11 20PM TXT File 23 KB lait be tet 9 24 2013 11 20PM TXT File 29 KB B bg bet 9 24 2013 11 20PM TXT File 29 KB lad ca tet 9 24 2013 11 20PM TXT File 20 KB lait cs tet 9 24 2013 11 20PM TXT File 18 KB lat cy bet 9 24 2013 11 20PM TXT File 19 KB lait de bet 9 24 2013 11 20PM TXT File 20 KB lait en tet 9 24 2013 11 20PM TXT File 18 KB lait es t 9 24 2013 11 20PM TXT File 20 KB X et het Q 9A4 9N1211 9N DMA TYT File 17 KR Each file is written in a format that NGUI expects for proper localization 1 Flag Flag en zZ ID INITIALIZING Initializing Please wait 3 ID AUTHENTICATING Authenticating with Google Please wait 4 ID TMPORTING MESSAGE Importing Database Please wait 5 ID SETTINGS Settings 6 ID WORKBOORS Workbooks 7 ID CREDENTIALS Credentials a ID LANGUAGE
28. omponent lt CharacierStats gt Once you have access to the script accessing the data is simple To access entire rows use the code below The rowlds enumeration is generated from the first column of the spreadsheet It serves as a lookup table for accessing specific data rows _statsDb Rows int CharacterStats rowlds Al_ TROLL J You can also access data randomly _statsDb Rows Random Range 0 _statsDb Rows Count J 25 You may also use the GetRow function GetRow accepts either the rowlds enum _statsDb GetRow CharacterStats rowlds Al_GOBLIN I GetRow also accepts a string _statsDb GetRow Al_ GOBLIN Object Databases can be used in conjunction with Playmaker and also have custom inspector that is generated to view the data Character Stats Script ID AI GOBLIN NAME Goblin SPAWNNUMERS 3 ma BOOLTEST FLOATTEST STRINGTEST VECTOR ZTEST VECTORSTEST COLORTEST COLOR32TEST QUATTEST x 0 3 Y De VECTOR ZARRAYTEST x1 VECTOR3ARRAYTEST x Y ii COLORARRAYTEST COLORSZ4ARRAYTEST QUATARRAYTEST 26 Static Database Data Retrieval A static database is not tied to a GameObject but rather a static class that can be accessed anywhere The data is stored in a variable inside of the class and is populated when the class is instantiated Static databases should be instantiated at load time not during gameplay as it does take time to populate the database The code bel
29. order to retrieve data However you absolutely can create your spreadsheets offline using Excel OpenOffice or other programs and GoogleFu will assist in uploading those files to Google Docs when it s time to import them into your game Can use GoogleFu at runtime No GoogleFu is strictly an Editor Extension and is in no way included with the final build of your game Google can sometimes be extremely slow and accessing it at runtime would introduce security issues between your game and your google account For runtime access of a database recommend looking into a web hosted SQL server with PHP scripts to access it It s much faster secure and designed for this purpose 38 Can update my spreadsheet from inside of Unity No Not yet anyway We are working on it Currently GoogleFu is a one way street Data is taken from your Google Spreadsheet and custom classes are generated on the fly Currently we do not send modified data back to Google as this would require a lot of book keeping inside of the project in order for the custom generated classes to understand how to put the data back We are working on a solution to this and although promising introduces a lot of potential to destroy spreadsheets We are not comfortable with this compromise and when the kinks have been ironed out we will update GoogleFu with this capability lam getting a crash What do do Please contact us We want to know exactly what you did when the crash
30. ow is a snippet from the GoogleFu Sample Example of a Static Database ltems _itemsDb The Items database is a Static class Use it by grabbing the Instance this will ensure the database is correctly initialized Larger databases may take a while to initialize so grabbing an instance before the game is updating is recommended _itemsDb Items Instance To access entire rows use the code below The rowlds enumeration is generated from the first column of the spreadsheet lt serves as a lookup table for accessing specific data rows itemsDb Rows int ltems rowlds ITEM_ RING You can also access data randomly _itemsDb Rows Random Range 0 _itemsDb Rows Count You may also use the GetRow function GetRow accepts either the rowlds enum _itemsDb GetRow Items rowlds ITEM PANTS GetRow also accepts a string _itemsDb GetRow ITEM PANTS 2 Retrieving Column Data from a Row The generated scripts contain variables that are named from the column headers in the spreadsheet The names have been altered to ensure proper variable names but are very similar You will want to open the generated script to verify the column names To access the data you have a choice of accessing it directly or by using the GetStringData function which will return a string value Regardless if the variables are strongly typed or not Accessing a specific value from a row can be done multiple ways lte
31. ter to My Drive i ee e See files at a glance with the new grid view Starred e Get the Google Drive mobile app Recent More My Drive Download Drive for PC TITLE OWNER LAST MODIFIED AdvancedDatabase Shared me Aug 31 me SimpleDatabase me Jul 21 me Setting up a Spreadsheet so GoogleFu can parse it Spreadsheets have 2 basic column types ID Columns and Data Columns The values in ID Columns will be the way that GoogleFu indexes the data for retrieval The values in Data Columns is what will be retrieved when accessing the database In addition to columns there are 3 Row types Header Data Type and Data rows e The first row in the spreadsheet will always be the Header row this contains the variable names of your data e The second row is the Data Type row and is completely optional If your spreadsheet contains a Data Type row the final data classes will contain strongly typed values of the types specified otherwise they will be simple strings and it will be up to you to convert them if necessary e The remaining rows are the Data rows and contain all of your data entries into the spreadsheet io ae i Edit View Inse Ignoring Specific Columns Rows You can tell Googlefu to ignore an entire column or row by using the keyword VOID as the column header or row id Alternatively if you are using the Data Type row you can use the keyword VOID or IGNORE to skip that column Either way is fine but using the Dat
32. ur project path to export the generated files Every time you export file names are generated based on the contents of the spreadsheet you will be overwriting the existing files Choose directories that are safe to automatically generate files in GoogleFu will warn you if a path you have chosen is invalid and as a precaution require you fix it before it will function The Automatically Create Paths button will set up all of the paths for you A Directory called GoogleFuGen will be created and all generated files will be placed in subdirectories of this folder 4 ca Dev D a di _GoogleFuProejct 4 Assets dJ Editor GoogleFu a di GoogleFuGen J JSON J NGUI a ObjDB Ji Editor P Resources 4 StaticDB d Resources J XML J NGUI Playmaker di Resources di Library di ProjectSettings 14 Setting the GoogleFu language Optional Click the Language button and you will see the following screen GoogleFu GoogleFu has utilized a Google Spreadsheet and Google Translation to localize the plugin itself You may choose a language to use for GoogleFu by choosing an option in the drop down box Google Translation is not a perfect localization for every string and the result is only an initial rough translation Workbook names and Sheet names are pulled directly from Google and will remain in the language that is in the Google Spreadsheet 15 Authenticating with Google and selecting an Active
33. y Delimiters Array Delimiters apply to all arrays with simple values Byte Array Boolean Array Int Array Float Array The default delimiters for Simple Values are comma and space Example GoogleFu_ID TestSimple Integer GoogleFu_ Type Int Array ID Test01 1 2 2 String Array Delimiters only affect String Arrays The default delimiter for String Arrays is the pipe Example GoogleFu_ D TestSimple string array GoogleFu_Type String Array ID_ Test02 Hello Hola Bonjour Complex Type Delimiters apply to Complex Values Vector2 Vector3 Color Color32 Quaternion The default delimiters for Complex Values are the comma and space Example GoogleFu_ D TestSimple Vector3 ID Test02 1 0 2 0 3 0 10 Complex Type Array Delimiters apply to arrays of Complex Values Vector2 array Vectors array Color array Color32 array Quaternion array The default delimiter for Complex Value Arrays is the pipe Example GoogleFu_ID TestSimple Vector3 Array GoogleFu_ Type Vectors array ID _ Test03 1 0 2 0 3 0 1 1 2 1 3 1 The following Data Array Types are directly supported by GoogleFu Quaternion Array of Quaternions If anybody actually uses this want to know Email good luck array me at Contact Litteratus net 11 Using a Spreadsheet for Localization If you are setting up a Localization spreadsheet you will not need to use the Data Type row as all of the dat
Download Pdf Manuals
Related Search
Related Contents
SBE 9plus Manual Progress Lighting P4530-80 Installation Guide MegaRAID 320 Storage Adapters User's Guide Manual of Brushless Motor Speed Controller Bosch Appliances GVS1000 Security Camera User Manual Informe técnico S-43/2013 Lampe solaire à LED ``Suprême`` Adit 3000 and MSR CLI Reference "user manual" Copyright © All rights reserved.
Failed to retrieve file