public static FuncActivedTemplate Parse(GM.DataCache.FunctionsActivedInfo obj) { FuncActivedTemplate tpl = new FuncActivedTemplate(); if (obj != null) { tpl.id = obj.Id; tpl.name = obj.Name; tpl.level = obj.Level; tpl.dialogue = obj.Dialogue; tpl.describe = obj.Describe; } return(tpl); }
public bool InitFuncActivedData(GM.DataCache.ConditionGuide data) { if (data == null) { return(false); } var conditionSet = data; mFuncActivedDataDic = new Dictionary <int, FuncActivedTemplate>(); for (int i = 0; i < conditionSet.FunctionsActivedLength; i++) { var tpl = FuncActivedTemplate.Parse(conditionSet.GetFunctionsActived(i)); if (mFuncActivedDataDic.ContainsKey(tpl.id)) { EB.Debug.LogError("InitFuncActivedData: {0} exists", tpl.id); mFuncActivedDataDic.Remove(tpl.id); } mFuncActivedDataDic.Add(tpl.id, tpl); } return(true); }