public override void Initialize(StatsHandler handler, StatOverride statOverride) { base.Initialize(handler, statOverride); this.m_Experience = handler.GetStat(this.m_Experience.Name) as Attribute; this.m_Experience.onCurrentValueChange += () => { if (this.m_Experience.CurrentValue >= this.m_Experience.Value) { this.m_Experience.CurrentValue = 0f; Add(1f); } }; }
protected virtual void Update() { //TODO BETTER FIX, SelectableUIStat is displaying same values for all enemies //if (stat == null) { StatsHandler handler = GetStatsHandler(); if (handler == null) { return; } stat = handler.GetStat(this.m_Stat); if (this.m_FreePoints != null) { freePoints = handler.GetStat(this.m_FreePoints); } if (this.m_StatName != null) { this.m_StatName.text = this.stat.Name; } // } Repaint(); }
public void Initialize(StatsHandler handler) { this.m_Handler = handler; List <GetStat> statNodes = new List <GetStat>(); for (int i = 0; i < handler.stats.Count; i++) { statNodes.AddRange(formula.nodes.Where(x => typeof(GetStat).IsAssignableFrom(x.GetType())).Cast <GetStat>()); } for (int i = 0; i < statNodes.Count; i++) { statNodes[i].statValue = handler.GetStat(statNodes[i].stat.Trim()); } if (this.m_Regenerate) { handler.StartCoroutine(Regeneration()); } }