public void Export()
    {
        content = null; // you start completely anew

        content += $"{entities.player.saveSystemId}\n{Vec3ToStr(entities.player.transform.position)}\n\n";
        content += $"{entities.levelExit.saveSystemId}\n{Vec3ToStr(entities.levelExit.transform.position)}\n\n";

        void SaveList(List <EditorEntity> l)
        {
            if (l.Count == 0)
            {
                return;                          // if no instances of this entity exist, skip it
            }
            content += $"{l[0].saveSystemId}\n"; // "shooting_enemy"
            foreach (var ee in l)                // each line below is a position vector of 1 instance
            {
                content += $"{Vec3ToStr(ee.transform.position)}\n";
            }
            content += "\n";
        }

        SaveList(entities.checkpoints);
        SaveList(entities.walkingEnemies);
        SaveList(entities.shootingEnemies);

        content += "\n";

        foreach (var charmap in charmaps.tilemapRepresentations)
        {
            content += charmap.saveSystemLayerId + "\n";
            content += charmap.GetCharmapString();
            content += "\n";
        }

        WebGLFileSaver.SaveFile(content, saveFileName);
    }
Exemple #2
0
 public void DownloadQR()
 {
     WebGLFileSaver.SaveFile(GameManagerScript.gameManagerRef.GeneratePasswordFromMessages());
 }