47 lines
1.7 KiB
C#
47 lines
1.7 KiB
C#
using Newtonsoft.Json;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
[Serializable]
|
|
public class OptionConfigTableData : TableDataBase
|
|
{
|
|
public int n_OptionID; // 옵션 고유 ID
|
|
public eStat e_OptionType; // 능력치를 설정할 옵션의 타입
|
|
public int n_DefaultValue; // 1레벨의 기본 값
|
|
public float f_LevelPerValue; // 레벨당 증가량
|
|
public float f_BalanceConstant; // 밸런스 상수 K값
|
|
public float f_ExtraValue1; // 옵션 고유 설정 값1
|
|
public float f_ExtraValue2; // 옵션 고유 설정 값2
|
|
public float f_ExtraValue3; // 옵션 고유 설정 값3
|
|
public float f_ExtraValue4; // 옵션 고유 설정 값4
|
|
|
|
public float Get_Value(int lv) { return Get_Value(lv, f_BalanceConstant, n_DefaultValue, f_LevelPerValue); }
|
|
}
|
|
|
|
public class table_optionconfig : table_missionbase
|
|
{
|
|
public static table_optionconfig Ins;
|
|
List<OptionConfigTableData> tableDatas;
|
|
Dictionary<int, OptionConfigTableData> dic_Data = new Dictionary<int, OptionConfigTableData>();
|
|
|
|
protected override void Awake()
|
|
{
|
|
base.Awake();
|
|
Ins = this;
|
|
}
|
|
|
|
protected override void Start()
|
|
{
|
|
tableDatas = JsonConvert.DeserializeObject<List<OptionConfigTableData>>(json_last);
|
|
for (int i = 0; i < Get_DataList().Count; i++)
|
|
{
|
|
var temp = Get_DataList()[i];
|
|
dic_Data.Add(temp.n_OptionID, temp);
|
|
}
|
|
|
|
base.Start();
|
|
}
|
|
|
|
public OptionConfigTableData Get_Data(int optionid) { return dic_Data.ContainsKey(optionid) ? dic_Data[optionid] : null; }
|
|
public List<OptionConfigTableData> Get_DataList() { return tableDatas; }
|
|
} |