// Crest Water System // Copyright © 2024 Wave Harmonic. All rights reserved. using System; namespace WaveHarmonic.Crest { [AttributeUsage(AttributeTargets.Method, AllowMultiple = false, Inherited = true)] sealed class OnChange : Attribute { public Type Type { get; } public bool SkipIfInactive { get; } /// /// Register an instance method as an OnChange handler. /// public OnChange(bool skipIfInactive = true) { SkipIfInactive = skipIfInactive; } /// /// Register a static method as an OnChange handler. /// /// The type to target. /// Skip this handler if component is inactive. public OnChange(Type type, bool skipIfInactive = true) { Type = type; SkipIfInactive = skipIfInactive; } } }