예제 #1
0
 private void Update()
 {
     if (Input.GetButtonDown("Save"))
     {
         Debug.Log("Saved data to " + path);
         DebugCanvas.Instance.Display("Saving");
         SaveReadWriter.WriteSaveDataFile(new SaveData(inventory), path);
     }
     else if (Input.GetButtonDown("Load"))
     {
         var sd = SaveReadWriter.ReadSaveDataFile(path);
         if (sd != null)
         {
             Debug.Log("Loaded data from " + path);
             DebugCanvas.Instance.Display("Loading");
             LoadSaveData(sd);
         }
     }
     else if (Input.GetButtonDown("New"))
     {
         Debug.Log("Loaded new save data");
         DebugCanvas.Instance?.Display("New save loaded");
         LoadSaveData(new SaveData());
     }
 }
예제 #2
0
 private void Start()
 {
     if (Application.platform != RuntimePlatform.WebGLPlayer)
     {
         LoadSaveData(SaveReadWriter.ReadSaveDataFile(path));
     }
     else
     {
         WebGLHelper.ImportEnabled(true);
     }
 }