protected override void ApplyProps(UIComponentProps props) { if (!(props is UIRadioGroupProps radioGroupSettings)) { throw new ArgumentException("UIRadioGroup: The given settings is not UIRadioGroupSettings"); } _canDeselectCurrent = radioGroupSettings.CanDeselectCurrent; base.ApplyProps(props); }
protected override void ApplyProps(UIComponentProps props) { if (!(props is UIContainerProps containerSettings)) { throw new ArgumentException("UIContainer: The given settings is not UIContainerSettings"); } SizeX = containerSettings.SizeX; SizeY = containerSettings.SizeY; base.ApplyProps(props); }
internal static T Create <T>(UIObject parent, UIComponentProps props = null) where T : UIComponent { if (parent == null) { throw new ArgumentNullException(nameof(parent)); } if (props == null) { throw new Exception("UIComponent: UIComponentProps can not be null"); } var component = new GameObject(typeof(T).Name).AddComponent <T>(); component.SetupParent(parent); component.ApplyProps(props); component.InitCompleted(true); mUI.ObjectCreated(component); return(component); }
protected virtual void ApplyProps(UIComponentProps props) { base.ApplyProps(props); }