Skip to content

Commit c7023df

Browse files
committed
Add save load test script.
1 parent 7d48f97 commit c7023df

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/**
2+
* $File: FT_SaveLoad_Test.cs $
3+
* $Date: 2019-10-16 15:16:31 $
4+
* $Revision: $
5+
* $Creator: Jen-Chieh Shen $
6+
* $Notice: See LICENSE.txt for modification and distribution information
7+
* Copyright © 2019 by Shen, Jen-Chieh $
8+
*/
9+
using System.Collections;
10+
using System.Collections.Generic;
11+
using UnityEngine;
12+
13+
/// <summary>
14+
/// Test save load module.
15+
/// </summary>
16+
public class FT_SaveLoad_Test : MonoBehaviour
17+
{
18+
/* Variables */
19+
20+
/* Setter/Getter */
21+
22+
/* Functions */
23+
private void Awake()
24+
{
25+
string path = Application.dataPath + "/JCS_GameData/SavedData/FT_GameData.jcs";
26+
27+
FT_JSONGameData data = new FT_JSONGameData();
28+
data.Save<FT_JSONGameData>(path);
29+
30+
data.Cash = 10;
31+
32+
print(data.Cash);
33+
data = FT_JSONGameData.LoadFromFile<FT_JSONGameData>(path);
34+
print(data.Cash);
35+
}
36+
}

Assets/FrameworkTest_Assets/Scripts/FT_SaveLoad_Test.cs.meta

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)