Skip to main content

Posts

Showing posts from October, 2015

Export csv data from Unity WebGL

Hi guys ,


Here is something i want to share with you guys.
I never imagined myself coding in javascript :) but Unity WebGL have given me an opportunity to do so.

In this blog post i will show you how you can export your game data in unity WebGL.

Check the WebGL version here : link

This is how it looks like when you click on Create Csv button.




You can refer to my previous blog on Csv export here, I have used same script to create data for csv (with minor changes).
But the real meat is inside the Javascript plugin.

You can check more on WebGL Plugin here



My Plugin Code
------------------------------------------------------------------------------------------------------------------
var MyPlugin = {

CreateCsv: function(mydata,filename)
    {

var csvData = Pointer_stringify(mydata);
var csvFileName = Pointer_stringify(filename);
var dataSplit = csvData.split(",");

var columns = new Array(dataSplit.length);

         for(var i = 0; i < columns.length; i++){

var rowSplit = dataSplit[i].spl…