using MoreMountains.Feedbacks; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace MoreMountains.Feel { /// /// This class handles Feel's MMSequencer demo scene, detecting input and starting/stopping its target sequencer /// public class MMSequencerDemoManager : MonoBehaviour { [Header("Sequence")] /// the feedback sequencer to pilot when pressing the ActionKey public MMFeedbacksSequencer TargetSequencer; /// /// On Update we detect input /// protected virtual void Update() { HandleInput(); } /// /// Every frame we check if input was pressed /// protected virtual void HandleInput() { if (FeelDemosInputHelper.CheckMainActionInputPressedThisFrame()) { Toggle(); } } /// /// Turns the sequencer on or off based on its current state /// protected virtual void Toggle() { if (TargetSequencer.Playing) { TargetSequencer.StopSequence(); } else { TargetSequencer.PlaySequence(); } } } }