public string[] GetPanelsDeclaration() { string[] fields = new string[Panels.Length]; int index = 0; foreach (var panel in Panels) { string field_name_downcase = NamesFormatter.PrivateMember(panel.ClassName, ""); string field_decl = string.Format("{0} _{1};", panel.ClassName, field_name_downcase); fields[index++] = field_decl; } return(fields); }
override internal void Visit(Panel panelDescr, PanelBase panelUI) { var fields = panelDescr.ComponentType.GetFields(BindingFlags.NonPublic | BindingFlags.Instance); string button_name = NamesFormatter.ObjectName(this.Name, "Button"); var button = PrefabsHelper.CreateObject("Button", button_name); button.transform.SetParent(panelUI.transform); UnityButton ui_button = button.GetComponent <UnityButton>(); string field_name = NamesFormatter.PrivateMember(this.Name, "Button"); foreach (var field in fields) { if (field.Name == field_name) { field.SetValue(panelUI, ui_button); } } }
public override string Declaration() { return("Button " + NamesFormatter.PrivateMember(name, "Button") + ";"); }