Definition at line 5 of file SourceAsset.cs.
◆ _LoadPrefs()
static void SourceAsset._LoadPrefs |
( |
string |
id = "prefs" | ) |
|
|
inlinestatic |
Definition at line 82 of file SourceAsset.cs.
83 {
85 Prefs prefs =
IO.LoadFile<Prefs>(
PrefPath + id);
88 {
89 if (prefs.things.dict.ContainsKey(row.id))
90 {
91 row.pref = prefs.things.dict[row.id];
92 }
93 if (prefs.version == 0)
94 {
95 row.pref.y = 0f;
96 }
97 }
99 {
100 if (prefs.charas.dict.ContainsKey(row2.id))
101 {
102 row2.pref = prefs.charas.dict[row2.id];
103 }
104 }
105 Debug.Log(
"Imported Prefs:" +
id);
106 }
static SourceManager sources
static void CopyAs(string fromPath, string toPath)
References SourceAsset.Prefs.charas, SourceManager.charas, Debug, SourceAsset.PrefData.dict, PrefPath, EClass.sources, SourceAsset.Prefs.things, SourceManager.things, and SourceAsset.Prefs.version.
Referenced by LoadPrefs(), and LoadPrefs_bk().
◆ _SavePrefs()
static void SourceAsset._SavePrefs |
( |
string |
id = "prefs" | ) |
|
|
inlinestatic |
Definition at line 36 of file SourceAsset.cs.
37 {
39 {
41 }
42 Prefs prefs = new Prefs();
43 prefs.version = 2;
47 {
48 if (prefs.things.dict.ContainsKey(row.id))
49 {
50 Debug.LogError(
"exception: duplicate id:" + row.id +
"/" + row.name);
51 }
52 else
53 {
54 prefs.things.dict.Add(row.id, row.pref);
55 }
56 }
58 {
59 if (prefs.charas.dict.ContainsKey(row2.id))
60 {
61 Debug.LogError(
"exception: duplicate id:" + row2.id +
"/" + row2.name);
62 }
63 else
64 {
65 prefs.charas.dict.Add(row2.id, row2.pref);
66 }
67 }
69 Debug.Log(
"Exported Prefs:" +
id);
70 }
static void SaveFile(string path, object obj, bool compress=false, JsonSerializerSettings setting=null)
References SourceAsset.Prefs.charas, SourceManager.charas, Debug, SourceAsset.PrefData.dict, PrefPath, EClass.sources, SourceAsset.Prefs.things, and SourceManager.things.
Referenced by SourceChara.BackupPref(), SourceThing.BackupPref(), and SavePrefs().
◆ DoFix()
void SourceAsset.DoFix |
( |
| ) |
|
|
inline |
◆ LoadPrefs()
void SourceAsset.LoadPrefs |
( |
| ) |
|
|
inline |
◆ LoadPrefs_bk()
void SourceAsset.LoadPrefs_bk |
( |
| ) |
|
|
inline |
◆ SavePrefs()
void SourceAsset.SavePrefs |
( |
string |
id = "prefs" | ) |
|
|
inline |
◆ idLoad
string SourceAsset.idLoad = "prefs" |
◆ renames
◆ PrefPath
string SourceAsset.PrefPath |
|
staticget |
The documentation for this class was generated from the following file: