26 public void SetName(
string name) => Name = name;
29 public string Name =
"Unknown";
30 public Action<T, CUIComponent> OnSet;
31 public Func<T, CUIComponent, T> Validate;
32 public bool LayoutProp;
33 public bool DecorProp;
34 public bool AbsoluteProp;
35 public bool ChildProp;
36 public bool ShowInDebug =
true;
39 public void SetValue(T value, [CallerMemberName]
string memberName =
"")
43 CUI.
Log($
"{Name} CUIProp doens't have a Host! Type: {typeof(T)} Value: {value} memberName: {memberName}", Color.Red);
53 Value = Validate.Invoke(value, Host);
56 OnSet?.Invoke(value, Host);
60 CUIDebug.Capture(
null, Host,
"SetValue", memberName, Name, Value.ToString());
64 if (LayoutProp) Host.OnPropChanged();
65 if (DecorProp) Host.OnDecorPropChanged();
66 if (AbsoluteProp) Host.OnAbsolutePropChanged();
67 if (ChildProp) Host.OnChildrenPropChanged();
static void Log(object msg, Color? color=null, [CallerFilePath] string source="", [CallerLineNumber] int lineNumber=0)
Prints a message to console.