public PlayerSaveData(PlayerStatsController playerStatsController) { playerInventory = playerStatsController.inventory_SO.inventory; equipmentsInventory = playerStatsController.equipments_SO.inventory; dynamicAttributeContainer = playerStatsController.dynamicContainer; lastCheckPoint = new float[3]; lastCheckPoint[0] = SaveManager.Instance.lastCheckPointPosition.x; lastCheckPoint[1] = SaveManager.Instance.lastCheckPointPosition.y; lastCheckPoint[2] = SaveManager.Instance.lastCheckPointPosition.z; }
public void UpdateDynamicAttributesUI(DynamicAttributeContainer container) { foreach (var attribute in container.dynamicAttributes) { if (attribute.dynamicType == DynamicAttributeType.Health) { healthBar.SetHealth(attribute.currentValue); healthBar.SetMaxHealth(attribute.maxValue); } if (attribute.dynamicType == DynamicAttributeType.Mana) { manaBar.SetCurrentMana(attribute.currentValue); manaBar.SetMaxMana(attribute.maxValue); } if (attribute.dynamicType == DynamicAttributeType.Coin) { coinUI.SetValue(attribute.currentValue); } } }