Load and Save not working
Posted: Tue Dec 06, 2022 6:42 pm
hi, I need help, I'm trying to save or load data but it doesn't work, what's up with that?thank you
Forums for Moodkie Interactive, Developers of Interactive Software, Web and Design.
https://moodkie.com:443/forum/
Code: Select all
public class Load : MonoBehaviour
{
public void LoadSave()
{
MaterialsData script = GetComponent<MaterialsData>();
script.Iron = ES3.Load<int>("Iron");
script.Scrap = ES3.Load<int>("Scrap");
script.Wood= ES3.Load<int>("Wood");
script.Glue = ES3.Load<int>("Glue");
script.String = ES3.Load<int>("String");
script.Brass = ES3.Load<int>("Brass");
script.GunPowder = ES3.Load<int>("GunPowder");
Debug.Log("Load");
}
}using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Save : MonoBehaviour
{
public void Saves()
{
MaterialsData script = GetComponent<MaterialsData>();
ES3.Save(script.Iron,"Iron");
ES3.Save(script.Scrap,"Scrap");
ES3.Save(script.Wood,"Wood");
ES3.Save(script.Glue,"Glue");
ES3.Save(script.String,"String");
ES3.Save(script.Brass,"Brass");
ES3.Save(script.GunPowder,"GunPowder");
Debug.Log("Save");
}
}