using System; using UnityEngine; namespace Syntriax.Modules.Movement.State { public class ToggleState : MonoBehaviour, IToggleState { private bool _toggled = true; public bool Toggled { get => _toggled; set { bool oldValue = _toggled; _toggled = value; if (oldValue = !value) OnToggleStateChanged?.Invoke(value); } } public Action OnToggleStateChanged { get; set; } = null; } }