コード例 #1
0
    public void HideMessageBox(System.Action callback)
    {
        blocker.enabled = true;
        message.text    = "";

        float   value = (ScreenSizeGetter.width - ScreenSizeGetter.GetBaseScreenSize().x) * 0.5f;
        Vector3 from  = new Vector3(baseBodyShowXPos - value, height, 0f);
        Vector3 to    = new Vector3(baseBodyHideXPos - value, height, 0f);

        AnimCurveController.Move(hideCurve.bodyCurve, from, to, hideAnimTime, body, () =>
        {
            blocker.enabled = false;
            bOpend          = false;
            if (callback != null)
            {
                callback();
            }
        });

        from = new Vector3(0f, baseCharacterShowYPos, 0f);
        to   = new Vector3(0f, baseCharacterHideYPos, 0f);
        AnimCurveController.Move(hideCurve.characterCurve, from, to, hideAnimTime, character, null);

        from = Vector3.one;
        to   = new Vector3(0f, 0f, 1f);
        AnimCurveController.Scale(hideCurve.messageCurve, from, to, hideAnimTime, messageBody, null);
    }
コード例 #2
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    private void HideBright()
    {
        Vector3 start = Vector3.one;
        Vector3 end   = new Vector3(0f, 0f, 1f);

        float animTime = 0.2f;

        AnimCurveController.Scale(brightHideCurve, start, end, animTime, bright, null);
    }
コード例 #3
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    private void ShowBright()
    {
        Vector3 start    = new Vector3(0f, 0f, 1f);
        Vector3 end      = Vector3.one;
        float   animTime = 0.4f;

        bright.localScale = start;
        bright.gameObject.SetActive(true);

        AnimCurveController.Scale(brightShowCurve, start, end, animTime, bright, null);
    }
コード例 #4
0
ファイル: IPopup.cs プロジェクト: HyunsunRyu/LineCrush
    protected override void UICloseAnimation(System.Action callback)
    {
        Vector3 start = Vector3.one;
        Vector3 end   = new Vector3(0f, 0f, 1f);

        AnimCurveController.Scale(PopupSystem.GetCloseCurve(), start, end, animTime, moveTarget, () =>
        {
            if (callback != null)
            {
                callback();
            }
        });
    }
コード例 #5
0
ファイル: GoPopup.cs プロジェクト: HyunsunRyu/LineCrush
    protected override void UIOpenAnimation(System.Action callback)
    {
        AnimCurveController.Scale(scaleCurve, startScale, endScale, animTime, moveTarget, () =>
        {
            if (callback != null)
            {
                callback();
            }

            PopupSystem.ClosePopup(Define.PopupType.Go, this.callback);
        });

        AnimCurveController.Rotation(rotationCurve, Vector3.forward, startAngle, endAngle, animTime, moveTarget, null);
    }
コード例 #6
0
    public void SetMessageBox(int textIdx, Vector3 pos, System.Action callback)
    {
        float value = (ScreenSizeGetter.width - ScreenSizeGetter.GetBaseScreenSize().x) * 0.5f;

        if (bOpend)
        {
            if (pos.y >= 0f && height != bottomHeight)
            {
                height             = bottomHeight;
                body.localPosition = new Vector3(baseBodyShowXPos - value, height, 0f);
            }
            else if (pos.y < 0f && height != topHeight)
            {
                height             = topHeight;
                body.localPosition = new Vector3(baseBodyShowXPos - value, height, 0f);
            }

            blocker.enabled = false;
            if (preTextIdx == textIdx)
            {
                if (callback != null)
                {
                    callback();
                }
            }
            else
            {
                preTextIdx   = textIdx;
                message.text = DataManager.GetText(textIdx);
                if (callback != null)
                {
                    callback();
                }
            }
        }
        else
        {
            blocker.enabled = true;
            message.text    = "";

            if (pos.y >= 0f)
            {
                height = bottomHeight;
            }
            else
            {
                height = topHeight;
            }

            Vector3 from = new Vector3(baseBodyHideXPos - value, height, 0f);
            Vector3 to   = new Vector3(baseBodyShowXPos - value, height, 0f);
            AnimCurveController.Move(showCurve.bodyCurve, from, to, showAnimTime, body, null);

            from = new Vector3(0f, baseCharacterHideYPos, 0f);
            to   = new Vector3(0f, baseCharacterShowYPos, 0f);
            AnimCurveController.Move(showCurve.characterCurve, from, to, showAnimTime, character, null);

            from = new Vector3(0f, 0f, 1f);
            to   = Vector3.one;
            AnimCurveController.Scale(showCurve.messageCurve, from, to, showAnimTime, messageBody, () =>
            {
                bOpend = true;
                if (preTextIdx == textIdx)
                {
                    if (callback != null)
                    {
                        callback();
                    }
                }
                else
                {
                    preTextIdx      = textIdx;
                    message.text    = DataManager.GetText(textIdx);
                    blocker.enabled = false;
                    if (callback != null)
                    {
                        callback();
                    }
                }
            });
        }
    }