![]() ![]() Use the FirestoreProperty()and, in our case, we will name it with the variable’s name, passing it as a string. For everything except the WebGL build, you can use the Firestore’s API commands to identify your properties as those that will be serialized to Firestore. ![]() We will collect the above data from the player, as in our PlayerData.cs script.Īs the WebGL build will use the JavaScript version of Firebase, while the other versions use the Firebase API, we must use some compiler flags to handle both situations. If all goes well, your folder should look like this: For other uses, check the Firebase CLI documentation. Remember to run the Firebase Client in the folder where your WebGL build is! You can test locally using firebase serve -only hosting, and, if everything is ok, send it to the cloud by using firebase deploy. #Unity web player build install#Now, we will send the project from your computer to the cloud! Install the Firebase CLI, login ( firebase login), test ( firebase projects:list) and, if everything is ok, you can initialize your project with the hosting functionality: firebase init hosting. ![]() Also, this will also get basic analytics data if you allow the project to use it! Test and Deploy The first step is to create a Firebase project and register a Web app in your project (the first step only). We will get the hosting part done first, as it’s easier! Create the Firebase Project Firebase saved us! And now I hope this tutorial will help anybody else that may want to use it with a WebGL build like us! Enough chit-chat, let’s get to the point! Installing Firebase and Hosting the WebGL Build So, our machine was super slow and it became impossible to host the game there. We were previously hosting our own server in our university’s machine… But here in Brazil we don’t get much funding nowadays, specially when researching on games. So, to get as many people as possible to play the game, it’s very important for me to host it as a web game (people tend to get lazy when it comes to downloading simple games, specially if they have to answer some questionnaires later). I’m using this specific WebGL setup to conduct anonymous experiments with players for my PhD using Artificial Intelligence to generate procedural contents for my game prototype. #Unity web player build how to#However, we will also learn how to collect this data to Firestore even for desktop or mobile builds (as it’s much easier and the project will be ready for it anyway). We will host our WebGL build and collect some gameplay data, saving in a Firestore database. ![]() This is about setting things up for every Unity build type and testing with a simple Hosting and Firestore usage. And there are some awesome tutorials over the internet, like this one for Analytics events usage. But, Firebase’s Youtube has some nice videos about it. #Unity web player build full#There are many cloud database products, the analytics side, the server… This isn’t a full guide to Firebase applications in Unity (at least not yet… Maybe in some months…). Salutations! If you are here, you’re probably interested in adding some Firebase functionalities to your Unity project, right? That was what I wanted!įirebase is HUGE and its free tier is enough for many indie and research projects. Photo by Element5 Digital on Unsplash Introduction ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |