Beispiel #1
0
    public void Hide()
    {
        for (int i = 0; i < answerList.Count; i++)
        {
            UIAnswerElement element = answerList[i];
        }

        SetVisibility(false);
    }
Beispiel #2
0
    public void Show(PlanetName planet)
    {
        currentPlanet = planet;
        currentTrivia = TriviaManager.Instance[planet];

        questionText.text = currentTrivia.question;
        titleText.text    = planet.ToString();
        titleAccent.color = PlanetInfo.Colors[planet];

        for (int i = 0; i < answerList.Count; i++)
        {
            UIAnswerElement element = answerList[i];
            element.SetInfo(currentTrivia.answers[i], PlanetInfo.Colors[planet]);
        }

        SetVisibility(true);
    }
Beispiel #3
0
    public void SetVisibility(bool visible, float time = 0.2f, float delay = 0f)
    {
        if (Visible == visible)
        {
            return;
        }

        Visible = visible;

        tweens.StopTweens();

        float stagger = (!visible && time < 0.01f) ? 0f : 0.1f;

        tweens.Add(QuestionGroup.LerpToAlpha(visible ? 1f : 0f, time, visible ? time + delay : delay));
        tweens.Add(TitleGroup.LerpToAlpha(visible ? 1f : 0f, time, !visible ? time + delay : delay));

        for (int i = 0; i < answerList.Count; i++)
        {
            UIAnswerElement element = answerList[i];
            element.SetVisibility(visible, time, i * stagger);
        }
    }