54 lines
2.0 KiB
C#
54 lines
2.0 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class EquipmentCraftingTableData : TableDataBase
|
|
{
|
|
public int n_CraftingItemID; // 제작할 아이템 ID
|
|
public int n_CraftingGoodsPrice; // 제작할 아이템에 소모될 메인 재화 ID
|
|
public int n_CraftingGoodsCount; // 제작할 아이템에 소모될 메인 재화 수량
|
|
public int n_MaterialValue1; // 재료1 ID
|
|
public int n_MaterialCount1; // 재료1 수량
|
|
public int n_MaterialValue2; // 재료2 ID
|
|
public int n_MaterialCount2; // 재료2 수량
|
|
public int n_MaterialValue3; // 재료3 ID
|
|
public int n_MaterialCount3; // 재료3 수량
|
|
public int n_LinkPointID1; // 획득처 바로가기1
|
|
public int n_LinkPointID2; // 획득처 바로가기2
|
|
public int n_LinkPointID3; // 획득처 바로가기3
|
|
public int n_LinkPointID4; // 획득처 바로가기4
|
|
public int n_LinkPointID5; // 획득처 바로가기5
|
|
|
|
public int MaterialCount;
|
|
}
|
|
|
|
public class table_equipcrafting : table_missionbase
|
|
{
|
|
public static table_equipcrafting Ins;
|
|
List<EquipmentCraftingTableData> tableDatas;
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<EquipmentCraftingTableData>>(json_last);
|
|
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
temp.MaterialCount = temp.n_MaterialValue1 > 0 ? 1 : 0;
|
|
temp.MaterialCount += temp.n_MaterialValue2 > 0 ? 1 : 0;
|
|
temp.MaterialCount += temp.n_MaterialValue3 > 0 ? 1 : 0;
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public EquipmentCraftingTableData Get_Data(int id) { return Get_DataList().Find(f => f.n_CraftingItemID == id); }
|
|
public List<EquipmentCraftingTableData> Get_DataList() { return tableDatas; }
|
|
} |