Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace EmeraldAI
- {
- public class EmeraldAIState
- {
- private bool _enabled;
- public bool Enabled => _enabled;
- public event Action OnEnable;
- public event Action OnDisable;
- public void Enable ()
- {
- _enabled = true;
- OnEnable?.Invoke ();
- }
- public void Disable ()
- {
- _enabled = false;
- OnDisable?.Invoke ();
- }
- public static implicit operator bool (EmeraldAIState state)
- {
- return (state != null) && state.Enabled;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement