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); }
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; } }
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); }); }
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); } }
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); }
private void ChangeColor() { AnimCurveController.Color(curve, start, end, totalTime, widget, () => { if (bLoop) { ChangeColor(); } }); }
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); }
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); }
private void Awake() { if (instance == null) { instance = this; DontDestroyOnLoad(gameObject); } else { Destroy(gameObject); } }
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(); } }); }
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(); } }); }
private static AnimCurveController GetInstance() { if (instance == null) { instance = FindObjectOfType <AnimCurveController>(); } if (instance == null) { GameObject obj = new GameObject("AnimCurveController"); instance = obj.AddComponent <AnimCurveController>(); } return(instance); }
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()); }
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); }); }
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); }
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); }
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(); } }); }
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(); } }); }
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; }); }
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()); }); }
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(); } } }); } }