Beispiel #1
0
    void SetNextText(bool isPositiveAnswer, bool isImmediatelly = false)
    {
        bool isLose;

        currentStorySettings = GameManager.Instance.StoryManager.GetNextStory(currentStorySettings, isPositiveAnswer, out isLose);

        if (currentStorySettings != null)
        {
            isAnswerButtonsEnabled = false;
            card.HideText(() =>
            {
                card.ShowText(currentStorySettings, () => { isAnswerButtonsEnabled = true; }, isImmediatelly);
            });
        }
        else
        {
            EndGamePopup endGamePopup = Instantiate(endGamePopupPrefab, transform);
            endGamePopup.transform.localPosition = Vector3.zero;
            endGamePopup.Show("ПРОДОЛЖЕНИЕ СЛЕДУЕТ :)");
            PlayerPrefs.DeleteAll();
        }

        StoryManager storyManager = GameManager.Instance.StoryManager;

        foreach (var parameter in storyManager.ValueByType)
        {
            BarInfo barInfo = barsInfo.Find((item) => item.parameterType == parameter.Key);

            if (barInfo != null)
            {
                Image image   = barInfo.image;
                float current = image.fillAmount;
                float delta   = current - (float)parameter.Value / storyManager.MaxValue;

                if (!Mathf.Approximately(delta, 0f))
                {
                    DOTween.To(() => 0f, (value) =>
                    {
                        image.fillAmount = current - value * delta;
                    }, 1, 0.1f)
                    .SetId(this);
                }
            }
        }
    }
Beispiel #2
0
 public override void EndGame()
 {
     AdsManager.DisplayIntersAd();
     EndGamePopup.Show();
     base.EndGame();
 }