public void UseNotStoredItem(InscreasingStatItemDefinition_SO item_SO) { if (UseItem(item_SO)) { UIManager.Instance.playerDynamicStatsUI.UpdateDynamicAttributesUI(dynamicContainer); } }
public bool UseItem(InscreasingStatItemDefinition_SO item_SO) { bool hasUsed = false; foreach (PlayerDynamicAttribute attribute in dynamicContainer.dynamicAttributes) { if (item_SO.dynamicType == attribute.dynamicType) { if (attribute.dynamicType == DynamicAttributeType.Coin) { attribute.currentValue += item_SO.inscreasingAmount; hasUsed = true; } else if (attribute.currentValue != attribute.maxValue) { attribute.currentValue = (item_SO.inscreasingAmount + attribute.currentValue > attribute.maxValue) ? attribute.maxValue : item_SO.inscreasingAmount + attribute.currentValue; hasUsed = true; } } } return(hasUsed); }