Exemplo n.º 1
0
 private void Awake()
 {
     unpublishButton.onClick.AddListener(() => { OnConfirmPressed?.Invoke(); });
     cancelButton.onClick.AddListener(() => { OnCancelPressed?.Invoke(); });
     closeButton.onClick.AddListener(() => { OnCancelPressed?.Invoke(); });
     doneButton.onClick.AddListener(() => { OnCancelPressed?.Invoke(); });
     loadingImageFullWidth = loadingImageRT.rect.size.x;
 }
Exemplo n.º 2
0
    public void Show(string message, string placeholderText, OnValidateInput onValidate)
    {
        messageText.text      = message;
        inputPlaceholder.text = placeholderText;

        inputField.onValidateInput += onValidate;

        okButton.onClick.AddListener(() =>
        {
            OnOkPressed?.Invoke(inputField.text);
            Destroy(this.gameObject);
        });
        cancelButton.onClick.AddListener(() =>
        {
            OnCancelPressed?.Invoke(inputField.text);
            Destroy(this.gameObject);
        });
    }
Exemplo n.º 3
0
    public void Show(CharacterSheet sheet, OnValidateInput onValidate)
    {
        currentHitsInputField.text = sheet.CurrentHits.ToString();
        maxHitsInputField.text     = sheet.MaxHits.ToString();

        int level = CharacterValuesUtility.CalculateLevel(sheet.ExpiriencePoints);
        int constitutionModificator = CharacterValuesUtility.GetCharacteristicModificator(sheet[CharacteristicType.Constitution]);

        bonusHitsText.text = TextUtility.GetSignedValueString(level * constitutionModificator);

        okButton.onClick.AddListener(() =>
        {
            OnOkPressed?.Invoke(currentHitsInputField.text, maxHitsInputField.text);
            Destroy(this.gameObject);
        });
        cancelButton.onClick.AddListener(() =>
        {
            OnCancelPressed?.Invoke(currentHitsInputField.text, maxHitsInputField.text);
            Destroy(this.gameObject);
        });
    }
Exemplo n.º 4
0
 private void CancelPressed() => OnCancelPressed?.Invoke(this);
Exemplo n.º 5
0
 /// <summary>
 /// Invokes the OnCancelPressed event.
 /// </summary>
 protected override void OnCancelClicked() => OnCancelPressed?.Invoke();