protected override void Awake()
    {
        base.Awake();

        CurrentNotePlacementUpdate = UpdateMouseBurstMode;

        // Initialise the notes
        foreach (PlaceNote note in standardPlaceableNotes)
        {
            note.gameObject.SetActive(true);
            note.gameObject.SetActive(false);
        }

        {
            allPlaceableNotes.AddRange(standardPlaceableNotes);
            allPlaceableNotes.Add(openNote);
            allPlaceableNotes.Add(multiNote);
        }

        int totalNotes = allPlaceableNotes.Count;

        heldNotes  = new Note[totalNotes];
        inputBlock = new bool[totalNotes];

        EventsManager.onToolChangedEventList.Add(OnModeSwitch);
        EventsManager.onKeyboardModeToggledEvent.Add(OnKeysModeChanged);
        EventsManager.onNotePlacementModeChangedEvent.Add(OnModeSwitch);
    }
Beispiel #2
0
    protected override void Awake()
    {
        base.Awake();

        desiredFlags       = Note.Flags.None;
        forcedInteractable = true;
        tapInteractable    = true;
        cymbalInteractable = true;

        CurrentNotePlacementUpdate = UpdateMouseBurstMode;

        // Initialise the notes
        foreach (PlaceNote note in standardPlaceableNotes)
        {
            note.gameObject.SetActive(true);
            note.gameObject.SetActive(false);
        }

        {
            allPlaceableNotes.AddRange(standardPlaceableNotes);
            allPlaceableNotes.Add(openNote);
            allPlaceableNotes.Add(multiNote);
        }

        int totalNotes = allPlaceableNotes.Count;

        heldNotes  = new Note[totalNotes];
        inputBlock = new bool[totalNotes];

        editor.events.toolChangedEvent.Register(OnModeSwitch);
        editor.events.keyboardModeToggledEvent.Register(OnKeysModeChanged);
        editor.events.notePlacementModeChangedEvent.Register(OnModeSwitch);
        editor.events.editorStateChangedEvent.Register(OnApplicationModeSwitch);
    }
    void OnModeSwitch()
    {
        KeysDraggedSustainRecordingCheck();
        ResetNoteAdding();

        KeysControlsInit();

        if (GameSettings.keysModeEnabled)
        {
            if (KeysNotePlacementModePanelController.currentPlacementMode == KeysNotePlacementModePanelController.PlacementMode.Sustain)
            {
                CurrentNotePlacementUpdate = UpdateKeysSustainMode;
            }
            else
            {
                CurrentNotePlacementUpdate = UpdateKeysBurstMode;
            }
        }
        else
        {
            CurrentNotePlacementUpdate = UpdateMouseBurstMode;
        }
    }