@@ -104,146 +104,5 @@ void Start()
104
104
- 全Aggregationの保存ファイルの絶対パスを、[ Application.persistentDataPath] ( https://docs.unity3d.com/ja/current/ScriptReference/Application-persistentDataPath.html ) フォルダ内のFilePaths.txtに保存してあります。
105
105
- XmlStorageは最初にFilePaths.txtを読み込み、保存されている全パスからXMLファイルを検索・読み込みを行います。
106
106
107
- ## API
108
- ### ` Storage ` クラス
109
- ` Storage ` クラスはstaticクラスであり、全てのプロパティ・メソッド等はstatic宣言されています。
110
- 全てのプロパティ・メソッドは現在選択されている集団(` CurrentAggregationName ` )に対して処理が行われます。
111
-
112
- ` <T> ` は保存するデータの型を表しています。
113
-
114
- ### プロパティ
115
- #### ` const string DefaultAggregationName = "Default" `
116
- デフォルトの集団名
117
- 初期状態ではこの集団名が選択されています
118
-
119
- #### ` string FileNmae `
120
- データを保存する時のファイル名
121
-
122
- #### ` string Extension `
123
- データを保存する時のファイル拡張子
124
-
125
- #### ` string DirectoryPath `
126
- データを保存する時のファイルを置くフォルダ
127
-
128
- #### ` string FileNameWithoutExtension `
129
- データを保存する時のファイル名(拡張子なし)
130
-
131
- #### ` string FullPath `
132
- データを保存する時の絶対パス
133
-
134
- #### ` string CurrentAggregationName `
135
- 現在選択されている集団名
136
-
137
- ### メソッド
138
- #### ` void ChangeAggregation(string aggregationName) `
139
- 別の集団を選択する
140
- 引数で渡した集団名の集団が存在しない場合は、新しく生成されます
141
-
142
- #### ` bool DeleteAggregation(string aggregationName) `
143
- 集団を消去する
144
-
145
- #### ` bool HasAggregation(string aggregationName) `
146
- 集団が存在するか確認
147
-
148
- #### ` void DeleteAll(string aggregationName = null) `
149
- セットしたすべてのデータを消去
150
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
151
-
152
- #### ` bool DeleteKey(string key, string aggregationName = null) `
153
- キーと一致するデータを全て消去
154
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
155
-
156
- #### ` bool DeleteKey(string key, Type type, string aggregationName = null) `
157
- キーと型に一致するデータを全て消去
158
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
159
-
160
- #### ` bool HasKey(string key, string aggregationName = null) `
161
- キーと一致するデータが一つでも存在するか確認
162
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
163
-
164
- #### ` bool HasKey(string key, Type type, stringa aggregationName = null) `
165
- キーと型に一致するデータが存在するか確認
166
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
167
-
168
- #### ` void Save() `
169
- セットしたデータ群をファイルに保存
170
-
171
- ### アクセッサ
172
- #### ` void Set<T>(string key, T value, string aggregationName = null) `
173
- 任意の型のデータとキーをセット
174
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
175
-
176
- #### ` void Set<T>(Type type, string key, T value, string aggregationName = null) `
177
- 任意の型のデータとキーをセット
178
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
179
-
180
- #### ` void SetFloat(string key, float value, string aggregationName = null) `
181
- float型のデータとキーをセット
182
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
183
-
184
- #### ` void SetInt(string key, int value, string aggregationName = null) `
185
- int型のデータとキーをセット
186
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
187
-
188
- #### ` void SetString(string key, string value, string aggregationName = null) `
189
- string型のデータとキーをセット
190
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
191
-
192
- #### ` void SetBool(string key, bool value, string aggregationName = null) `
193
- bool型のデータとキーをセット
194
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
195
-
196
- #### ` T Get<T>(string key, T defaultValue = default(T), string aggregationName = null) `
197
- キーと対応する任意の型のデータを取得
198
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
199
-
200
- #### ` T Get<T>(Type type, string key, T defaultValue = default(T), string aggregationName = null) `
201
- キーと対応する任意の型のデータを取得
202
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
203
-
204
- #### ` List<T> Gets<T>(string key, List<T> defaultValue = default(List<T>), string aggregationName = null) `
205
- キーと対応する任意のList型のデータを取得
206
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
207
-
208
- #### ` float GetFloat(string key, float defaultValue = default(float), string aggregationName = null) `
209
- キーと対応するfloat型のデータを取得
210
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
211
-
212
- #### ` int GetInt(string key, int defaultValue = default(int), string aggregationName = null) `
213
- キーと対応するint型のデータを取得する
214
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
215
-
216
- #### ` string GetString(string key, string defaultValue = "", string aggregationName = null) `
217
- キーと対応するstring型のデータを取得
218
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
219
-
220
- #### ` bool GetBool(string key, bool defaultValue = default(bool), string aggregationName = null) `
221
- キーと対応するbool型のデータを取得
222
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
223
-
224
- #### ` float [] GetFloats(float[] defaultValue = default(float[]), string aggregationName = null) `
225
- float型と対応するデータを取得する
226
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
227
-
228
- #### ` int[] GetInts(int[] defaultValue = default(int[]), string aggregationName = null) `
229
- int型と対応するデータを取得する
230
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
231
-
232
- #### ` string[] GetStrings(string[] defaultValue = default(string[]), string aggregationName = null) `
233
- string型と対応するデータを取得する
234
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
235
-
236
- #### ` bool[] GetBools(bool[] defaultValue = default(bool[]), string aggregationName = null) `
237
- bool型と対応するデータを取得する
238
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
239
-
240
- #### ` string [] GetKeys(Type type, string aggregationName = null) `
241
- データの型と対応するキーを取得する
242
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
243
-
244
- #### ` Type[] GetTypes(string aggregationName = null) `
245
- データの型情報を取得する
246
- aggregationNameがnullの時は、` CurrentAggregationName ` が使われます
247
-
248
107
## Default save folder
249
- Windows: c:\Users \\ #{username} \\ AppData \\ LocalLow \\ #{CompanyName} \\ #{ProductName} \\ #{SceneName}.xml
108
+ [ Application.dataPath ] ( https://docs.unity3d.com/ja/current/ScriptReference/Application-dataPath.html ) + "/" + ".." + "/" + "Saves/"
0 commit comments