soundvision/UnityProject/Assets/Editor/EditorToggle.cs

30 lines
604 B
C#
Raw Normal View History

2019-09-28 18:17:39 +00:00
using System;
namespace cylvester
{
public interface IEditorToggle
{
event Action ToggleStateChanged;
bool State { get; set; }
}
public class EditorToggle : IEditorToggle
{
private bool state_;
public event Action ToggleStateChanged = () => { };
public bool State
{
get => state_;
set
{
if (state_ != value)
{
state_ = value;
ToggleStateChanged.Invoke();
}
}
}
}
}