Exemple #1
0
 private void Start()
 {
     if (!string.IsNullOrEmpty(this.m_HandlerName))
     {
         StatsManager.RegisterStatsHandler(this);
     }
     UpdateStats();
     Refresh();
 }
Exemple #2
0
        private void Start()
        {
            for (int i = 0; i < this.m_Stats.Count; i++)
            {
                this.m_Stats[i] = Instantiate(this.m_Stats[i]);
            }


            if (this.m_StatOverrides.Count < this.m_Stats.Count)
            {
                for (int i = this.m_StatOverrides.Count; i < this.m_Stats.Count; i++)
                {
                    this.m_StatOverrides.Insert(i, new StatOverride());
                }
            }

            for (int i = 0; i < this.m_Stats.Count; i++)
            {
                this.m_Stats[i].Initialize(this, this.m_StatOverrides[i]);
            }

            for (int i = 0; i < this.m_Stats.Count; i++)
            {
                this.m_Stats[i].ApplyStartValues();
            }

            for (int i = 0; i < this.m_Effects.Count; i++)
            {
                this.m_Effects[i] = Instantiate(this.m_Effects[i]);
                this.m_Effects[i].Initialize(this);
            }

            if (!string.IsNullOrEmpty(this.m_HandlerName))
            {
                StatsManager.RegisterStatsHandler(this);
            }
            EventHandler.Register <GameObject, Object>(gameObject, "SendDamage", SendDamage);
        }