internal static BitMaskPanel Add( RoadEditorPanel roadEditorPanel, UIComponent container, string label, string hint, FlagDataT flagData) { try { Log.Debug($"BitMaskPanel.Add(container:{container}, label:{label}, enumType:{flagData.EnumType})"); var subPanel = UIView.GetAView().AddUIComponent(typeof(BitMaskPanel)) as BitMaskPanel; subPanel.FlagData = flagData; subPanel.Target = roadEditorPanel.GetTarget(); subPanel.Label.text = label + ":"; subPanel.Hint = hint; subPanel.Initialize(); container.AttachUIComponent(subPanel.gameObject); roadEditorPanel.FitToContainer(subPanel); subPanel.EventPropertyChanged += roadEditorPanel.OnObjectModified; return(subPanel); } catch (Exception ex) { Log.Exception(ex); return(null); } }
internal static MultiBitMaskPanel Add( RoadEditorPanel roadEditorPanel, UIComponent container, string label, string hint, params FlagDataT[] flagDatas) { Log.Debug($"BitMaskPanel.Add(container:{container}, label:{label})"); var subPanel = UIView.GetAView().AddUIComponent(typeof(MultiBitMaskPanel)) as MultiBitMaskPanel; subPanel.FlagDatas = flagDatas; subPanel.Label.text = label + ":"; subPanel.Hint = hint; subPanel.Target = roadEditorPanel.GetTarget(); subPanel.Initialize(); container.AttachUIComponent(subPanel.gameObject); roadEditorPanel.FitToContainer(subPanel); subPanel.EventPropertyChanged += roadEditorPanel.OnObjectModified; return(subPanel); }
public static void Reset(this RoadEditorPanel instance) => instance.Initialize(instance.GetTarget());