コード例 #1
0
    [TearDown] public void Dispose()
    {
        //deletes the testing save files
        if (saveFile.IsOpen())
        {
            saveFile.Close();
        }
        SaveFile.DeleteSaveFile("testing", saveFile.GetPath());
        //clear the console
        /*/*/
        var assembly = Assembly.GetAssembly(typeof(UnityEditor.ActiveEditorTracker));
        var type     = assembly.GetType("UnityEditor.LogEntries");
        var method   = type.GetMethod("Clear");

        method.Invoke(new object(), null);
        //*/
    }
コード例 #2
0
    public void DeleteSaveFile()
    {
        //arrange
        Regex r = new Regex("(Error while deleting the save file)");

        //tries to delete an already opened saveFile
        SaveFile.DeleteSaveFile("testing", saveFile.GetPath());
        LogAssert.Expect(LogType.Error, r);

        //tries to delete an unexisting SaveFile (should do nothing)
        SaveFile.DeleteSaveFile("unexisting", saveFile.GetPath());

        //deletes a save file
        saveFile.Close();
        SaveFile.DeleteSaveFile("testing", saveFile.GetPath());
        string[] list = SaveFile.GetSaveFileList(saveFile.GetPath());
        Assert.IsTrue(list.Length == 0);
    }
コード例 #3
0
 public void Reset()
 {
     SaveFile.DeleteSaveFile("game");
     resetButton.gameObject.SetActive(File.Exists(_path));
 }
コード例 #4
0
 /// <summary>
 /// Deletes a save file and refreshes the scene UI
 /// </summary>
 /// <param name="name">the name of the save file to delete</param>
 public void DeleteSavefile(string name)
 {
     SaveFile.DeleteSaveFile(name);
     RefreshSaveFileList();
 }
コード例 #5
0
 [TearDown] public void Dispose()
 {
     //deletes the testing save files
     saveFile.Close();
     SaveFile.DeleteSaveFile("testing", saveFile.GetPath());
 }