public override void OnEnter() { BaseAttribute mAttribute = owner.GetAttribute(attribute); if (mAttribute != null) { mAttribute.Consume(amount); } Finish(); }
public void ApplyAttributeDamage(object[] data) { if (data.Length > 1) { string name = (data[0] != null && data[0].GetType() == typeof(string)?(string)data[0]:string.Empty); //Debug.Log(name); BaseAttribute attribute = GetAttribute(name); if (attribute != null) { int damage = data[1] != null && data[1].GetType() == typeof(int)?(int)data[1]:0; attribute.Consume(damage); Debug.Log("CurValue " + attribute.CurValue); } } }