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