Project_WL/Assets/Script/Table/table_fairy.cs

31 lines
948 B
C#

using MiniJSON;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class table_fairy : table_itemdatabase
{
public static table_fairy Ins;
public TextAsset m_json;
private void Awake()
{
Ins = this;
Dictionary<string, object> jsonData = Json.Deserialize(m_json.text) as Dictionary<string, object>;
// ["items"]은 items.txt 안의 items를 가리킨다. 툴 우측 하단 파일 종류란에서 설정 가능.
List<object> obj = jsonData[GetType().Name] as List<object>;
foreach (object objt in obj)
{
Dictionary<string, object> json = objt as Dictionary<string, object>;
var temp = Read(eItem.Fairy, json);
temp.Prefab = json["Prefab"].ToString();
temp.Scale = float.Parse(json["Scale"].ToString());
temp.UIScale = float.Parse(json["UIScale"].ToString());
list_Data.Add(temp);
}
}
}