34 lines
1002 B
C#
34 lines
1002 B
C#
|
|
using Newtonsoft.Json;
|
||
|
|
using System.Collections.Generic;
|
||
|
|
|
||
|
|
public class BuffPatternConfigTableData : TableDataBase
|
||
|
|
{
|
||
|
|
public string s_BuffType;
|
||
|
|
public bool b_MaintainBuff;
|
||
|
|
public int n_AppearRate;
|
||
|
|
public int n_BuffDesc;
|
||
|
|
public int n_BuffOptionID;
|
||
|
|
}
|
||
|
|
|
||
|
|
public class table_BuffPatternConfig : table_base
|
||
|
|
{
|
||
|
|
public static table_BuffPatternConfig Ins;
|
||
|
|
|
||
|
|
List<BuffPatternConfigTableData> tableDatas;
|
||
|
|
|
||
|
|
protected override void Awake()
|
||
|
|
{
|
||
|
|
Ins = this;
|
||
|
|
base.Awake();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected override void Start()
|
||
|
|
{
|
||
|
|
tableDatas = JsonConvert.DeserializeObject<List<BuffPatternConfigTableData>>(json_last);
|
||
|
|
base.Start();
|
||
|
|
}
|
||
|
|
|
||
|
|
public List<BuffPatternConfigTableData> Get_DataList() { return tableDatas; }
|
||
|
|
public BuffPatternConfigTableData Get_Data(int optionid) { return tableDatas.Find(f=>f.n_BuffOptionID == optionid); }
|
||
|
|
public BuffPatternConfigTableData Get_RandomData() { return DSUtil.WeightedPick(tableDatas, x => x.n_AppearRate); }
|
||
|
|
}
|