コード例 #1
0
    public void ShowAlert(Choices choices, AlertLength alertLength, AlertType alertType)
    {
        var sb = new StringBuilder();

        sb.Append($"{choices.choiceName}: ");
        if (choices.timeTaken != 0)
        {
            sb.Append($"{choices.timeTaken}h Passed ");
        }

        if (choices.energy != 0)
        {
            sb.Append($"{HelperFunctions.ReturnSign(choices.energy)}{Mathf.Abs(choices.energy)} energy ");
        }

        if (choices.healthToAdd != 0)
        {
            sb.Append($"{HelperFunctions.ReturnSign(choices.healthToAdd)}{Mathf.Abs(choices.healthToAdd)} health ");
        }

        if (choices.happinessToAdd != 0)
        {
            sb.Append(
                $"{HelperFunctions.ReturnSign(choices.happinessToAdd)}{Mathf.Abs(choices.happinessToAdd)} happiness ");
        }

        if (choices.hunger != 0)
        {
            sb.Append($"{HelperFunctions.ReturnSign(choices.hunger)}{Mathf.Abs(choices.hunger)} hunger ");
        }

        if (choices.moneyToAdd != 0)
        {
            sb.Append($"{HelperFunctions.ReturnSign(choices.moneyToAdd)}${Mathf.Abs(choices.moneyToAdd)} ");
        }

        alertQueue.Enqueue(new Alert(sb.ToString(), alertLength, alertType));
    }
コード例 #2
0
 public void DismissAlert(AlertLength alertLength)
 {
     LeanTween.alpha(currentAlert, 0f, 0.5f).setFrom(1f).setEase(LeanTweenType.linear)
     .setDelay((float)alertLength * 0.5f).setOnComplete(HideAlert);
 }
コード例 #3
0
 public void ShowAlert(string text, AlertLength alertLength, AlertType alertType)
 {
     alertQueue.Enqueue(new Alert(text, alertLength, alertType));
 }
コード例 #4
0
 public Alert(string textToDisplay, AlertLength alertLength, AlertType alertType)
 {
     this.textToDisplay = textToDisplay;
     this.alertLength   = alertLength;
     this.alertType     = alertType;
 }