Example #1
0
        private void AddInternal(Trait trait)
        {
            if (this.HasTrait(trait))
            {
                return;
            }
            this.TraitList.Add(trait);


            Modifiers component = this.gameObject.GetComponent <Modifiers>();

            component.attributes = new Attributes(this.gameObject);
            trait.AddTo(this.GetAttributes());
            if (trait.OnAddTrait == null)
            {
                return;
            }
            trait.OnAddTrait(this.gameObject);
        }