1
This commit is contained in:
@@ -71,9 +71,10 @@ namespace BITKit.UX.Components
|
||||
[System.Serializable]
|
||||
public sealed class BoolEvent : DataComponents
|
||||
{
|
||||
public UnityEvent<bool> outputEvent;
|
||||
public UnityEvent ifTrueEvent;
|
||||
public UnityEvent ifFlaseEvent;
|
||||
[SerializeField]private UnityEvent<bool> outputEvent;
|
||||
[SerializeField]private UnityEvent ifTrueEvent;
|
||||
[SerializeField]private UnityEvent ifFlaseEvent;
|
||||
private readonly Optional<bool> _current = new();
|
||||
public override void OnStart()
|
||||
{
|
||||
Data.AddListener<bool>(key, OnSetBool, true);
|
||||
@@ -84,6 +85,11 @@ namespace BITKit.UX.Components
|
||||
}
|
||||
async void OnSetBool(bool boolean)
|
||||
{
|
||||
if (_current.Allow)
|
||||
{
|
||||
if (_current.Value == boolean) return;
|
||||
}
|
||||
_current.SetValueThenAllow(boolean);
|
||||
try
|
||||
{
|
||||
await UniTask.SwitchToMainThread(BITApp.CancellationToken);
|
||||
|
Reference in New Issue
Block a user