soundvision/UnityProject/Assets/Editor/EditorToggle.cs
Chikashi Miyama 78023946cd close #28
2019-09-28 20:17:39 +02:00

30 lines
No EOL
604 B
C#

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();
}
}
}
}
}