Exemple #1
0
    public void SaveMine()
    {
        Minas mina = GameObject.FindGameObjectWithTag("Minas").GetComponent <Minas>();

        mina.mapas.Add(mina.contador, mapa);
        mina.contador++;
        SceneManager.LoadScene("Main", LoadSceneMode.Single);
    }
Exemple #2
0
    public void Guardar()
    {
        Minas minas = GameObject.FindGameObjectWithTag("Minas").GetComponent <Minas>();

        var path = EditorUtility.SaveFilePanel(
            "Save texture as PNG",
            "",
            "Mina.json",
            "json");

        File.WriteAllText(path, minas.GetJson());
    }
Exemple #3
0
    private void Awake()
    {
        if (mina == null)
        {
            mina = this;
            DontDestroyOnLoad(gameObject);
        }
        else if (mina != this)
        {
            Destroy(gameObject);
        }

        mapas    = new Dictionary <int, Dictionary <int, Dictionary <int, string> > >();
        contador = 0;
    }