Ejemplo n.º 1
0
        public void Pause()
        {
            if (switchingMode)
            {
                return;
            }
            switchingMode = true;

            GameplayManager.Pause();
            TopBar.DOAnchorPosY(0, ModeSwitchDuration).SetEase(ToEditorModeEase);
            BottomBar.DOAnchorPosY(0, ModeSwitchDuration).SetEase(ToEditorModeEase);
            LeftBar.DOAnchorPosX(0, ModeSwitchDuration).SetEase(ToEditorModeEase);
            RightBar.DOAnchorPosX(0, ModeSwitchDuration).SetEase(ToEditorModeEase).OnComplete(() => { switchingMode = false; });
            GameplayCamera.DORect(EditorModeGameplayCameraRect, ModeSwitchDuration).SetEase(ToEditorModeEase);

            PauseButtonImage.sprite = PausePlay;
            PauseButton.spriteState = new SpriteState()
            {
                pressedSprite = PausePlayPressed
            };
            InfoCanvasGroup.interactable = true;

            TimingSliderHandle.sprite = DefaultSliderSprite;

            IsEditorMode = true;
        }
Ejemplo n.º 2
0
        public void Play()
        {
            if (AdeProjectManager.Instance.CurrentProjectMetadata == null || !ArcGameplayManager.Instance.IsLoaded)
            {
                AdeToast.Instance.Show("请先加载谱面");
                return;
            }

            if (switchingMode)
            {
                return;
            }
            switchingMode = true;

            GameplayManager.Play();
            TopBar.DOAnchorPosY(TopBar.sizeDelta.y, ModeSwitchDuration).SetEase(ToPlayerModeEase);
            BottomBar.DOAnchorPosY(-BottomBar.sizeDelta.y, ModeSwitchDuration).SetEase(ToPlayerModeEase);
            LeftBar.DOAnchorPosX(-LeftBar.sizeDelta.x, ModeSwitchDuration).SetEase(ToPlayerModeEase);
            RightBar.DOAnchorPosX(RightBar.sizeDelta.x, ModeSwitchDuration).SetEase(ToPlayerModeEase).OnComplete(() => { switchingMode = false; });
            GameplayCamera.DORect(new Rect(0, 0, 1, 1), ModeSwitchDuration).SetEase(ToPlayerModeEase);

            PauseButtonImage.sprite = PausePause;
            PauseButton.spriteState = new SpriteState()
            {
                pressedSprite = PausePausePressed
            };
            InfoCanvasGroup.interactable = false;

            TimingSliderHandle.sprite = GlowSliderSprite;

            AdeClickToCreate.Instance.CancelAddLongNote();
            AdeClickToCreate.Instance.Mode = ClickToCreateMode.Idle;

            IsEditorMode = false;
        }