void LoadContTable() { if (DicConst != null) { return; } DicConst = new Dictionary <eConstType, TB_Const>(); List <Dictionary <string, object> > data = CSVReader.Read("Table/Const"); for (var i = 0; i < data.Count; i++) { TB_Const tbConst = new TB_Const(); tbConst.mNameTag = System.Convert.ToString(data[i]["nameTag"]); tbConst.mValuel = System.Convert.ToSingle(data[i]["value"]); eConstType key = (eConstType)i; if (DicConst.ContainsKey(key)) { Debug.LogError("Already exist key. " + key.ToString()); } DicConst.Add(key, tbConst); } }
public float GetConstValue(eConstType type) { if (DicConst.ContainsKey(type)) { return(DicConst[type].mValuel); } return(0); }