コード例 #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
    private void Update()
    {
        delta    = Time.realtimeSinceStartup - lastTime;
        lastTime = Time.realtimeSinceStartup;

        if (animType == AnimType.None)
        {
            return;
        }

        bool bWork = true;

        saveDelta += delta * invTime;
        if (saveDelta >= 1f)
        {
            saveDelta = 1f;
            bWork     = false;
        }

        Vector3 pos = AnimCurveController.GetValue(curve, start, end, saveDelta);

        moveTarget.localPosition = pos;
        if (!bWork)
        {
            if (finishCallback != null)
            {
                finishCallback();
            }

            animType = AnimType.None;
        }
    }
コード例 #3
0
    private void HideList()
    {
        if (!bListOn || bListMoving)
        {
            return;
        }
        bListOn     = false;
        bListMoving = true;
        SettingAfterMoveList();

        selectedIdx = Define.nullValue;

        SoundManager.GetInstance().PlaySound(Define.SoundType.HideDialog);

        Vector3 from = new Vector3(showListPosX, 0f, 0f);
        Vector3 to   = new Vector3(hideListPosX, 0f, 0f);

        AnimCurveController.Move(listHideCurve, from, to, movingTime, movingPanel, () =>
        {
            bListMoving = false;
            SettingAfterMoveList();

            uiDrag.DeleteList(DeleteItem);
        });
    }
コード例 #4
0
    private void ShowList()
    {
        if (bListMoving)
        {
            return;
        }

        uiDrag.DeleteList(DeleteItem);
        SetScroll(selectedIdx);

        if (!bListOn)
        {
            bListOn     = true;
            bListMoving = true;
            SettingAfterMoveList();
            UpdateChangeButtonUI();

            Vector3 from = new Vector3(hideListPosX, 0f, 0f);
            Vector3 to   = new Vector3(showListPosX, 0f, 0f);

            SoundManager.GetInstance().PlaySound(Define.SoundType.ShowDialog);

            AnimCurveController.Move(listShowCurve, from, to, movingTime, movingPanel, () =>
            {
                bListMoving = false;
                SettingAfterMoveList();
            });
        }
        else
        {
            SoundManager.GetInstance().PlaySound(Define.SoundType.Click);
        }
    }
コード例 #5
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);
    }
コード例 #6
0
 private void ChangeColor()
 {
     AnimCurveController.Color(curve, start, end, totalTime, widget, () =>
     {
         if (bLoop)
         {
             ChangeColor();
         }
     });
 }
コード例 #7
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);
    }
コード例 #8
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    private void RotateBright()
    {
        float start    = 0f;
        float end      = 90f;
        float animTime = 2f;

        bright.localRotation = Quaternion.identity;
        bright.gameObject.SetActive(true);

        AnimCurveController.Rotation(brightRotateCurve, Vector3.forward, start, end, animTime, bright, null);
    }
コード例 #9
0
 private void Awake()
 {
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #10
0
    protected override void UICloseAnimation(System.Action callback)
    {
        Vector3 start = Vector3.zero;
        Vector3 end   = new Vector3(ScreenSizeGetter.width * 0.5f, 0f, 0f);

        AnimCurveController.Move(UISystem.GetCloseDialogCurve(), start, end, dialogCloseMovingTime, moveTarget, () =>
        {
            if (callback != null)
            {
                callback();
            }
        });
    }
コード例 #11
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();
            }
        });
    }
コード例 #12
0
 private static AnimCurveController GetInstance()
 {
     if (instance == null)
     {
         instance = FindObjectOfType <AnimCurveController>();
     }
     if (instance == null)
     {
         GameObject obj = new GameObject("AnimCurveController");
         instance = obj.AddComponent <AnimCurveController>();
     }
     return(instance);
 }
コード例 #13
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    private void ShowCharacter()
    {
        Vector3 start    = new Vector3(0f, -700f, 0f);
        Vector3 end      = Vector3.zero;
        float   animTime = 0.2f;

        character.localPosition = start;
        character.gameObject.SetActive(true);

        AnimCurveController.Move(characterShowCurve, start, end, animTime, character, null);

        StartCoroutine(PlayUseSkillSound());
    }
コード例 #14
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    private void HideCharacter()
    {
        Vector3 end      = new Vector3(0f, -700f, 0f);
        Vector3 start    = Vector3.zero;
        float   animTime = 0.3f;

        SoundManager.GetInstance().PlaySound(Define.SoundType.HidePopup);

        AnimCurveController.Move(characterShowCurve, start, end, animTime, character, () =>
        {
            PopupSystem.ClosePopup(Define.PopupType.UseSkill, closeCallback);
        });
    }
コード例 #15
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);
    }
コード例 #16
0
ファイル: TimeUpPopup.cs プロジェクト: HyunsunRyu/LineCrush
    protected override void UIOpenAnimation(System.Action callback)
    {
        openStartMove.y = ScreenSizeGetter.height * 0.5f + 200f;
        AnimCurveController.Move(openMoveCurve, openStartMove, openEndMove, openAnimTime, moveTarget, () =>
        {
            if (callback != null)
            {
                callback();
            }

            PopupSystem.ClosePopup(Define.PopupType.TimeUp);
        });

        AnimCurveController.Rotation(openRotationCurve, Vector3.forward, openStartAngle, openEndAngle, openAnimTime, moveTarget, null);
    }
コード例 #17
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    protected override void UICloseAnimation(System.Action callback)
    {
        Vector3 start = Vector3.one;
        Vector3 end   = new Vector3(ScreenSizeGetter.width * 0.5f, 0f, 0f);

        float animTime = 0.2f;

        AnimCurveController.Move(closeMoveCurve, start, end, animTime, moveTarget, () =>
        {
            if (callback != null)
            {
                callback();
            }
        });
    }
コード例 #18
0
ファイル: TimeUpPopup.cs プロジェクト: HyunsunRyu/LineCrush
    protected override void UICloseAnimation(System.Action callback)
    {
        closeEndMove.x = -ScreenSizeGetter.width;

        AnimCurveController.Move(closeMoveCurve, closeStartMove, closeEndMove, closeAnimTime, moveTarget, () =>
        {
            if (callback != null)
            {
                callback();
            }

            if (closeCallback != null)
            {
                closeCallback();
            }
        });
    }
コード例 #19
0
    public void LevelUp()
    {
        if (isAnim)
        {
            return;
        }

        gObj.SetActive(true);

        Vector3 start = new Vector3(0f, startHeight, 0f);
        Vector3 end   = new Vector3(0f, endHeight, 0f);

        isAnim = true;
        AnimCurveController.Move(curve, start, end, 0.6f, mTrans, () =>
        {
            isAnim = false;
        });
    }
コード例 #20
0
ファイル: UseSkillPopup.cs プロジェクト: HyunsunRyu/LineCrush
    protected override void UIOpenAnimation(System.Action callback)
    {
        openCallback = callback;
        InitPopup();

        SoundManager.GetInstance().PlaySound(Define.SoundType.ShowPopup);

        Vector3 start    = new Vector3(ScreenSizeGetter.width * -0.5f, 0f, 0f);
        Vector3 end      = Vector3.one;
        float   animTime = 0.3f;

        AnimCurveController.Move(openMoveCurve, start, end, animTime, moveTarget, () =>
        {
            ShowCharacter();
            ShowBright();
            RotateBright();
            StartCoroutine(FuncClose());
        });
    }
コード例 #21
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();
                    }
                }
            });
        }
    }