public override void Update() { base.Update(); ChartEditor editor = ChartEditor.Instance; if (!audioStarted) { float audioPlayPoint = playFromTime + editor.services.totalSongAudioOffset; float currentTime = editor.services.currentAudioTime; if (currentTime >= audioPlayPoint && currentTime > 0) { editor.PlayAudio(currentTime); audioStarted = true; } } if (MSChartEditorInput.GetInputDown(MSChartEditorInputActions.StepIncrease)) { GameSettings.snappingStep.Increment(); } else if (MSChartEditorInput.GetInputDown(MSChartEditorInputActions.StepDecrease)) { GameSettings.snappingStep.Decrement(); } if (MSChartEditorInput.GetInputDown(MSChartEditorInputActions.PlayPause) || MSChartEditorInput.GetInputDown(MSChartEditorInputActions.StartGameplay)) { editor.Stop(); } }
public void PreviewToggle() { _previewing = !_previewing; // Disable UI foreach (GameObject go in disableDuringPreview) { go.SetActive(!_previewing); } // Set chart view mode Globals.viewMode = Globals.ViewMode.Chart; if (_previewing) { // Record the current position initialPosition = editor.visibleStrikeline.position.y; // Move to the start of the chart editor.movement.SetTime(-3); // Play editor.Play(); } else { // Stop editor.Stop(); // Restore to initial position editor.movement.SetTime(TickFunctions.WorldYPositionToTime(initialPosition)); } }
protected virtual void OnEnable() { editor.Stop(); editor.ChangeStateToMenu(); UITabbing.defaultSelectable = defaultSelectable; StartCoroutine(SetUIDelayed()); }
protected virtual void OnEnable() { editor.Stop(); Globals.applicationMode = Globals.ApplicationMode.Menu; UITabbing.defaultSelectable = defaultSelectable; StartCoroutine(SetUIDelayed()); }
public void PlayPause() { if (Globals.applicationMode == Globals.ApplicationMode.Editor) { editor.Play(); } else { editor.Stop(); } }
public void PlayPause() { if (editor.currentState == ChartEditor.State.Editor) { editor.Play(); } else { editor.Stop(); } }
void Shortcuts() { if (ShortcutInput.GetInputDown(Shortcut.PlayPause)) { if (applicationMode == ApplicationMode.Editor && services.CanPlay()) { editor.Play(); } else if (applicationMode == ApplicationMode.Playing) { editor.Stop(); } } else if (ShortcutInput.GetInputDown(Shortcut.StepIncrease)) { GameSettings.snappingStep.Increment(); } else if (ShortcutInput.GetInputDown(Shortcut.StepDecrease)) { GameSettings.snappingStep.Decrement(); } else if (ShortcutInput.GetInputDown(Shortcut.Delete) && editor.currentSelectedObjects.Count > 0) { editor.Delete(); } else if (ShortcutInput.GetInputDown(Shortcut.ToggleMetronome)) { services.ToggleMetronome(); services.notificationBar.PushNotification("METRONOME TOGGLED " + Services.BoolToStrOnOff(GameSettings.metronomeActive), 2, true); } if (!modifierInputActive) { if (editor.inputManager.mainGamepad.GetButtonPressed(GamepadInput.Button.Start)) { if (applicationMode != ApplicationMode.Playing) { editor.StartGameplay(); } else { editor.Stop(); } } } if (ShortcutInput.GetInputDown(Shortcut.FileSave)) { editor._Save(); } else if (ShortcutInput.GetInputDown(Shortcut.FileSaveAs)) { editor.SaveAs(); } else if (ShortcutInput.GetInputDown(Shortcut.FileLoad)) { editor.Load(); } else if (ShortcutInput.GetInputDown(Shortcut.FileNew)) { editor.New(); } else if (ShortcutInput.GetInputDown(Shortcut.SelectAll)) { services.toolpanelController.SetCursor(); HighlightAll(); } else if (ShortcutInput.GetInputDown(Shortcut.SelectAllSection)) { services.toolpanelController.SetCursor(); HighlightCurrentSection(); } if (!Input.GetMouseButton(0) && !Input.GetMouseButton(1)) { bool success = false; if (ShortcutInput.GetInputDown(Shortcut.ActionHistoryUndo)) { if (!editor.commandStack.isAtStart && editor.services.CanUndo()) { editor.UndoWrapper(); success = true; } } else if (ShortcutInput.GetInputDown(Shortcut.ActionHistoryRedo)) { if (!editor.commandStack.isAtEnd && editor.services.CanRedo()) { editor.RedoWrapper(); success = true; } } if (success) { EventSystem.current.SetSelectedGameObject(null); groupSelect.reset(); TimelineHandler.externalUpdate = true; } } if (editor.currentSelectedObjects.Count > 0) { if (ShortcutInput.GetInputDown(Shortcut.ClipboardCut)) { editor.Cut(); } else if (ShortcutInput.GetInputDown(Shortcut.ClipboardCopy)) { editor.Copy(); } } }