Exemple #1
0
    private IEnumerator OpenRoutine(Petal petal)
    {
        busy = true;

        if (prevPetal != petal)
        {
            prevPetal       = petal;
            inputField.text = "";
        }

        petalTitle.text       = petal.ToString().ToLower();
        petalDescription.text = Petals.PetalDescription(petal);
        petalQuestions.text   = Petals.PETAL_QUESTIONS[(int)petal].Replace("|", System.Environment.NewLine + System.Environment.NewLine);
        background.color      = Color.Lerp(Petals.PetalColor(petal), Color.black, 0.5f);

        group.blocksRaycasts     = true;
        background.raycastTarget = true;

        for (float f = 0; f < fadeLength; f += Time.deltaTime)
        {
            group.alpha = Mathf.SmoothStep(0, 1, f / fadeLength);
            SetBackgroundAlpha(group.alpha);
            yield return(null);
        }

        group.alpha = 1;
        SetBackgroundAlpha(1);
        group.interactable = true;

        open = true;
        busy = false;
    }
    private IEnumerator FlowerScreenToEntryScreenRoutine(Petal petal)
    {
        state = CommentEntryState.Busy;

        entryScreen.Open(petal);
        CommentCreator.PETAL = petal.ToString();
        yield return(new WaitForSeconds(0.3f));

        state = CommentEntryState.EntryScreen;
    }
    public void Initialize(CommentEntryFlower flower, Transform lookAt, Petal petal)
    {
        this.flower = flower;
        this.lookAt = lookAt;
        this.petal  = petal;

        rect.SetParent(flower.transform);
        rect.localPosition = Vector3.zero;
        rect.localScale    = Vector3.one;

        colorDefault = Petals.PetalColor(petal);
        text.text    = petal.ToString().ToLower();
    }