forked from RickJiangShu/ConfigManager-Example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest.cs
More file actions
48 lines (38 loc) · 1.42 KB
/
Copy pathTest.cs
File metadata and controls
48 lines (38 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour {
// Use this for initialization
public bool loadByResource = true;
void Start()
{
/*
SerializableSet set;
float startTime = Time.realtimeSinceStartup;
if (loadByResource)
{
set = Resources.Load<SerializableSet>("SerializableSet");
Deserializer.Deserialize(set);
//卸载内存
Resources.UnloadUnusedAssets();//Resources卸载内存
}
else
{
AssetBundle bundle = AssetBundle.LoadFromFile(Application.streamingAssetsPath + "/config.ab");
set = bundle.LoadAsset<SerializableSet>("SerializableSet");
Deserializer.Deserialize(set);
//卸载内存
bundle.Unload(true);//AssetBundle卸载内存
}
Debug.Log("解析速度:" + (Time.realtimeSinceStartup - startTime) + "s");
print(Txt1Sheet.Get(601110).EquipName);//*.txt
print(Csv2Sheet.Get(210101).name);//*.csv
print(Json1Json.Get().glossary.GlossDiv.GlossList.GlossEntry.GlossDef.GlossSeeAlso[0]);//*.json
print(Xml2Xml.Get().menu.popup.menuitem[2].value);//*.xml
print(Xlsx1Sheet.Get(601213).boxBonus);//*.xlsx
*/
}
// Update is called once per frame
void Update () {
}
}