Пример #1
0
    private void SetHitDices()
    {
        var sheet = characterSheetController.Character;

        characterHolder.diceTypeText.text = TextUtility.GetDiceValueString(1, CharacterUtility.GetDiceTypeByClass(sheet.Type));

        int level = CharacterValuesUtility.CalculateLevel(sheet.ExpiriencePoints);

        if (sheet.HitDiceCount > level)
        {
            sheet.HitDiceCount = level;
        }
        characterHolder.dicesValueText.text = TextUtility.GetValueAndMaxString(sheet.HitDiceCount, level);
    }
Пример #2
0
    public void Show(CharacterSheet sheet)
    {
        diceTypeText.text = TextUtility.GetDiceValueString(1, CharacterUtility.GetDiceTypeByClass(sheet.Type));
        SetHitDicesCount(sheet);

        okButton.onClick.AddListener(() =>
        {
            OnOkPressed?.Invoke();
            Destroy(this.gameObject);
        });
        useDiceButton.onClick.AddListener(() =>
        {
            OnUseDicePressed?.Invoke();
            SetHitDicesCount(sheet);
        });
        resetDicesButton.onClick.AddListener(() =>
        {
            OnResetDicesPressed?.Invoke();
            SetHitDicesCount(sheet);
        });
    }