protected override bool doAction() { BuffData vo = Singleton <BuffDataManager> .Instance.GetVo(this.buffId); if (vo == null) { return(false); } if (base.IsC2P) { if (!MathUtils.Rand(vo.config.probability)) { return(false); } this.targetUnit.buffManager.AddBuff(this.buffId, base.unit); } else { this.targetUnit.buffManager.AddBuff(this.buffId, base.unit); } return(true); }
public void ParseTables() { if (!this.isParseTable) { Dictionary <string, object> dicByType = BaseDataMgr.instance.GetDicByType <SysSkillBuffVo>(); if (dicByType == null) { Debug.LogError("==> SysSkillPerformVo is NULL !!"); return; } this.isParseTable = true; this._dataVos.Clear(); Dictionary <string, object> .Enumerator enumerator = dicByType.GetEnumerator(); while (enumerator.MoveNext()) { KeyValuePair <string, object> current = enumerator.Current; string key = current.Key; KeyValuePair <string, object> current2 = enumerator.Current; SysSkillBuffVo buff_vo = current2.Value as SysSkillBuffVo; BuffData value = new BuffData(key, buff_vo); this._dataVos.Add(key, value); } } }
protected override void OnInit() { base.OnInit(); this.data = Singleton <BuffDataManager> .Instance.GetVo(this.buffId); }