Example #1
0
 private void Start()
 {
     Data = FindObjectOfType <SaveGameData>();
     SearchNewSaveFiles();
     Data.SetAccMan();
     //checks if the streaming assets folder exists, if it exists it will check if a specific file exists.
     if (Directory.Exists(Application.dataPath + "/StreamingAssets/SaveUsername"))
     {
         if (File.Exists(Application.dataPath + "/StreamingAssets/SaveUsername/SaveUsernameInfo.json"))
         {
             Data.LoadUsername();
         }
         else
         {
             return;
         }
     }
     //if it doesn't exist, we will make a streaming assets path.
     else
     {
         Directory.CreateDirectory(Application.dataPath + "/StreamingAssets/SaveUsername");
     }
 }