Enable Disable Toggle State Monobehaviour Class
This commit is contained in:
parent
01da5f8864
commit
af1e30058b
|
@ -20,5 +20,11 @@ namespace Syntriax.Modules.ToggleState
|
||||||
}
|
}
|
||||||
|
|
||||||
public Action<bool> OnToggleStateChanged { get; set; } = null;
|
public Action<bool> OnToggleStateChanged { get; set; } = null;
|
||||||
|
|
||||||
|
protected void Awake()
|
||||||
|
=> OnToggleStateChanged += (state) => enabled = state;
|
||||||
|
|
||||||
|
protected void OnEnable() => IsToggled = true;
|
||||||
|
protected void OnDisable() => IsToggled = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue