You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
663 B
26 lines
663 B
using System.Collections; |
|
using System.Collections.Generic; |
|
using UnityEngine; |
|
using LitJson; |
|
|
|
public class ChariotLoader : MonoBehaviour { |
|
public TextAsset chariotSave; |
|
public List<SavedBlock> blocksSavedList = new List<SavedBlock>(); |
|
|
|
// Use this for initialization |
|
void Start () { |
|
LoadChariot(chariotSave.text); |
|
} |
|
|
|
public void LoadChariot(string json) { |
|
JsonData data = JsonMapper.ToObject(json); |
|
//print(data.IsArray); |
|
//添加到列表 |
|
foreach (JsonData bdata in data) { |
|
SavedBlock blocksavedata = JsonMapper.ToObject<SavedBlock>(bdata.ToJson()); |
|
//print(blocksavedata.linkChild[0]); |
|
blocksSavedList.Add(blocksavedata); |
|
} |
|
|
|
} |
|
}
|
|
|